getColumn(std::string row, long column) a#bcd#ef#hij 0123456789ab */
| 456 | 0123456789ab |
| 457 | */ |
| 458 | std::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 | |
| 467 | std::pair<table_index_t,table_index_t> CsvDataStorage::getColumnIndizes(std::string rowString, table_index_t column) { |
| 468 | bool colFound = false; |