console/kabcclient
FormatFactory Class Reference
#include <formatfactory.h>
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; }
- See also:
- InputFormat
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 | ( | ) |
| FormatFactory::~FormatFactory | ( | ) |
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
0if the name is unknown to the factory
- See also:
- inputFormatList()
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()
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
0if the name is unknown to the factory
- See also:
- inputFormatList()
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()
Definition at line 143 of file formatfactory.h.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference