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

Method getColumn

src/csvdatastorage.cpp:458–465  ·  view source on GitHub ↗

getColumn(std::string row, long column) a#bcd#ef#hij 0123456789ab */

Source from the content-addressed store, hash-verified

456 0123456789ab
457 */
458std::string CsvDataStorage::getColumn(std::string rowString, table_index_t column) {
459 std::pair<table_index_t,table_index_t> fromTo = getColumnIndizes(rowString, column);
460 if( fromTo.second - fromTo.first - 1 <= (table_index_t) rowString.size() && fromTo.second > fromTo.first ) {
461 return rowString.substr(fromTo.first + 1, (fromTo.second - fromTo.first - 1));
462 } else {
463 return "";
464 }
465}
466
467std::pair<table_index_t,table_index_t> CsvDataStorage::getColumnIndizes(std::string rowString, table_index_t column) {
468 bool colFound = false;

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected