#include <mrpt/utils/CSimpleDatabase.h>
Public Member Functions | ||||
CSimpleDatabaseTable () | ||||
Default constructor. | ||||
virtual | ~CSimpleDatabaseTable () | |||
Destructor. | ||||
size_t | fieldsCount () const | |||
Get the count of fields. | ||||
size_t | appendRecord () | |||
Append a new and empty record at the end of the table, and return the index of the newly added record. | ||||
void | addField (const char *fieldName) | |||
Add a new field to the table. | ||||
void | addField (const std::string &fieldName) | |||
Add a new field to the table. | ||||
std::string | getFieldName (size_t fieldIndex) const | |||
Get the name of a field by its index
| ||||
size_t | fieldIndex (const char *fieldName) const | |||
Get the index for a given field name
| ||||
size_t | fieldIndex (const std::string &fieldName) const | |||
Get the index for a given field name
| ||||
size_t | getRecordCount () const | |||
Get the records count in the table. | ||||
std::string | get (size_t recordIndex, std::string field) const | |||
Returns the cell content of the record indicates by its index, and the field indicated in "field". | ||||
std::string | get (size_t recordIndex, size_t fieldIndex) const | |||
Returns the cell content of the record indicates by its index, and the field indicated by its index. | ||||
void | set (size_t recordIndex, std::string field, std::string value) | |||
Sets the cell content of the record indicates by its index, and the field indicated in "field". | ||||
void | set (size_t recordIndex, size_t fieldIndex, std::string value) | |||
Sets the cell content of the record indicates by its index, and the field indicated by its index. | ||||
int | query (std::string field, std::string value) const | |||
Executes a query in the table, returning the record index which a given field has a given value, case insensitive, or -1 if not found. | ||||
void | deleteRecord (size_t recordIndex) | |||
Delete the record at the given index. | ||||
Private Attributes | ||||
vector_string | field_names | |||
Field names. | ||||
std::vector< vector_string > | data | |||
Data for each cell. |
Definition at line 47 of file CSimpleDatabase.h.
mrpt::utils::CSimpleDatabaseTable::CSimpleDatabaseTable | ( | ) |
Default constructor.
virtual mrpt::utils::CSimpleDatabaseTable::~CSimpleDatabaseTable | ( | ) | [virtual] |
Destructor.
void mrpt::utils::CSimpleDatabaseTable::addField | ( | const std::string & | fieldName | ) | [inline] |
Add a new field to the table.
The table is cleared in this operation.
Definition at line 73 of file CSimpleDatabase.h.
void mrpt::utils::CSimpleDatabaseTable::addField | ( | const char * | fieldName | ) |
Add a new field to the table.
The table is cleared in this operation.
size_t mrpt::utils::CSimpleDatabaseTable::appendRecord | ( | ) |
Append a new and empty record at the end of the table, and return the index of the newly added record.
void mrpt::utils::CSimpleDatabaseTable::deleteRecord | ( | size_t | recordIndex | ) |
size_t mrpt::utils::CSimpleDatabaseTable::fieldIndex | ( | const std::string & | fieldName | ) | const [inline] |
Get the index for a given field name
std::exception | On field not found. |
Definition at line 90 of file CSimpleDatabase.h.
size_t mrpt::utils::CSimpleDatabaseTable::fieldIndex | ( | const char * | fieldName | ) | const |
Get the index for a given field name
std::exception | On field not found. |
size_t mrpt::utils::CSimpleDatabaseTable::fieldsCount | ( | ) | const |
Get the count of fields.
std::string mrpt::utils::CSimpleDatabaseTable::get | ( | size_t | recordIndex, | |
size_t | fieldIndex | |||
) | const |
Returns the cell content of the record indicates by its index, and the field indicated by its index.
std::exception | On field or record not found |
std::string mrpt::utils::CSimpleDatabaseTable::get | ( | size_t | recordIndex, | |
std::string | field | |||
) | const |
Returns the cell content of the record indicates by its index, and the field indicated in "field".
std::exception | On field or record not found |
std::string mrpt::utils::CSimpleDatabaseTable::getFieldName | ( | size_t | fieldIndex | ) | const |
Get the name of a field by its index
std::exception | On index out of bounds. |
size_t mrpt::utils::CSimpleDatabaseTable::getRecordCount | ( | ) | const |
Get the records count in the table.
int mrpt::utils::CSimpleDatabaseTable::query | ( | std::string | field, | |
std::string | value | |||
) | const |
Executes a query in the table, returning the record index which a given field has a given value, case insensitive, or -1 if not found.
void mrpt::utils::CSimpleDatabaseTable::set | ( | size_t | recordIndex, | |
size_t | fieldIndex, | |||
std::string | value | |||
) |
Sets the cell content of the record indicates by its index, and the field indicated by its index.
std::exception | On field or record not found |
void mrpt::utils::CSimpleDatabaseTable::set | ( | size_t | recordIndex, | |
std::string | field, | |||
std::string | value | |||
) |
Sets the cell content of the record indicates by its index, and the field indicated in "field".
std::exception | On field or record not found |
std::vector<vector_string> mrpt::utils::CSimpleDatabaseTable::data [private] |
Page generated by Doxygen 1.5.9 for MRPT 0.7.1 SVN: at Mon Aug 17 22:20:53 EDT 2009 |