Database.h
Go to the documentation of this file.
117 std::unique_ptr<ExportStream> createExportStream(const Format& format, const String& path = nullptr,
137 bool exportToFile(const Format& format, const String& filename, const ExportOptions& options = {});
Class to manage a NUL-terminated C-style string When storing persistent strings in RAM the regular St...
Definition: CString.h:27
Used by code generator to create specific template for Database
Definition: Database.h:244
DatabaseTemplate(const String &path)
Definition: Database.h:246
Definition: Database.h:30
StoreUpdateRef lockStore(StoreRef &store)
Lock a store for writing (called by Object)
void checkUpdateQueue(Store &store)
Called by Store on completion of update so any queued updates can be started.
virtual bool handleFormatError(FormatError err, const Object &object, const String &arg)
Called during import.
virtual ~Database()
StoreRef openStore(unsigned index)
Open a store instance, load it and return a shared pointer.
Status importFromStream(const Format &format, Stream &source)
De-serialize the entire database from a stream.
Definition: Database.h:144
StoreUpdateRef openStoreForUpdate(unsigned index)
std::unique_ptr< ImportStream > createImportStream(const Format &format)
Create a write-only stream for de-serializing the database.
Definition: Database.h:160
Status importFromFile(const Format &format, const String &filename)
De-serialize the entire database from a file.
void queueUpdate(Store &store, Object::UpdateCallback &&callback)
Queue an asynchronous update.
bool exportToFile(const Format &format, const String &filename, const ExportOptions &options={})
Serialize the database to a single file.
void checkStoreRef(const StoreRef &ref)
Called from StoreRef destructor so database can manage caches.
Database(const DatabaseInfo &typeinfo, const String &path)
Database instance.
Definition: Database.h:36
std::unique_ptr< ExportStream > createExportStream(const Format &format, const String &path=nullptr, const ExportOptions &options={})
Create a read-only stream for serializing the database.
virtual const Format & getFormat(const Store &store) const
Get the storage format to use for a store.
size_t exportToStream(const Format &format, Print &output, const ExportOptions &options={})
Serialize the database to a stream.
Definition: Database.h:126
size_t exportToStream(const Object &object, Print &output, const ExportOptions &options) const override
Print object.
std::unique_ptr< ImportStream > createImportStream(Database &db) const override
Create a stream for de-serialising (writing) into the database Used when updating a database from a r...
Status importFromStream(Object &object, Stream &source) const override
De-serialise content from stream into object (RAM)
An object can contain other objects, properties and arrays.
Definition: Libraries/ConfigDB/src/include/ConfigDB/Object.h:37
Definition: StoreRef.h:29
Definition: StoreRef.h:46
Manages access to an object store, typically one file.
Definition: ConfigDB/src/include/ConfigDB/Store.h:43
Format format
Definition: Array.h:26
Definition: Formatter.h:20
Definition: DatabaseInfo.h:26
Options for streaming object output.
Definition: Libraries/ConfigDB/src/include/ConfigDB/Format.h:41
Definition: Status.h:54
1.9.1