#include <ISTable.h>
Inherits STable.
Inheritance diagram for ISTable:


Public Types | |
| enum | eTableDiff { eNONE = 0, eCASE_SENSE, eMORE_ROWS, eLESS_ROWS, eMORE_COLS, eLESS_COLS, eCOL_NAMES, eCELLS, eMISSING, eEXTRA } |
| enum | eSearchType { eEQUAL = 0, eLESS_THAN, eLESS_THAN_OR_EQUAL, eGREATER_THAN, eGREATER_THAN_OR_EQUAL } |
| enum | eSearchDir { eFORWARD = 0, eBACKWARD } |
Public Member Functions | |
| ISTable (const StringCompare::eCompareType colCaseSense=StringCompare::eCASE_SENSITIVE) | |
| ISTable (const string &name, const StringCompare::eCompareType colCaseSense=StringCompare::eCASE_SENSITIVE) | |
| ISTable (const ISTable &inTable) | |
| ~ISTable () | |
| ISTable & | operator= (const ISTable &inTable) |
| eTableDiff | operator== (ISTable &inTable) |
| void | AddColumn (const string &colName, const unsigned char opts=DEFAULT_OPTIONS, const vector< string > &col=vector< string >(0)) |
| void | InsertColumn (const string &colName, const string &afterColName, const unsigned char opts=DEFAULT_OPTIONS, const vector< string > &col=vector< string >(0)) |
| void | FillColumn (const string &colName, const vector< string > &col) |
| void | AppendToColumn (const string &colName, const vector< string > &col) |
| void | AppendToColumn (const string &colName, const string &cell) |
| void | ClearColumn (const string &colName) |
| void | DeleteColumn (const string &colName) |
| void | GetColumn (vector< string > &col, const string &colName) |
| void | GetColumn (vector< string > &col, const string &colName, const string &indexName) |
| void | GetColumn (vector< string > &subCol, const string &colName, const unsigned int fromRowIndex, unsigned int toRowIndex) |
| void | GetColumn (vector< string > &subCol, const string &colName, const vector< unsigned int > &rowIndex) |
| unsigned int | AddRow () |
| unsigned int | InsertRow (const unsigned int rowIndex, const vector< string > &row=vector< string >(0)) |
| void | FillRow (const unsigned int rowIndex, const vector< string > &row) |
| void | ClearRow (const unsigned int rowIndex) |
| void | DeleteRow (const unsigned int rowIndex) |
| void | DeleteRows (const vector< unsigned int > &rows) |
| unsigned int | GetNumRows () const |
| unsigned int | GetLastRowIndex () |
| void | GetRow (vector< string > &subRow, const unsigned int rowIndex, const string &fromColName=String::Empty, const string &toColName=String::Empty) |
| void | FindRedundantRows (const vector< string > &colNames, vector< pair< unsigned int, unsigned int > > &duplRows, const unsigned int keep, const eSearchDir searchDir=eFORWARD) |
| void | UpdateCell (const unsigned int rowIndex, const string &colName, const string &cell) |
| const string & | operator() (const unsigned int rowIndex, const string &colName) const |
| bool | IndexExists (const string &indexName) |
| void | CreateIndex (const string &indexName, const vector< string > &colNames, const unsigned int unique=0) |
| void | UpdateIndex (const string &indexName, const unsigned int rowIndex) |
| void | RebuildIndex (const string &indexName) |
| void | RebuildIndices () |
| void | DeleteIndex (const string &indexName) |
| unsigned int | GetNumIndices () |
| void | CreateKey (const vector< string > &colNames) |
| void | SetFlags (const string &colName, const unsigned char newOpts) |
| unsigned char | GetDataType (const string &colName) |
| unsigned int | FindFirst (const vector< string > &targets, const vector< string > &colNames=vector< string >(0), const string &indexName=String::Empty) |
| void | Search (vector< unsigned int > &res, const string &target, const string &colName) |
| void | Search (vector< unsigned int > &res, const vector< string > &targets, const vector< string > &colNames=vector< string >(0), const eSearchType searchType=eEQUAL, const string &indexName=String::Empty) |
| void | SetModified (const bool modified) |
| bool | GetModified () |
| void | SetFileNavigator (FileNavigator *fileNavigator) |
| int | WriteObject (FileNavigator *, int &size) |
| int | GetObject (Word index, FileNavigator *, int &size) |
| void | Read (unsigned int indexInFile) |
| int | Write () |
| void | Merge (ISTable &inTable, unsigned int typeOfMerge=0) |
| bool | PrintDiff (ISTable &inTable) |
| void | Print (const string &indexName) |
Static Public Member Functions | |
| static void | SetUnion (const vector< unsigned int > &a, const vector< unsigned int > &b, vector< unsigned int > &ret) |
| static void | SetIntersect (const vector< unsigned int > &a, const vector< unsigned int > &b, vector< unsigned int > &ret) |
Static Public Attributes | |
| static const unsigned char | CASE_SENSE = 0x00 |
| static const unsigned char | CASE_INSENSE = 0x01 |
| static const unsigned char | W_SPACE_SENSE = 0x00 |
| static const unsigned char | W_SPACE_INSENSE = 0x02 |
| static const unsigned char | DT_STRING = DT_STRING_VAL << 4 |
| static const unsigned char | DT_INTEGER = DT_INTEGER_VAL << 4 |
| static const unsigned char | DT_DOUBLE = DT_DOUBLE_VAL << 4 |
Protected Member Functions | |
| void | Init () |
| void | Clear () |
| unsigned int | IntRowIndex (const unsigned int rowIndex) const |
| void | ClearRowMap () |
| void | EnlargeRowMap (const unsigned int numRows) |
| void | ReduceRowMap (const unsigned int numRows) |
| void | MarkRowDeleted (const unsigned int rowIndex) |
| void | UnMarkRowDeleted (const unsigned int rowIndex) |
| bool | IsDelete (const unsigned int rowIndex) |
| StringCompare::eCompareType | GetCompareType (const vector< unsigned int > &colIndices) |
| string | CellValue (const unsigned int colIndex, const unsigned int rowIndex) |
| string | ConvertString (const string &value, const unsigned int colIndex) |
| string | MultiStringsValue (const vector< string > &values, const vector< unsigned int > &colIndices) |
| string | SubRowValue (const vector< unsigned int > &colIndices, const unsigned int rowIndex) |
| string | AggregateRow (const vector< unsigned int > &colIndices, const unsigned int rowIndex) |
| void | AppendToAndDelimit (string &to, const string &appending) |
| void | ValidateOptions (unsigned int colIndex) |
| string | CreateInternalIndexName (const unsigned int indexIndex) |
| void | UpdateIndex (const unsigned int indexIndex, const unsigned int rowIndex) |
| void | RebuildIndex (const unsigned int indexIndex) |
| void | ClearIndex (const unsigned int indexIndex) |
| void | DeleteIndex (const unsigned int indexIndex) |
| int | FindIndex (const string &indexName) |
| int | FindIndex (const vector< unsigned int > &colIndices) |
| void | UpdateIndices (const unsigned int rowIndex) |
| void | ClearIndices () |
| bool | IsColumnInIndex (const unsigned int indexIndex, const unsigned int colIndex) |
| int | FindKeyIndex () |
| void | UpdateColListOnColInsert (const unsigned int colIndex) |
| void | UpdateColListOnColDelete (const unsigned int colIndex) |
| void | UpdateColListOnCellUpdate (const unsigned int rowIndex, const unsigned int colIndex) |
| unsigned int | FindFirst (const vector< string > &targets, const vector< unsigned int > &colIndices, const unsigned int indexIndex) |
| void | Search (vector< unsigned int > &res, const vector< string > &targets, const vector< unsigned int > &colIndices, const unsigned int indexIndex, const eSearchType searchType=eEQUAL) |
| void | Search (vector< unsigned int > &res, const vector< string > &targets, const vector< string > &colNames, const unsigned int indexIndex, const eSearchType searchType=eEQUAL) |
| int | GetObjectV6 (Word index, FileNavigator *, int &size) |
| int | GetObjectV3 (Word index, FileNavigator *, int &size) |
| int | GetObjectV2 (Word index, FileNavigator *, int &size) |
| int | GetObjectV1 (Word index, FileNavigator *, int &size) |
| int | GetObjectV1_1 (Word index, FileNavigator *, int &size) |
| void | MakeTableRectangular () |
| void | Print (unsigned int indexIndex) |
| void | ConvertToInt (const string &a, string &ret) |
| void | ConvertDouble (const string &a, string &ret) |
| void | ConvertToLowerNoWhiteSpace (const string &a, string &ret) |
Protected Attributes | |
| bool | _modified |
| vector< unsigned int > | _rowMap |
| unsigned int | _numDels |
| vector< unsigned int > | _precision |
| vector< unsigned char > | _compare_opts |
| vector< string > | _indexNames |
| vector< vector< unsigned int > > | _listsOfColumns |
| vector< tIndex > | _indices |
| vector< unsigned int > | _unique |
Static Protected Attributes | |
| static const unsigned int | EXPONENT = 4 |
| static const unsigned int | MAX_PRECISION = DBL_DIG |
| static const unsigned int | MANTISSA = MAX_PRECISION + 2 |
| static const unsigned int | INT_LIMIT = 11 |
| static const unsigned char | DT_STRING_VAL = 1 |
| static const unsigned char | DT_INTEGER_VAL = 2 |
| static const unsigned char | DT_DOUBLE_VAL = 3 |
| static const unsigned char | DT_MASK = 15 << 4 |
| static const unsigned char | SC_MASK = 0x01 |
| static const unsigned char | WS_MASK = 0x02 |
| static const unsigned char | LAST_DT_VALUE = 3 |
| static const unsigned int | DEFAULT_PRECISION = MAX_PRECISION |
| static const unsigned char | DEFAULT_OPTIONS = DT_STRING_VAL << 4 |
Private Member Functions | |
| void | InsertColumn (const string &colName, const unsigned int colIndex, const unsigned char opts=DEFAULT_OPTIONS, const vector< string > &col=vector< string >(0)) |
| void | FillColumn (const vector< string > &col, const unsigned int colIndex) |
| int | AppendToColumn (const vector< string > &col, const unsigned int colIndex) |
| int | UpdateCell (const string &cell, const unsigned int colIndex, const unsigned int rowIndex) |
| int | GetCell (string &cell, const unsigned int colIndex, const unsigned int rowIndex) |
| int | SetFlags (const unsigned char newOpts, const unsigned int colIndex) |
| void | FindRedundantRows (const vector< unsigned int > &colIndices, vector< pair< unsigned int, unsigned int > > &duplRows, const unsigned int keep, const eSearchDir searchDir=eFORWARD) |
| bool | AreListsOfColumnsValid (const vector< unsigned int > &colIndices) |
| void | CreateIndex (const string &indexName, const vector< unsigned int > &colIndices, const unsigned int unique=0) |
| void | CreateKey (const vector< unsigned int > &colIndices) |
| unsigned int | FindFirst (const vector< string > &targets, const vector< unsigned int > &colIndices, const string &indexName=String::Empty) |
| void | Search (vector< unsigned int > &res, const string &target, const unsigned int colIndex) |
| void | Search (vector< unsigned int > &res, const vector< string > &targets, const vector< unsigned int > &colIndices, const eSearchType searchType=eEQUAL, const string &indexName=String::Empty) |
Private Attributes | |
| FileNavigator * | _fnav |
Static Private Attributes | |
| static const string | _version |
| enum ISTable::eTableDiff |
| enum ISTable::eSearchType |
| enum ISTable::eSearchDir |
| ISTable::ISTable | ( | const StringCompare::eCompareType | colCaseSense = StringCompare::eCASE_SENSITIVE |
) |
| ISTable::ISTable | ( | const string & | name, | |
| const StringCompare::eCompareType | colCaseSense = StringCompare::eCASE_SENSITIVE | |||
| ) |
| ISTable::ISTable | ( | const ISTable & | inTable | ) |
| ISTable::~ISTable | ( | ) |
| void ISTable::InsertColumn | ( | const string & | colName, | |
| const unsigned int | colIndex, | |||
| const unsigned char | opts = DEFAULT_OPTIONS, |
|||
| const vector< string > & | col = vector< string >(0) | |||
| ) | [private] |
| void ISTable::FillColumn | ( | const vector< string > & | col, | |
| const unsigned int | colIndex | |||
| ) | [private] |
Reimplemented from STable.
| int ISTable::AppendToColumn | ( | const vector< string > & | col, | |
| const unsigned int | colIndex | |||
| ) | [private] |
Reimplemented from STable.
| int ISTable::UpdateCell | ( | const string & | cell, | |
| const unsigned int | colIndex, | |||
| const unsigned int | rowIndex | |||
| ) | [private] |
Reimplemented from STable.
| int ISTable::GetCell | ( | string & | cell, | |
| const unsigned int | colIndex, | |||
| const unsigned int | rowIndex | |||
| ) | [private] |
Reimplemented from STable.
| int ISTable::SetFlags | ( | const unsigned char | newOpts, | |
| const unsigned int | colIndex | |||
| ) | [private] |
| void ISTable::FindRedundantRows | ( | const vector< unsigned int > & | colIndices, | |
| vector< pair< unsigned int, unsigned int > > & | duplRows, | |||
| const unsigned int | keep, | |||
| const eSearchDir | searchDir = eFORWARD | |||
| ) | [private] |
| bool ISTable::AreListsOfColumnsValid | ( | const vector< unsigned int > & | colIndices | ) | [private] |
| void ISTable::CreateIndex | ( | const string & | indexName, | |
| const vector< unsigned int > & | colIndices, | |||
| const unsigned int | unique = 0 | |||
| ) | [private] |
| void ISTable::CreateKey | ( | const vector< unsigned int > & | colIndices | ) | [private] |
| unsigned int ISTable::FindFirst | ( | const vector< string > & | targets, | |
| const vector< unsigned int > & | colIndices, | |||
| const string & | indexName = String::Empty | |||
| ) | [private] |
| void ISTable::Search | ( | vector< unsigned int > & | res, | |
| const string & | target, | |||
| const unsigned int | colIndex | |||
| ) | [private] |
| void ISTable::Search | ( | vector< unsigned int > & | res, | |
| const vector< string > & | targets, | |||
| const vector< unsigned int > & | colIndices, | |||
| const eSearchType | searchType = eEQUAL, |
|||
| const string & | indexName = String::Empty | |||
| ) | [private] |
| void ISTable::Init | ( | ) | [protected] |
| void ISTable::Clear | ( | ) | [protected, virtual] |
Deletes all the content from the table.
Table name is not affected by this method.
Reimplemented from STable.
| unsigned int ISTable::IntRowIndex | ( | const unsigned int | rowIndex | ) | const [inline, protected] |
| void ISTable::ClearRowMap | ( | ) | [inline, protected] |
| void ISTable::EnlargeRowMap | ( | const unsigned int | numRows | ) | [protected] |
| void ISTable::ReduceRowMap | ( | const unsigned int | numRows | ) | [protected] |
| void ISTable::MarkRowDeleted | ( | const unsigned int | rowIndex | ) | [protected] |
| void ISTable::UnMarkRowDeleted | ( | const unsigned int | rowIndex | ) | [protected] |
| bool ISTable::IsDelete | ( | const unsigned int | rowIndex | ) | [protected] |
| StringCompare::eCompareType ISTable::GetCompareType | ( | const vector< unsigned int > & | colIndices | ) | [protected] |
| string ISTable::CellValue | ( | const unsigned int | colIndex, | |
| const unsigned int | rowIndex | |||
| ) | [protected] |
| string ISTable::ConvertString | ( | const string & | value, | |
| const unsigned int | colIndex | |||
| ) | [protected] |
| string ISTable::MultiStringsValue | ( | const vector< string > & | values, | |
| const vector< unsigned int > & | colIndices | |||
| ) | [protected] |
| string ISTable::SubRowValue | ( | const vector< unsigned int > & | colIndices, | |
| const unsigned int | rowIndex | |||
| ) | [protected] |
| string ISTable::AggregateRow | ( | const vector< unsigned int > & | colIndices, | |
| const unsigned int | rowIndex | |||
| ) | [protected] |
| void ISTable::AppendToAndDelimit | ( | string & | to, | |
| const string & | appending | |||
| ) | [inline, protected] |
| void ISTable::ValidateOptions | ( | unsigned int | colIndex | ) | [protected] |
| string ISTable::CreateInternalIndexName | ( | const unsigned int | indexIndex | ) | [protected] |
| void ISTable::UpdateIndex | ( | const unsigned int | indexIndex, | |
| const unsigned int | rowIndex | |||
| ) | [protected] |
| void ISTable::RebuildIndex | ( | const unsigned int | indexIndex | ) | [protected] |
| void ISTable::ClearIndex | ( | const unsigned int | indexIndex | ) | [protected] |
| void ISTable::DeleteIndex | ( | const unsigned int | indexIndex | ) | [protected] |
| int ISTable::FindIndex | ( | const string & | indexName | ) | [protected] |
| int ISTable::FindIndex | ( | const vector< unsigned int > & | colIndices | ) | [protected] |
| void ISTable::UpdateIndices | ( | const unsigned int | rowIndex | ) | [protected] |
| void ISTable::ClearIndices | ( | ) | [protected] |
| bool ISTable::IsColumnInIndex | ( | const unsigned int | indexIndex, | |
| const unsigned int | colIndex | |||
| ) | [protected] |
| int ISTable::FindKeyIndex | ( | ) | [protected] |
| void ISTable::UpdateColListOnColInsert | ( | const unsigned int | colIndex | ) | [protected] |
| void ISTable::UpdateColListOnColDelete | ( | const unsigned int | colIndex | ) | [protected] |
| void ISTable::UpdateColListOnCellUpdate | ( | const unsigned int | rowIndex, | |
| const unsigned int | colIndex | |||
| ) | [protected] |
| unsigned int ISTable::FindFirst | ( | const vector< string > & | targets, | |
| const vector< unsigned int > & | colIndices, | |||
| const unsigned int | indexIndex | |||
| ) | [protected] |
| void ISTable::Search | ( | vector< unsigned int > & | res, | |
| const vector< string > & | targets, | |||
| const vector< unsigned int > & | colIndices, | |||
| const unsigned int | indexIndex, | |||
| const eSearchType | searchType = eEQUAL | |||
| ) | [protected] |
| void ISTable::Search | ( | vector< unsigned int > & | res, | |
| const vector< string > & | targets, | |||
| const vector< string > & | colNames, | |||
| const unsigned int | indexIndex, | |||
| const eSearchType | searchType = eEQUAL | |||
| ) | [protected] |
| int ISTable::GetObjectV6 | ( | Word | index, | |
| FileNavigator * | , | |||
| int & | size | |||
| ) | [protected] |
| int ISTable::GetObjectV3 | ( | Word | index, | |
| FileNavigator * | , | |||
| int & | size | |||
| ) | [protected] |
| int ISTable::GetObjectV2 | ( | Word | index, | |
| FileNavigator * | , | |||
| int & | size | |||
| ) | [protected] |
| int ISTable::GetObjectV1 | ( | Word | index, | |
| FileNavigator * | , | |||
| int & | size | |||
| ) | [protected] |
| int ISTable::GetObjectV1_1 | ( | Word | index, | |
| FileNavigator * | , | |||
| int & | size | |||
| ) | [protected] |
| void ISTable::MakeTableRectangular | ( | ) | [protected] |
| void ISTable::Print | ( | unsigned int | indexIndex | ) | [protected] |
| void ISTable::ConvertToInt | ( | const string & | a, | |
| string & | ret | |||
| ) | [protected] |
| void ISTable::ConvertDouble | ( | const string & | a, | |
| string & | ret | |||
| ) | [protected] |
| void ISTable::ConvertToLowerNoWhiteSpace | ( | const string & | a, | |
| string & | ret | |||
| ) | [protected] |
| ISTable::eTableDiff ISTable::operator== | ( | ISTable & | inTable | ) |
| void ISTable::AddColumn | ( | const string & | colName, | |
| const unsigned char | opts = DEFAULT_OPTIONS, |
|||
| const vector< string > & | col = vector< string >(0) | |||
| ) |
| void ISTable::InsertColumn | ( | const string & | colName, | |
| const string & | afterColName, | |||
| const unsigned char | opts = DEFAULT_OPTIONS, |
|||
| const vector< string > & | col = vector< string >(0) | |||
| ) |
| void ISTable::FillColumn | ( | const string & | colName, | |
| const vector< string > & | col | |||
| ) | [virtual] |
Fills a column with values.
| [in] | colName | - the name of the column to be filled |
| [in] | col | - contains the values which are to be used for filling. Filling starts at row index 0 and continues until size of col. |
Column with name colName must be present
The size of col must be less than or equal to the number of rows.
The column which comes, in order, before the column with name colName, must be non-empty. This is to prevent creation of non-rectangular tables.
| EmptyValueException | - if colName is empty | |
| NotFoundException | - if column with name colName does not exist | |
| out_of_range | - if size of col is greater than the number of rows | |
| out_of_range | - if column, which comes, in order, before the column with name colName, is empty. |
Reimplemented from STable.
| void ISTable::AppendToColumn | ( | const string & | colName, | |
| const vector< string > & | col | |||
| ) | [virtual] |
Appends cells to the specified column.
| [in] | colName | - the name of the column to which the cells are to be appended |
| [in] | col | - contains the values which are to be appended. |
Column with name colName must be present
The column, which comes, in order, before the column with name colName, must be non-empty. This is to prevent creation of non-rectangular tables.
Cells in other columns of the, newly appended rows, are set to empty values.
| EmptyValueException | - if colName is empty | |
| NotFoundException | - if column with name colName does not exist | |
| out_of_range | - if column, which comes, in order, before the column with name colName, is empty. |
Reimplemented from STable.
| void ISTable::AppendToColumn | ( | const string & | colName, | |
| const string & | cell | |||
| ) | [virtual] |
Appends one cell to the specified column.
| [in] | colName | - the name of the column to which the cell is to be appended |
| [in] | cell | - contains the value that is to be appended |
Column with name colName must be present
The column, which comes, in order, before the column with name colName, must be non-empty. This is to prevent creation of non-rectangular tables.
Cells in other columns of the, newly appended row, are set to empty values.
| EmptyValueException | - if colName is empty | |
| NotFoundException | - if column with name colName does not exist | |
| out_of_range | - if column, which comes, in order, before the column with name colName, is empty. |
Reimplemented from STable.
| void ISTable::ClearColumn | ( | const string & | colName | ) | [virtual] |
Sets all cells in the column to empty string.
| [in] | colName | - the name of the column |
Column with name colName must be present
| EmptyValueException | - if colName is empty | |
| NotFoundException | - if column with name colName does not exist |
Reimplemented from STable.
| void ISTable::DeleteColumn | ( | const string & | colName | ) | [virtual] |
Deletes a column from the table.
| [in] | colName | - the name of the column |
Column with name colName must be present
| EmptyValueException | - if colName is empty | |
| NotFoundException | - if column with name colName does not exist |
Reimplemented from STable.
| void ISTable::GetColumn | ( | vector< string > & | col, | |
| const string & | colName | |||
| ) | [virtual] |
Retrieves the values in the specified column.
| [out] | col | - retrieved column values |
| [in] | colName | - the name of the column which content is to be retrieved. |
Column with name colName must be present
| EmptyValueException | - if colName is empty | |
| NotFoundException | - if column with name colName does not exist |
Reimplemented from STable.
| void ISTable::GetColumn | ( | vector< string > & | col, | |
| const string & | colName, | |||
| const string & | indexName | |||
| ) |
| void ISTable::GetColumn | ( | vector< string > & | subCol, |
| const string & | colName, | ||