MCPcopy Create free account
hub / github.com/Tablecruncher/tablecruncher / addCol

Method addCol

src/csvtable.cpp:174–193  ·  view source on GitHub ↗

* Adds an empty column after (or before) the given colNr */

Source from the content-addressed store, hash-verified

172 * Adds an empty column after (or before) the given colNr
173 */
174void CsvTable::addCol(table_index_t colNr, bool before) {
175 if( colNr >= storage.columns() )
176 colNr = storage.columns() - 1;
177 if( colNr < 0 )
178 colNr = 0;
179
180 storage.insertColumn(colNr, before);
181
182 // add column to headerRow
183 if( hasCustomHeaderRow ) {
184 if( before )
185 headerRow->insert(headerRow->begin()+colNr, "");
186 else
187 headerRow->insert(headerRow->begin()+colNr+1, "");
188 } else {
189 headerRow->clear();
190 headerRow->resize(storage.columns() + 1);
191 }
192 updateInternals();
193}
194
195
196

Callers 1

MyMenuCallbackMethod · 0.45

Calls 6

columnsMethod · 0.80
insertColumnMethod · 0.80
resizeMethod · 0.80
insertMethod · 0.45
beginMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected