Class litedb
Defined in File dbRoot.hpp
Class Documentation
-
class litedb
the Root database Object
Public Functions
-
template<typename DBType>
std::optional<std::vector<DBType>> operator<<(DBType &searchClue) the search query
- Template Parameters:
DBType – music or track data
- Parameters:
searchClue – the filters
- Returns:
std::optional<std::vector<DBType>> the result. check before use.
-
template<typename DBType>
bool operator<=(DBType &insertObject) the insert query
- Template Parameters:
DBType – music or track data
- Parameters:
insertObject – the data
- Returns:
true
- Returns:
false
-
template<typename DBType>
bool DeleteData(DBType &deleteObject) Deletes data from the database.
- Template Parameters:
DBType – The type of database object (music or track data).
- Parameters:
deleteObject – The object to delete.
- Returns:
true if the data was deleted successfully, false otherwise.
-
template<typename DBType>
bool EditData(DBType &searchObject, DBType &editObject) Edits data in the database.
- Template Parameters:
DBType – The type of database object (music or track data).
- Parameters:
searchObject – The object to search for.
editObject – The object with updated data.
- Returns:
true if the data was edited successfully, false otherwise.
-
bool KVGet(const SANITIZED &K, DONT_SANITIZE &V)
Retrieves a value from the key-value store.
- Parameters:
K – The key to retrieve.
V – The output parameter for the retrieved value.
- Returns:
true if the key was found and value retrieved, false otherwise.
-
bool KVPut(const SANITIZED &K, const DONT_SANITIZE &V)
Puts a key-value pair into the key-value store.
- Parameters:
K – The key to insert or update.
V – The value to associate with the key.
- Returns:
true if the operation was successful, false otherwise.
-
bool openDB(const fs::path &dbPath)
opens the Root Database and initialize.
- Parameters:
dbPath – path to Root Database
- Returns:
true
- Returns:
false
-
inline const fs::path getRoot()
Get path to Root database.
- Returns:
const std::string
-
litedb()
Constructs a new litedb object.
-
~litedb()
Destroys the litedb object.
-
template<typename DBType>