Autosave coordinator that never overwrites the formal document URI. 更多...
#include <EditorDiskDocumentStore.h>
Public 成员函数 | |
| AutosaveService (IAtomicDocumentStore *store, std::string projectId) | |
| Create an autosave namespace. | |
| Result< StoredDocument > | writeDraft (const DocumentSnapshot &snapshot, const EditorValue &content) |
| Write one revisioned draft under autosave://project/document.draft. | |
| Result< AutosaveDraft > | readDraft (const DocumentId &document) const |
| Read a draft and validate its schema. | |
| bool | shouldOfferRecovery (const AutosaveDraft &draft, const DocumentSnapshot &formal) const |
| True when a newer draft differs from the current formal disk base. | |
| std::string | draftUri (const DocumentId &document) const |
| Return the stable draft URI for one document. | |
详细描述
Autosave coordinator that never overwrites the formal document URI.
在文件 EditorDiskDocumentStore.h 第 58 行定义.
构造及析构函数说明
◆ AutosaveService()
|
inline |
Create an autosave namespace.
- 参数
-
store Non-owning atomic store that outlives this service. projectId Stable project identity used in draft URIs.
Store.
在文件 EditorDiskDocumentStore.h 第 65 行定义.
成员函数说明
◆ draftUri()
| std::string eve::editor::AutosaveService::draftUri | ( | const DocumentId & | document | ) | const |
Return the stable draft URI for one document.
在文件 EditorDiskAssetCatalog.cpp 第 335 行定义.
引用了 eve::UuidIdAdapter< Tag >::value().
被这些函数引用 readDraft() , 以及 writeDraft().
◆ readDraft()
| Result< AutosaveDraft > eve::editor::AutosaveService::readDraft | ( | const DocumentId & | document | ) | const |
Read a draft and validate its schema.
在文件 EditorDiskAssetCatalog.cpp 第 366 行定义.
引用了 eve::editor::AutosaveDraft::document, draft, draftUri(), eve::UuidIdAdapter< Tag >::empty(), eve::Result< T >::failure(), member, eve::editor::IAtomicDocumentStore::read(), root , 以及 stored.
◆ shouldOfferRecovery()
| bool eve::editor::AutosaveService::shouldOfferRecovery | ( | const AutosaveDraft & | draft, |
| const DocumentSnapshot & | formal | ||
| ) | const |
True when a newer draft differs from the current formal disk base.
在文件 EditorDiskAssetCatalog.cpp 第 385 行定义.
引用了 eve::editor::DocumentSnapshot::diskContentHash, draft, eve::editor::DocumentSnapshot::id, eve::editor::DocumentSnapshot::revision , 以及 eve::editor::DocumentRevision::saved.
◆ writeDraft()
| Result< StoredDocument > eve::editor::AutosaveService::writeDraft | ( | const DocumentSnapshot & | snapshot, |
| const EditorValue & | content | ||
| ) |
Write one revisioned draft under autosave://project/document.draft.
在文件 EditorDiskAssetCatalog.cpp 第 343 行定义.
引用了 eve::Result< T >::code(), eve::editor::IAtomicDocumentStore::compareAndSwap(), draft, draftUri(), hash, eve::Result< T >::ok(), eve::editor::IAtomicDocumentStore::read(), revision, snapshot, uri , 以及 eve::Result< T >::value().
该类的文档由以下文件生成:
- src/modules/editor/EditorDiskDocumentStore.h
- src/modules/editor/EditorDiskAssetCatalog.cpp