Location:
conarc.h
Link against: conarc.lib
CConverterBase
Supported from 6.0
Polymorphic interface for converters from one data format to another.
Clients use this interface to access data converters. The implementator of a data converter derives a class from this in which to implement the appropriate conversion functionality.
The interface offers conversions between files, and between objects that support the stream interfaces, e.g. stream stores.
There are two flavours of conversion methods:
the synchronous interfaces, ConvertL()
and ConvertObjectL()
, which perform the specified conversion and then return
the asynchronous interfaces, ConvertAL()
and ConvertObjectAL()
, which initialise the converter object, and allow the client code to call DoConvertL()
a number of times until the conversion is complete or abandoned
|
Defined in CConverterBase
:
CancelConvert()
, Capabilities()
, ConvertAL()
, ConvertL()
, ConvertObjectAL()
, ConvertObjectL()
, DoConvertL()
, EConvertsExtract
, EConvertsFiles
, EConvertsObjects
, EmbeddedObjectL()
, GetEmbeddedFileName()
, TCapability
, Uid()
Inherited from CBase
:
operator new()
virtual void ConvertAL(const TFileName& aSourceFile, const TFileName& aTargetFile, MConverterUiObserver* aObserver=NULL);
Prepares for conversion in multiple steps of a file.
Clients must call this function before calling DoConvertL()
one or more times to do the conversion. The function can call back the MaxSteps()
function of the supplied MConverterUiObserver
to tell the client the maximum number of calls to DoConvertL()
that will be required.
The rest of the description describes how to implement this function.
The function should initialise the object before performing a conversion, but should not do the conversion itself. Such initialisation should include:
storing the MConverterUiObserver
pointer (if supplied), so the client can later be notified of conversion progress
validating the integrity of the input data
optionally, creating the appropriate application engine, either for input or output, to enable access to the data
determining the number of steps (i.e. calls to DoConvertL()
) required to perform the conversion and pass this to the client by calling MConverterUiObserver::MaxSteps()
The default implementation leaves with KErrNotSupported
.
|
|
virtual void ConvertL(const TFileName& aSourceFile, const TFileName& aTargetFile, MConverterUiObserver* aObserver=NULL);
Converts a file in a single step.
The caller can supply a MConverterUiObserver
to be informed of progress in the conversion.
The default implementation calls ConvertAL()
to prepare the object to perform the conversion, and then calls DoConvertL()
in a loop until conversion is complete.
|
|
virtual void ConvertObjectAL(RReadStream& aReadStream, RWriteStream& aWriteStream, MConverterUiObserver* aObserver=NULL);
Prepares for conversion in multiple steps of a stream object.
Clients must call this function before calling DoConvertL()
one or more times to do the conversion. The function can call back the MaxSteps()
function of the supplied MConverterUiObserver
to tell the client the maximum number of calls to DoConvertL()
that will be required.
For a description of how to implement this function, see ConvertAL()
.
|
|
virtual void ConvertObjectL(RReadStream& aReadStream, RWriteStream& aWriteStream, MConverterUiObserver* aObserver=NULL);
Converts a stream object in a single step.
The caller can supply a MConverterUiObserver
to be informed of progress in the conversion.
The default implementation calls ConvertObjectAL()
to prepare the object to perform the conversion, and then calls DoConvertL()
in a loop until conversion is complete.
|
virtual TBool DoConvertL();
Performs a step in converting the data.
The function advances a step in converting the data each time that it is called. When conversion is complete, the function returns EFalse
.
|
virtual void CancelConvert();
Cleans up a conversion that has been prepared or is in progress.
It should free any resources and reset the converter object to an initial state.
The default is to do nothing.
virtual TInt Capabilities();
Gets the converter's capabilities.
The default is to return a bitmask of all the TCapability
flags.
|
virtual CConverterBase* EmbeddedObjectL(TDataType& aType);
Gets a converter for an embedded object of the specified type.
The default is to return NULL
.
|
|
virtual TBool GetEmbeddedFileName(TFileName& aFileName);
Gets a filename embedded in the object.
|
|
TCapability
Bitmask values that describe the capabilities of the converter.
|