11 typedef std::map<std::string,
12 std::shared_ptr<std::vector<std::shared_ptr<SimpleDatabaseRowObject>>>>
26 DLLEXPORT virtual void GetRow(std::vector<std::string> &row,
const std::string &table,
27 int row_index,
const std::vector<std::string> &columns);
32 const std::string &valuekeyname,
const VariableBlock &wantedvalue,
33 const std::string &wantedvaluekey);
37 std::shared_ptr<SimpleDatabaseRowObject> valuenamesandvalues);
49 bool humanreadable =
false);
54 SimpleDatabaseObject::iterator
_EnsureTable(
const std::string &name);
Allows the inherited object to be locked.
Non-template class for working with all types of DataBlocks.
virtual DLLEXPORT size_t GetNumRows(const std::string &table)
DLLEXPORT bool RemoveValue(const std::string &database, int row)
DLLEXPORT bool LoadFromFile(const std::string &file)
virtual DLLEXPORT void GetRow(std::vector< std::string > &row, const std::string &table, int row_index, const std::vector< std::string > &columns)
DLLEXPORT SimpleDatabase(const std::string &databasename)
Creates a new database. Should be used as pointer.
DLLEXPORT std::shared_ptr< VariableBlock > GetValueOnRow(const std::string &table, const std::string &valuekeyname, const VariableBlock &wantedvalue, const std::string &wantedvaluekey)
virtual DLLEXPORT ~SimpleDatabase()
std::map< std::string, std::shared_ptr< VariableBlock > > SimpleDatabaseRowObject
DLLEXPORT bool WriteTableToJson(const std::string &tablename, std::string &receiver, bool humanreadable=false)
Serializes a single table to JSON.
SimpleDatabaseObject Database
The main database structure.
DLLEXPORT bool AddValue(const std::string &database, std::shared_ptr< SimpleDatabaseRowObject > valuenamesandvalues)
SimpleDatabaseObject::iterator _EnsureTable(const std::string &name)
Makes sure that a table is fine.
DLLEXPORT void SaveToFile(const std::string &file)
The access mask controls which registered functions and classes a script sees.
std::map< std::string, std::shared_ptr< std::vector< std::shared_ptr< SimpleDatabaseRowObject > > > > SimpleDatabaseObject