CXmlEngSerializer Class Reference

#include <xml/dom/xmlengserializer.h>

Link against: xmlengineserializer.lib

class CXmlEngSerializer : public CBase

Inherits from

  • CXmlEngSerializer

    Detailed Description

    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

    Constructor & Destructor Documentation

    ~CXmlEngSerializer ( )

    ~CXmlEngSerializer()[virtual]

    Destructor

    Member Function Documentation

    NewL ( TXmlEngSerializerType )

    IMPORT_C CXmlEngSerializer *NewL(TXmlEngSerializerTypeaType = ESerializerDefault)[static]

    Creates a serializer of the given type. Returns an instance of this class or a derived class.

    leave
    • One of the system-wide error codes

    ParameterDescription
    aTypeSerializer type

    Returns: The serializer

    SerializeL ( const TXmlEngNode )

    IMPORT_C TIntSerializeL(const TXmlEngNodeaRoot =  TXmlEngNode())[virtual]

    Serializes a DOM tree to the buffer, file or stream set previously with SetOutputL() or SetOutput().

    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

    ParameterDescription
    aRootThe root node of the DOM tree to be serialized

    Returns: The number of bytes written

    SerializeL ( const TDesC &, const TXmlEngNode, const TXmlEngSerializationOptions & )

    IMPORT_C TIntSerializeL(const TDesC &aFileName,
    const TXmlEngNodeaRoot =  TXmlEngNode(),
    const TXmlEngSerializationOptions &aOptions =  TXmlEngSerializationOptions()
    )[virtual]

    Serializes a DOM tree to file. Any filename previously set with SetOutputL(const TDesC&) is ignored.

    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

    ParameterDescription
    aFileNameThe file name to serialize to
    aRootThe root node of the DOM tree to be serialized
    aOptionsThe serialization options

    Returns: The number of bytes written

    SerializeL ( RFs &, const TDesC &, const TXmlEngNode, const TXmlEngSerializationOptions & )

    IMPORT_C TIntSerializeL(RFs &aRFs,
    const TDesC &aFileName,
    const TXmlEngNodeaRoot =  TXmlEngNode(),
    const TXmlEngSerializationOptions &aOptions =  TXmlEngSerializationOptions()
    )[virtual]

    Serializes a DOM tree to file. Any filename previously set with SetOutputL(const TDesC&) is ignored.

    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

    ParameterDescription
    aRFsFile Server session
    aFileNameThe file name to serialize to
    aRootThe root node of the DOM tree to be serialized
    aOptionsThe serialization options

    Returns: The number of bytes written

    SerializeL ( RBuf8 &, const TXmlEngNode, const TXmlEngSerializationOptions & )

    IMPORT_C TIntSerializeL(RBuf8 &aBuffer,
    const TXmlEngNodeaRoot =  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.

    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

    ParameterDescription
    aBufferThe buffer to serialize to
    aRootThe root node of DOM tree
    aOptionsThe serialization options

    Returns: The number of bytes written

    SetOutput ( RBuf8 & )

    IMPORT_C voidSetOutput(RBuf8 &aBuffer)

    Sets the output type to buffer and saves the buffer for later serialization.

    ParameterDescription
    aBufferThe buffer to serialize

    SetOutput ( MXmlEngOutputStream & )

    IMPORT_C voidSetOutput(MXmlEngOutputStream &aStream)

    Sets the output type to stream and saves the stream for later serialization.

    SetOutputL ( const TDesC & )

    IMPORT_C voidSetOutputL(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

    ParameterDescription
    aFileNameThe file name of the file to serialize

    SetSerializationOptions ( TXmlEngSerializationOptions & )

    IMPORT_C voidSetSerializationOptions(TXmlEngSerializationOptions &aOptions)

    Sets the serialization options

    ParameterDescription
    aOptionsThe serialization options to set. Ownership is not transferred and aOptions must stay in scope for the lifetime of the serializer.