• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

console/kabcclient

FormatFactory Class Reference

#include <formatfactory.h>

List of all members.


Detailed Description

Factory for input parsers and output formatters.

The factory can be queried for the InputFormat and OutputFormat implementations it knows and can create.

Example: displaying all format names and their respective description

 FormatFactory factory;

 QByteArrayList inputFormats = factory.inputFormatList();
 QByteArrayList::const_iterator it = inputFormats.being();
 for (; it != inputFormats.end(); ++it)
 {
     InputFormat* inputFormat = factory.inputFormat(*it);
     cout << *it << endl;
     cout << inputFormat->description().local8Bit() << endl;
     delete inputFormat;
 }

 QByteArrayList outputFormats = factory.outputFormatList();
 it = outputFormats.being();
 for (; it != outputFormats.end(); ++it)
 {
     OutputFormat* outputFormat = factory.outputFormat(*it);
     cout << *it << endl;
     cout << outputFormat->description().local8Bit() << endl;
     delete outputFormat;
 }

Author:
Kevin Krammer, <kevin.krammer@gmx.at>
See also:
InputFormat

OutputFormat

Definition at line 102 of file formatfactory.h.


Public Member Functions

 FormatFactory ()
InputFormat * inputFormat (const QByteArray &name)
QByteArrayList inputFormatList () const
OutputFormat * outputFormat (const QByteArray &name)
QByteArrayList outputFormatList () const
 ~FormatFactory ()

Constructor & Destructor Documentation

FormatFactory::FormatFactory (  ) 

Creates and initializes the factory.

Definition at line 27 of file formatfactory.cpp.

FormatFactory::~FormatFactory (  ) 

Destroys the factory and its internal data.

Definition at line 46 of file formatfactory.cpp.


Member Function Documentation

InputFormat * FormatFactory::inputFormat ( const QByteArray &  name  ) 

Creates an InputFormat instance for the given name.

Warning:
Every call creates a new instance and the caller gains its ownership, i.e. has to delete it when it isn't used any longer.
Parameters:
name the input format name, as taken from the commandline
Returns:
a new InputFormat instance of the input parser associated with the given name or 0 if the name is unknown to the factory
See also:
inputFormatList()

InputFormat

outputFormat

Definition at line 53 of file formatfactory.cpp.

QByteArrayList FormatFactory::inputFormatList (  )  const [inline]

Returns a list of input parser names.

Each list entry is a simple string that can be used to identify the parser on the commandline. The factory method inputFormat() will check for exactly those strings.

Returns:
a list of input parser names
See also:
inputFormat()

InputFormat

outputFormatList()

Definition at line 128 of file formatfactory.h.

OutputFormat * FormatFactory::outputFormat ( const QByteArray &  name  ) 

Creates an OutputFormat instance for the given name.

Warning:
Every call creates a new instance and the caller gains its ownership, i.e. has to delete it when it isn't used any longer.
Parameters:
name the output format name, as taken from the commandline
Returns:
a new OutputFormat instance of the output formatter associated with the given name or 0 if the name is unknown to the factory
See also:
inputFormatList()

InputFormat

outputFormat

Definition at line 81 of file formatfactory.cpp.

QByteArrayList FormatFactory::outputFormatList (  )  const [inline]

Returns a list of output formatter names.

Each list entry is a simple string that can be used to identify the formatter on the commandline. The factory method outputFormat() will check for exactly those strings.

Returns:
a list of output formatter names
See also:
outputFormat()

OutputFormat

inputFormatList()

Definition at line 143 of file formatfactory.h.


The documentation for this class was generated from the following files:
  • formatfactory.h
  • formatfactory.cpp

console/kabcclient

Skip menu "console/kabcclient"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  •   doc
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal