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: FillRow Up: Row methods Previous: AddRow

InsertRow

NAME InsertRow

PROTOTYPE

#include "ISTable.h"
int ISTable::InsertRow(int rowIndex);
int ISTable::InsertRow(ReVarCifArray<CifString> & theRow,
                       int rowIndex);

EXAMPLE

#include "ISTable.h"
#include "FileNavigator.h"

FileNavigator * pFileNavigator = NULL;

... // FileNavigator and tokenizer initialization

ISTable * pTable = new ISTable();
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);
...
PURPOSE

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.

RECEIVES

InsertRow(int)
rowIndex The index where the row is to be inserted. Keep in mind that the first row is row 0.

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

RETURN VALUE

A negative value indicates an error or warning.

REMARKS

This method is NOT safe after index creation.

See also: AddRow



Olivera Tosic
6/12/2002

 

© RCSB PDB