#include "SSTable.h"
int SSTable::InsertRow(int rowIndex);
int SSTable::InsertRow(ReVarCifArray<CifString> & theRow,
int rowIndex);
#include "SSTable.h"
#include "FileNavigator.h"
FileNavigator * pFileNavigator = NULL;
... // FileNavigator and tokenizer initialization
SSTable * pTable = new SSTable();
ReVarCifArray<CifString> some_row;
CifString cs;
int errCode = 0;
while (tokenizer.hasMoreTokens()) {
cs = (char *) tokenizer.GetNextToken();
some_row.Add(cs);
cs.Clear();
}
pTable->GetObject(objectIndex, pFileNavigator);
pTable->InsertRow(0); // Insert an empty 1st row
// Insert a filled up middle row
pTable->InsertRow(some_row, pTable->GetNumRows()/2);
...
InsertRow inserts a row into the table at a specified location. The second form of this method adds data into this row. The first form of the method requires calling another method, such as FillColumn, to add data to the table.
| rowIndex | The index where the row is to be inserted. Keep in mind that the first row is row 0. |
| theRow | An array of CifStrings to add as the data of the row. |
| rowIndex | The index where the row is to be inserted. Keep in mind that the first row is row 0. |
A negative value indicates an error or warning.
| See also: | AddRow |
|---|