![]() |
![]() An Information Portal to Biological Macromolecular Structures |
|
PDB Home |
Contact Us ![]() |
![]() |
Software Tools Home | Dictionary Home | PDBML Home |
![]() |
#include "ISTable.h"
int ISTable::AppendToColumn(ReVarCifArray<CifString> & theCol,
int colIndex);
int ISTable::AppendToColumn(ReVarCifArray<CifString> & theCol,
CifString & colName);
#include "ISTable.h"
ISTable * pTable = new ISTable();
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) {
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(ISTable::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.
This method is NOT safe after index creation.