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

Method dump

src/csvdatastorage.cpp:527–552  ·  view source on GitHub ↗

dump(long numRows = 10, bool raw) Dump content of tableData, showing at most `numRows`. */

Source from the content-addressed store, hash-verified

525 Dump content of tableData, showing at most `numRows`.
526 */
527void 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

Callers 3

exportJSONMethod · 0.45
pasteMethod · 0.45

Calls 2

getFunction · 0.85
atMethod · 0.80

Tested by

no test coverage detected