class CCL::Archive

Overview

#include <archive.h>

class Archive
{
public:
    // typedefs

    typedef CStringRef ObjectID;

    // fields

    static StringID kSaveTypeCopy;
    static StringID kSaveTypePreview;

    // construction

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

    // 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

Methods

virtual ArchiveType getArchiveType () const = 0

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

virtual bool isAnonymous () const = 0

true if archive doesn’t provide type information