载入中...
搜索中...
未找到
eve::editor::DiskAtomicDocumentStore类 参考final

Project-rooted JSON document store with sibling-temp atomic replacement. 更多...

#include <EditorDiskDocumentStore.h>

类 eve::editor::DiskAtomicDocumentStore 继承关系图:
eve::editor::IAtomicDocumentStore

Public 成员函数

 DiskAtomicDocumentStore (std::filesystem::path projectRoot)
 Create a store rooted at a project directory.
 
Result< StoredDocument > read (const std::string &resourceUri) const override
 Read and validate the latest atomic document envelope.
 
Result< StoredDocument > compareAndSwap (const std::string &resourceUri, Revision expectedRevision, const std::string &expectedContentHash, const EditorValue &content) override
 CAS and atomically replace one document envelope on disk.
 
std::filesystem::path resolve (const std::string &resourceUri) const
 Resolve a logical URI to a canonical project path, or an empty path when rejected.
 
void setBeforeReplaceHook (std::function< bool(const std::filesystem::path &)> hook)
 Test seam invoked after temp write and before atomic replacement.
 
- Public 成员函数 继承自 eve::editor::IAtomicDocumentStore
virtual ~IAtomicDocumentStore ()=default
 Releases IAtomicDocumentStore resources.
 

详细描述

Project-rooted JSON document store with sibling-temp atomic replacement.

content:// resolves under Content/ and autosave:// under Saved/Autosave/. Paths escaping the configured root are rejected. The store is thread-safe at the file-operation level only; callers serialize writes per resource URI.

在文件 EditorDiskDocumentStore.h 第 20 行定义.

构造及析构函数说明

◆ DiskAtomicDocumentStore()

eve::editor::DiskAtomicDocumentStore::DiskAtomicDocumentStore ( std::filesystem::path  projectRoot)
explicit

Create a store rooted at a project directory.

参数
projectRootProject root containing Content/.

在文件 EditorDiskDocumentStore.cpp 第 42 行定义.

成员函数说明

◆ compareAndSwap()

Result< StoredDocument > eve::editor::DiskAtomicDocumentStore::compareAndSwap ( const std::string &  resourceUri,
Revision  expectedRevision,
const std::string &  expectedContentHash,
const EditorValue &  content 
)
overridevirtual

CAS and atomically replace one document envelope on disk.

实现了 eve::editor::IAtomicDocumentStore.

在文件 EditorDiskDocumentStore.cpp 第 99 行定义.

引用了 eve::Result< T >::code(), current, eve::Result< T >::ok(), output, path, read(), resolve() , 以及 eve::Result< T >::value().

◆ read()

Result< StoredDocument > eve::editor::DiskAtomicDocumentStore::read ( const std::string &  resourceUri) const
overridevirtual

Read and validate the latest atomic document envelope.

实现了 eve::editor::IAtomicDocumentStore.

在文件 EditorDiskDocumentStore.cpp 第 72 行定义.

引用了 eve::editor::StoredDocument::content, input, member, eve::Result< T >::ok(), path, resolve(), revision, stored , 以及 eve::Result< T >::value().

被这些函数引用 compareAndSwap().

◆ resolve()

std::filesystem::path eve::editor::DiskAtomicDocumentStore::resolve ( const std::string &  resourceUri) const

Resolve a logical URI to a canonical project path, or an empty path when rejected.

在文件 EditorDiskDocumentStore.cpp 第 48 行定义.

引用了 relative.

被这些函数引用 compareAndSwap() , 以及 read().

◆ setBeforeReplaceHook()

void eve::editor::DiskAtomicDocumentStore::setBeforeReplaceHook ( std::function< bool(const std::filesystem::path &)>  hook)
inline

Test seam invoked after temp write and before atomic replacement.

在文件 EditorDiskDocumentStore.h 第 35 行定义.


该类的文档由以下文件生成: