Tables

public-header:"imp/text-tables.hpp"
implementation:"text-tables/*.hpp"
namespace:imp::
implementation namespace:
 imp::table_s::

Contents

Code to handle ReST like tables

Demonstration

void test()
{
  table_t tab = test_table( 3, 4 );
  cout << tab << "<<<- [Ends Here]\n";
  
  ofstream ofs( "./gensrc/index-test.tab" );
  
  ofs << tab;
  
  ofs.close();
}

Test Result: gcc34 Passed, msvc71 Passed

Output

+-----+------------+------------+------------+
|     |col 0       |col 1       |col 2       |
+=====+============+============+============+
|row 0|data( 0, 0 )|data( 0, 1 )|data( 0, 2 )|
+-----+------------+------------+------------+
|row 1|data( 1, 0 )|data( 1, 1 )|data( 1, 2 )|
+-----+------------+------------+------------+
|row 2|data( 2, 0 )|data( 2, 1 )|data( 2, 2 )|
+-----+------------+------------+------------+
|row 3|data( 3, 0 )|data( 3, 1 )|data( 3, 2 )|
+-----+------------+------------+------------+

<<<- [Ends Here]
Ok

Demonstration Output

The output of the above demonstration code included as ReST source:

  col 0 col 1 col 2
row 0 data( 0, 0 ) data( 0, 1 ) data( 0, 2 )
row 1 data( 1, 0 ) data( 1, 1 ) data( 1, 2 )
row 2 data( 2, 0 ) data( 2, 1 ) data( 2, 2 )
row 3 data( 3, 0 ) data( 3, 1 ) data( 3, 2 )

Table of Contents