class CXmlEngSerializer : public CBase |
Provides the serializer interface and provides common functionality to all serializers. Implements default serialization (plain XML). Derived classes implement serialization to other formats.
Public Member Functions | |
---|---|
~CXmlEngSerializer() | |
IMPORT_C CXmlEngSerializer * | NewL(TXmlEngSerializerType) |
IMPORT_C TInt | SerializeL(const TXmlEngNode) |
IMPORT_C TInt | SerializeL(const TDesC &, const TXmlEngNode, const TXmlEngSerializationOptions &) |
IMPORT_C TInt | SerializeL(RFs &, const TDesC &, const TXmlEngNode, const TXmlEngSerializationOptions &) |
IMPORT_C TInt | SerializeL(RBuf8 &, const TXmlEngNode, const TXmlEngSerializationOptions &) |
IMPORT_C void | SetOutput(RBuf8 &) |
IMPORT_C void | SetOutput(MXmlEngOutputStream &) |
IMPORT_C void | SetOutputL(const TDesC &) |
IMPORT_C void | SetSerializationOptions(TXmlEngSerializationOptions &) |
Private Member Functions | |
---|---|
CXmlEngSerializer() | |
void | ConstructL() |
Private Attributes | |
---|---|
RBuf8 * | iBuffer |
HBufC * | iOutFileName |
MXmlEngOutputStream * | iOutputStream |
TXmlEngSerializationOptions * | iSerializationOptions |
TXmlEngSerializationOutput | iSerializationOutput |
IMPORT_C CXmlEngSerializer * | NewL | ( | TXmlEngSerializerType | aType = ESerializerDefault | ) | [static] |
Creates a serializer of the given type. Returns an instance of this class or a derived class.
The serializer
leave
One of the system-wide error codes
TXmlEngSerializerType aType = ESerializerDefault | Serializer type |
IMPORT_C TInt | SerializeL | ( | const TXmlEngNode | aRoot = TXmlEngNode() | ) | [virtual] |
Serializes a DOM tree to the buffer, file or stream set previously with SetOutputL() or SetOutput().
The number of bytes written
leave
KXmlEngErrNoParameters No previous call to SetOutputL() or SetOutput().
leave
KErrNotSupported Unsupported serialization type
leave
KXmlEngErrWrongEncoding Encoding not understood
leave
KXmlEngErrWrongUseofAPI Document of root node is NULL
leave
KXmlEngErrNegativeOutputSize The data to be serialized has a negative size
leave
One of the system-wide error codes
const TXmlEngNode aRoot = TXmlEngNode() | The root node of the DOM tree to be serialized |
IMPORT_C TInt | SerializeL | ( | const TDesC & | aFileName, |
const TXmlEngNode | aRoot = TXmlEngNode(), | |||
const TXmlEngSerializationOptions & | aOptions = TXmlEngSerializationOptions() | |||
) | [virtual] |
Serializes a DOM tree to file. Any filename previously set with SetOutputL(const TDesC&) is ignored.
The number of bytes written
leave
KXmlEngErrWrongEncoding Encoding not understood
leave
KXmlEngErrWrongUseofAPI Document of root node is NULL
leave
KXmlEngErrNegativeOutputSize The data to be serialized has a negative size
leave
One of the system-wide error codes
const TDesC & aFileName | The file name to serialize to |
const TXmlEngNode aRoot = TXmlEngNode() | The root node of the DOM tree to be serialized |
const TXmlEngSerializationOptions & aOptions = TXmlEngSerializationOptions() | The serialization options |
IMPORT_C TInt | SerializeL | ( | RFs & | aRFs, |
const TDesC & | aFileName, | |||
const TXmlEngNode | aRoot = TXmlEngNode(), | |||
const TXmlEngSerializationOptions & | aOptions = TXmlEngSerializationOptions() | |||
) | [virtual] |
Serializes a DOM tree to file. Any filename previously set with SetOutputL(const TDesC&) is ignored.
The number of bytes written
leave
KXmlEngErrWrongEncoding Encoding not understood
leave
KXmlEngErrWrongUseofAPI Document of root node is NULL
leave
KXmlEngErrNegativeOutputSize The data to be serialized has a negative size
leave
One of the system-wide error codes
RFs & aRFs | File Server session |
const TDesC & aFileName | The file name to serialize to |
const TXmlEngNode aRoot = TXmlEngNode() | The root node of the DOM tree to be serialized |
const TXmlEngSerializationOptions & aOptions = TXmlEngSerializationOptions() | The serialization options |
IMPORT_C TInt | SerializeL | ( | RBuf8 & | aBuffer, |
const TXmlEngNode | aRoot = TXmlEngNode(), | |||
const TXmlEngSerializationOptions & | aOptions = TXmlEngSerializationOptions() | |||
) | [virtual] |
Serializes a DOM tree to buffer. Any buffer previously set with SetOutputL(RBuf8&) is ignored. Any existing data in aBuffer is destroyed. This function allocates memory for the buffer and the caller must close the buffer when finished.
The number of bytes written
leave
KXmlEngErrWrongEncoding Encoding not understood
leave
KXmlEngErrWrongUseofAPI Document of root node is NULL
leave
KXmlEngErrNegativeOutputSize The data to be serialized has a negative size
leave
One of the system-wide error codes
RBuf8 & aBuffer | The buffer to serialize to |
const TXmlEngNode aRoot = TXmlEngNode() | The root node of DOM tree |
const TXmlEngSerializationOptions & aOptions = TXmlEngSerializationOptions() | The serialization options |
IMPORT_C void | SetOutput | ( | RBuf8 & | aBuffer | ) |
Sets the output type to buffer and saves the buffer for later serialization.
RBuf8 & aBuffer | The buffer to serialize |
IMPORT_C void | SetOutput | ( | MXmlEngOutputStream & | aStream | ) |
Sets the output type to stream and saves the stream for later serialization.
MXmlEngOutputStream & aStream |
IMPORT_C void | SetOutputL | ( | const TDesC & | aFileName | ) |
Sets the output type to file and saves the file name for later serialization. leave
One of the system-wide error codes
const TDesC & aFileName | The file name of the file to serialize |
IMPORT_C void | SetSerializationOptions | ( | TXmlEngSerializationOptions & | aOptions | ) |
Sets the serialization options
TXmlEngSerializationOptions & aOptions | The serialization options to set. Ownership is not transferred and aOptions must stay in scope for the lifetime of the serializer. |
TXmlEngSerializationOptions * | iSerializationOptions | [private] |
TXmlEngSerializationOutput | iSerializationOutput | [private] |