RCSB PDB Protein Data Bank A Member of the wwPDB
An Information Portal to Biological Macromolecular Structures
PDB Home | Contact Us
next up previous contents
Next: AddElementToColumn Up: Column methods Previous: FillColumn

AppendToColumn

NAME AppendToColumn

PROTOTYPE

#include "ISTable.h"

int ISTable::AppendToColumn(ReVarCifArray<CifString> & theCol,
                            int colIndex);
int ISTable::AppendToColumn(ReVarCifArray<CifString> & theCol,
                            CifString & colName);

EXAMPLE

#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));
PURPOSE

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.

RECEIVES

AppendToColumn(ReVarCifArray<CifString> &, int)
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.

AppendToColumn(ReVarCifArray<CifString> &, CifString &)
theCol An array of CifStrings to append to the column.
colName The name of the column where the data is to be appended.

RETURN VALUE

A negative value indicates an error or warning.

REMARKS

This method is NOT safe after index creation.



Olivera Tosic
6/12/2002

 

© RCSB PDB