class CCL::XmlArchive

Overview

XML storage archive. More…

#include <xmlarchive.h>

class XmlArchive: public CCL::Archive
{
public:
    // enums

    enum Flags;

    // fields

    static const CString defaultRootTag = "CCL.XmlArchive";
     kDefineNamespace;
    defineNamespace kSilentOnErrors;

    // construction

    XmlArchive (
        IStream& stream,
        Attributes* context = nullptr,
        StringID saveType = nullptr
    );

    // methods

    PROPERTY_FLAG (flags, kCharDataUTF8, charDataUTF8);
    defineNamespace PROPERTY_FLAG (flags, kDontFailOnXmlError, dontFailOnXmlError);
    virtual defineNamespace silentOnErrors ArchiveType getArchiveType () const;
    virtual bool isAnonymous () const;
    virtual bool saveAttributes (ObjectID root, const Attributes& attributes);
    virtual bool loadAttributes (ObjectID root, Attributes& attributes);
    bool saveObject (ObjectID name, const Object& object);
    static const FileType& getFileType ();
};

Inherited Members

public:
    // typedefs

    typedef CStringRef ObjectID;

    // fields

    static StringID kSaveTypeCopy;
    static StringID kSaveTypePreview;

    // methods

    virtual ArchiveType getArchiveType () const = 0;
    virtual bool isAnonymous () const = 0;
    PROPERTY_VARIABLE (int, flags, Flags);
    void setContext (Attributes* context);
    Attributes* getContext ();
    PROPERTY_MUTABLE_CSTRING (saveType, SaveType);
    bool saveObject (ObjectID name, const Object& object);
    bool loadObject (ObjectID name, Object& object);
    virtual bool saveAttributes (ObjectID root, const Attributes& attributes) = 0;
    virtual bool loadAttributes (ObjectID root, Attributes& attributes) = 0;

Detailed Documentation

XML storage archive.

Fields

static const CString defaultRootTag = "CCL.XmlArchive"

default root tag

Methods

virtual defineNamespace silentOnErrors ArchiveType getArchiveType () const

archive type (XML, JSON, binary, etc.)

virtual bool isAnonymous () const

true if archive doesn’t provide type information

static const FileType& getFileType ()

default file type