class CCL::DocumentVersions

Overview

#include <documentversions.h>

class DocumentVersions
{
public:
    // fields

    static constexpr int kBuildTimeout = 5000;
    static const String strDocumentSnapshotSuffix;
    static const String strAutosaveSnapshotSuffix;

    // construction

    DocumentVersions (UrlRef documentPath);

    // methods

    static bool isSupported ();
    static void setSupported (bool state);
    static StringRef getHistoryFolderName ();

    static String getDisplayDescription (
        const DocumentMetaInfo& metaInfo,
        bool forceDescription = true
    );

    static void appendOriginalSuffix (Url& path);

    static void onActiveVersionChanged (
        UrlRef oldDocumentPath,
        UrlRef newDocumentPath
    );

    static void getSortOrder (MutableCString& columnID, tbool& upwards);
    static void setSortOrder (StringID columnID, tbool upwards);
    static void sortDescriptions (ObjectArray& descriptions);
    static Core::VectorCompareFunction* getCompareFunction (StringID id);
    static int compareAutoSave (DocumentDescription& lhs, DocumentDescription& rhs);
    void getHistoryFolder (Url& path);

    void makeHistoryPath (
        Url& path,
        const String* suffix = nullptr,
        bool withTimeStamp = true
    );

    void makeHistoryPath (
        Url& path,
        StringRef baseName,
        const String* suffix,
        bool withTimeStamp
    );

    void makeVersionPath (Url& path);
    Url makeVersionPathInDocumentFolder (UrlRef sourcePath);
    bool buildHistory (Container& list, int timeout = kBuildTimeout);
    bool copyOldFormatToHistory (const Document& doc);
    bool moveDocumentVersionToHistory ();

    bool moveDocumentToHistory (
        const IUrl* docFile = nullptr,
        const String* suffix = nullptr
    );

    bool purgeOldest (StringRef description, int numFilesToKeep);
    bool restoreDocumentVersion (UrlRef historyFile);
};

Detailed Documentation

Methods

bool buildHistory (Container& list, int timeout = kBuildTimeout)

list of DocumentDescription