DocumentBackupManager.hpp
1 #pragma once
2 #include <QByteArray>
3 #include <QObject>
4 #include <QTemporaryFile>
5 
6 namespace score
7 {
8 class CommandBackupFile;
9 class Document;
10 struct RestorableDocument;
11 
35 class DocumentBackupManager final : public QObject
36 {
37 public:
41  explicit DocumentBackupManager(const QByteArray& data, Document& doc);
42 
45  explicit DocumentBackupManager(const score::RestorableDocument& prev, Document& doc);
46 
48 
49  void saveModelData(const QByteArray&);
50 
51  void updateBackupData();
52 
53 private:
54  QTemporaryFile& crashDataFile();
55  CommandBackupFile& crashCommandFile();
56 
57  score::Document& m_doc;
58  QTemporaryFile m_modelFile;
59  CommandBackupFile* m_commandFile{};
60 };
61 }
Abstraction over the backup of commands.
Definition: CommandBackupFile.hpp:34
Handles document backup to allow restoring if there is a crash.
Definition: DocumentBackupManager.hpp:36
DocumentBackupManager(const QByteArray &data, Document &doc)
Definition: DocumentBackupManager.cpp:14
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:90
Definition: DocumentBackups.hpp:14