EditorDocuments class

An editor of files of its own (prefabs, widget assets), beside the scene: what it has unsaved, saving it, and the copies autosave keeps of it. EditorContext asks each one when it lists what is unsaved, saves all, autosaves, or recovers.

Derived classes

class PrefabEditorWindow
class WidgetDesigner

Constructors, destructors, conversion operators

~EditorDocuments() defaulted virtual

Public functions

auto Kind() const -> const char* pure virtual
What its documents are called in the autosave list ("prefab", "widget"). Never changes.
void ForEachUnsaved(const std::function<void(uint32_t id, const std::string&name, const std::string&path)>& visit) const pure virtual
Each open document with unsaved changes: its ID, name, and file.
auto Save(uint32_t id) -> bool pure virtual
Save open document id. False if it isn't open or couldn't be written.
auto TextOf(uint32_t id) const -> std::string pure virtual
Open document id as it stands, saved or not.
void OpenRecovered(const std::string& path, const std::string& text, EditorState& state) pure virtual
Open path with text in place of what the file has: recovered work, unsaved.