#include "SSTable.h"
int SSTable::RemoveColumn(int colIndex);
#include "SSTable.h"
...
SSTable * pTable = new SSTable();
ReVarCifArray<CifString> last_column;
CifString cs;
while (tokenizer.hasMoreTokens()) {
cs = (char *) tokenizer.GetNextToken();
last_column.Add(cs);
cs.Clear();
}
pTable->InsertColumn(last_column, "LastColumn",
pTable->GetNumColumns(), TRUE);
// process the last column
processTableColumn(*pTable, pTable->GetColumnIndex(
"LastColumn"));
// erase the last column, then re-add it
pTable->RemoveColumn(pTable->GetColumnIndex("LastColumn"));
pTable->InsertColumn("LastColumn", pTable->GetNumColumns(),
TRUE);
last_column.Clear(); // clean up array and restock with new data
while (tokenizer2.hasMoreTokens()) {
cs = (char *) tokenizer2.GetNextToken();
last_column.Add(cs);
cs.Clear();
}
// fill the column again and reprocess it, since we reinserted it.
pTable->FillColumn(last_column, pTable->GetColumnIndex(
"LastColumn"));
processTableColumn(*pTable, pTable->GetColumnIndex(
"LastColumn"));
RemoveColumn will remove the data from a column, and then remove the column itself.
| colIndex | The index of the column to be removed. |
A negative value indicates an error or warning.
| See also: | ClearColumn |
|---|---|
| DeleteColumn |