#include "SSTable.h"
int SSTable::AppendToColumn(ReVarCifArray<CifString> & theCol,
int colIndex);
int SSTable::AppendToColumn(ReVarCifArray<CifString> & theCol,
CifString & colName);
#include "SSTable.h"
SSTable * pTable = new SSTable();
ReVarCifArray<CifString> some_column;
CifString cs;
int errCode = 0;
while (tokenizer.hasMoreTokens()) {
cs = (char *) tokenizer.GetNextToken();
some_column.Add(cs);
cs.Clear();
}
cs = "LastColumn";
if ( (errCode = pTable->AddColumn(cs.Text(), 0)) >= 0) {
pTable->FillColumn(some_column, pTable->GetColumnIndex(
cs.Text()));
// Double the data!!
pTable->AppendToColumn(some_column, pTable->GetColumnIndex(
cs.Text()));
// Triple it!!!
pTable->AppendToColumn(some_column, cs);
} else
log_error(SSTable::GetErrorMessage(errCode));
AppendToColumn appends an array of CifStrings to the data of the specified column. This is ok even if the data goes beyond the number of rows, but it can lead to non-rectangular tables. The second form of this method is a convenience method to avoid explicit column index lookup.
| theCol | An array of CifStrings to append to the column. |
| colIndex | The index of the column where the data is to be appended. Keep in mind that the first column is column 0. |
| theCol | An array of CifStrings to append to the column. |
| colName | The name of the column where the data is to be appended. |
A negative value indicates an error or warning.
| None |