dump(long numRows = 10, bool raw) Dump content of tableData, showing at most `numRows`. */
| 525 | Dump content of tableData, showing at most `numRows`. |
| 526 | */ |
| 527 | void CsvDataStorage::dump(table_index_t numRows, bool raw) { |
| 528 | table_index_t R = rows(); |
| 529 | table_index_t C = columns(); |
| 530 | std::cout << "================================================================================================" << std::endl; |
| 531 | std::cout << "ROWS: " << R << std::endl; |
| 532 | std::cout << "COLS: " << C << std::endl; |
| 533 | std::cout << "------------------------------------------------------------------------------------------------" << std::endl; |
| 534 | if( R > 0 && (C > 0 || raw) ) { |
| 535 | for( table_index_t r = 0; r < std::min(numRows, R); ++r ) { |
| 536 | std::cout << std::setw(3) << r << ": "; |
| 537 | if( raw ) { |
| 538 | std::cout << "|" << tableData.at(r) << "|" << std::endl; |
| 539 | } else { |
| 540 | for( table_index_t c = 0; c < C; ++c ) { |
| 541 | std::cout << "|" << std::setw(12) << get(r,c); |
| 542 | } |
| 543 | std::cout << "|" << std::endl; |
| 544 | } |
| 545 | } |
| 546 | if( R > numRows ) { |
| 547 | std::cout << "... " << (R - numRows) << " rows omitted ..." << std::endl; |
| 548 | } |
| 549 | } |
| 550 | std::cout << "================================================================================================" << std::endl; |
| 551 | std::cout << std::setw(0); |
| 552 | } |
| 553 | |
| 554 | |
| 555 |
no test coverage detected