28 #ifndef CSimpleDatabase_H
29 #define CSimpleDatabase_H
54 CSimpleDatabaseTable( );
58 virtual ~CSimpleDatabaseTable();
62 size_t fieldsCount() const;
67 size_t appendRecord();
70 void addField(const
char *fieldName);
73 void addField(const std::
string &fieldName) {
74 addField(fieldName.c_str());
80 std::string getFieldName(
size_t fieldIndex)
const;
85 size_t fieldIndex(
const char *fieldName)
const;
91 return fieldIndex(fieldName.c_str());
96 size_t getRecordCount()
const;
101 std::string
get(
size_t recordIndex, std::string field)
const;
106 std::string
get(
size_t recordIndex,
size_t fieldIndex)
const;
111 void set(
size_t recordIndex, std::string field, std::string value);
116 void set(
size_t recordIndex,
size_t fieldIndex, std::string value);
120 int query(std::string field, std::string value)
const;
123 void deleteRecord(
size_t recordIndex);
127 std::vector<vector_string>
data;
152 virtual ~CSimpleDatabase( );
170 void dropTable(const std::
string &tableName);
176 const std::
string &tableName,
177 const std::
string &newTableName );
186 size_t tablesCount() const;
191 std::
string tablesName(
size_t tableIndex) const;
197 bool saveAsXML( const std::
string &fileName ) const;
203 bool loadFromXML( const std::
string &fileName );