26 #ifndef CARGO_SQLITE_JSON_CARGO_SQLITE_JSON_HPP
27 #define CARGO_SQLITE_JSON_CARGO_SQLITE_JSON_HPP
48 template <
class Cargo>
50 const std::string& json,
52 const std::string& kvVisitableName)
60 visitable.accept(fromJsonVisitor);
61 visitable.accept(fromKVStoreVisitor);
73 template <
class Cargo>
75 const std::string& jsonfile,
77 const std::string& kvVisitableName)
94 #endif // CARGO_SQLITE_JSON_CARGO_SQLITE_JSON_HPP
Definition: from-json-visitor.hpp:43
A guard struct for thread synchronization and transaction management.
Definition: kvstore.hpp:49
Definition: kvstore.hpp:43
Visitor for saving to KVStore.
Visitor for loading from KVStore that doesn't fail on missing values.
bool readFileContent(const std::string &path, std::string &result)
Definition: fs-utils.cpp:34
Default visitor for loading from KVStore.
Helper for compile-time checking against existance of template method 'accept'.
Definition: is-visitable.hpp:49
void loadFromKVStoreWithJson(const std::string &kvfile, const std::string &json, Cargo &visitable, const std::string &kvVisitableName)
Load the visitable from KVStore with defaults given in json.
Definition: cargo-sqlite-json.hpp:49
Base class for exceptions in libcargo.
Definition: exception.hpp:35
A variant of KVStoreVisitor that ignore non-existing fields.
Definition: from-kvstore-ignoring-visitor.hpp:38
void commit()
Definition: kvstore.cpp:126
void loadFromKVStoreWithJsonFile(const std::string &kvfile, const std::string &jsonfile, Cargo &visitable, const std::string &kvVisitableName)
Load the data from KVStore with defaults given in json file.
Definition: cargo-sqlite-json.hpp:74