#include <xml/dom/xmlengserializer.h>
Link against: xmlengineserializer.lib
class CXmlEngSerializer : public CBase |
Public Member Functions | |
---|---|
virtual | ~CXmlEngSerializer() |
IMPORT_C CXmlEngSerializer * | NewL(TXmlEngSerializerType) |
virtual IMPORT_C TInt | SerializeL(const TXmlEngNode) |
virtual IMPORT_C TInt | SerializeL(const TDesC &, const TXmlEngNode, const TXmlEngSerializationOptions &) |
virtual IMPORT_C TInt | SerializeL(RFs &, const TDesC &, const TXmlEngNode, const TXmlEngSerializationOptions &) |
virtual 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 &) |
Provides the serializer interface and provides common functionality to all serializers. Implements default serialization (plain XML). Derived classes implement serialization to other formats.
See also: TXmlEngSerializerType
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.
Parameters | |
---|---|
aType | Serializer type |
Leave Codes | |
---|---|
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().
Parameters | |
---|---|
aRoot | The root node of the DOM tree to be serialized |
Leave Codes | |
---|---|
KXmlEngErrNoParameters | No previous call to |
KErrNotSupported | Unsupported serialization type |
KXmlEngErrWrongEncoding | Encoding not understood |
KXmlEngErrWrongUseofAPI | Document of root node is NULL |
KXmlEngErrNegativeOutputSize | The data to be serialized has a negative size |
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.
Parameters | |
---|---|
aFileName | The file name to serialize to |
aRoot | The root node of the DOM tree to be serialized |
aOptions | The serialization options |
Leave Codes | |
---|---|
KXmlEngErrWrongEncoding | Encoding not understood |
KXmlEngErrWrongUseofAPI | Document of root node is NULL |
KXmlEngErrNegativeOutputSize | The data to be serialized has a negative size |
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.
Parameters | |
---|---|
aRFs | File Server session |
aFileName | The file name to serialize to |
aRoot | The root node of the DOM tree to be serialized |
aOptions | The serialization options |
Leave Codes | |
---|---|
KXmlEngErrWrongEncoding | Encoding not understood |
KXmlEngErrWrongUseofAPI | Document of root node is NULL |
KXmlEngErrNegativeOutputSize | The data to be serialized has a negative size |
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.
Parameters | |
---|---|
aBuffer | The buffer to serialize to |
aRoot | The root node of DOM tree |
aOptions | The serialization options |
Leave Codes | |
---|---|
KXmlEngErrWrongEncoding | Encoding not understood |
KXmlEngErrWrongUseofAPI | Document of root node is NULL |
KXmlEngErrNegativeOutputSize | The data to be serialized has a negative size |
IMPORT_C void | SetOutput | ( | RBuf8 & | aBuffer | ) |
Sets the output type to buffer and saves the buffer for later serialization.
Parameters | |
---|---|
aBuffer | The buffer to serialize |
IMPORT_C void | SetOutput | ( | MXmlEngOutputStream & | aStream | ) |
Sets the output type to stream and saves the stream for later serialization.
IMPORT_C void | SetOutputL | ( | const TDesC & | aFileName | ) |
Parameters | |
---|---|
aFileName | The file name of the file to serialize |
Leave Codes | |
---|---|
IMPORT_C void | SetSerializationOptions | ( | TXmlEngSerializationOptions & | aOptions | ) |
Sets the serialization options
Parameters | |
---|---|
aOptions | The serialization options to set. Ownership is not transferred and aOptions must stay in scope for the lifetime of the serializer. |