Loading...
Searching...
No Matches
DocumentBackupManager.hpp
1#pragma once
2#include <QByteArray>
3#include <QObject>
4#include <QTemporaryFile>
5
6#include <score_lib_base_export.h>
7
8namespace score
9{
10class CommandBackupFile;
11class Document;
12struct RestorableDocument;
13
37class DocumentBackupManager final : public QObject
38{
39public:
43 explicit DocumentBackupManager(const QByteArray& data, Document& doc);
44
48
50
51 void saveModelData(const QByteArray&);
52
53 void updateBackupData();
54
56 SCORE_LIB_BASE_TEST_EXPORT QString commandFileName();
57
58private:
59 void storeModelData(const QByteArray& data);
60 QTemporaryFile& crashDataFile();
61 CommandBackupFile& crashCommandFile();
62
63 score::Document& m_doc;
64#if defined(__EMSCRIPTEN__)
66 QString m_key;
67#endif
68 QTemporaryFile m_modelFile;
69 CommandBackupFile* m_commandFile{};
71 QString m_modelFileName;
72};
73}
Abstraction over the backup of commands.
Definition CommandBackupFile.hpp:36
Handles document backup to allow restoring if there is a crash.
Definition DocumentBackupManager.hpp:38
QString commandFileName()
Where the commands are saved as they are made.
Definition DocumentBackupManager.cpp:91
The Document class is the central part of the software.
Definition Document.hpp:51
Base toolkit upon which the software is built.
Definition Application.cpp:83
Definition DocumentBackups.hpp:14