|
|
The DataTranslator holds a translator (codec) capable of unidirectional conversion of data from one type to another
DataTranslator (const char *sFormat, const char *dFormat)
| DataTranslator |
Construct a data translator
Parameters:
sFormat | Name of the source format (data received from the consumer) |
dFormat | Name of the destination format (data supplied to the source) |
DataTranslator (const char *sFormat, DataSource *source = 0)
| DataTranslator |
Creates a data translator from an existing source does not increment the source's reference counter
Parameters:
sFormat | Name of the source format (data received from the consumer) |
source | Optional pointer to a DataSource object |
~DataTranslator ()
| ~DataTranslator |
Destroys the translator and its source
DataSource * getTransSource ()
| getTransSource |
[const virtual]
Get the data source of a translator object
Returns: A pointer to the DataSource object or NULL
Reimplemented from DataConsumer.
String srcFormats (const String &dFormat = "slin")
| srcFormats |
[static]
Get a textual list of formats supported for a given output format
Parameters:
dFormat | Name of destination format |
Returns: Space separated list of source formats
String destFormats (const String &sFormat = "slin")
| destFormats |
[static]
Get a textual list of formats supported for a given input format
Parameters:
sFormat | Name of source format |
Returns: Space separated list of destination formats
int cost (const String &sFormat, const String &dFormat)
| cost |
[static]
Finds the cost of a translator given the source and destination format names
Parameters:
sFormat | Name of the source format (data received from the consumer) |
dFormat | Name of the destination format (data supplied to the source) |
Returns: Cost of best (cheapest) codec or -1 if no known codec exists
DataTranslator * create (const String &sFormat, const String &dFormat)
| create |
[static]
Creates a translator given the source and destination format names
Parameters:
sFormat | Name of the source format (data received from the consumer) |
dFormat | Name of the destination format (data supplied to the source) |
Returns: A pointer to a DataTranslator object or NULL if no known codec exists
bool attachChain (DataSource *source, DataConsumer *consumer)
| attachChain |
[static]
Attach a consumer to a source, possibly trough a chain of translators
Parameters:
source | Source to attach the chain to |
consumer | Consumer where the chain ends |
Returns: True if successfull, false if no translator chain could be built
bool detachChain (DataSource *source, DataConsumer *consumer)
| detachChain |
[static]
Detach a consumer from a source, possibly trough a chain of translators
Parameters:
source | Source to dettach the chain from |
consumer | Consumer where the chain ends |
Returns: True if successfull, false if source and consumers were not attached
void install (TranslatorFactory *factory)
| install |
[protected static]
Install a Translator Factory in the list of known codecs
Parameters:
factory | A pointer to a TranslatorFactory instance |
void uninstall (TranslatorFactory *factory)
| uninstall |
[protected static]
Remove a Translator Factory from the list of known codecs
Parameters:
factory | A pointer to a TranslatorFactory instance |
Generated by: kk on nyx on Sat Jun 4 19:29:41 2005, using kdoc 2.0a54. |