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

Method deleteColumns

src/csvdatastorage.cpp:309–319  ·  view source on GitHub ↗

deleteColumns(long colFrom, long colTo) Deletes multiple columns. */

Source from the content-addressed store, hash-verified

307 Deletes multiple columns.
308 */
309void CsvDataStorage::deleteColumns(table_index_t colFrom, table_index_t colTo) {
310 table_index_t R = rows();
311 if( colFrom >= 0 && colFrom < columns() && colTo >= colFrom && colTo < columns() ) {
312 for( table_index_t r = 0; r < R; ++r ) {
313 std::vector<std::string> row = splitString(tableData.at(r));
314 row.erase( row.begin() + colFrom, row.begin() + colTo + 1);
315 tableData.at(r) = mergeString(row);
316 }
317 numColumns -= colTo - colFrom + 1;
318 }
319}
320
321
322/**

Callers 1

delColsMethod · 0.80

Calls 2

atMethod · 0.80
beginMethod · 0.45

Tested by

no test coverage detected