#include <flexibletable.h>
Public Member Functions | |
FlexibleTable () | |
Default constructor; initializes size to zero. | |
itype | Rows () const |
Returns the number of rows in the table. | |
itype | Columns () const |
Returns the length of the longest row. | |
itype | ReadLine (const std::string line) |
Parses a string, and adds it to the table as a new row. | |
itype | ReadTable (std::istream &input, bool TerminateAtDoubleEOL=true) |
Parses a stream, adding one line at a time until EOF or double EOL. | |
void | TruncateLength (itype maxrows) |
Removes all rows beyond maxrows . | |
void | TruncateWidth (itype maxcols) |
Truncates each row to maxcols elements, if necessary. | |
void | Clear () |
Return the FlexibleTable to its virgin state. | |
void | CopyToData (matrixview< T > &storage, T NullValue=0) |
Initialize storage with this table's data. | |
std::ostream & | print (std::ostream &output, T NullValue=0) |
Print the table to output . |
FlexibleTable<T> is optimized for fault-tolerance and flexibility -- not for performance. Data is stored internally using STL structures, specifically a std::list of std::vector<T>. Thus, the FlexibleTable should not be used for data access. In fact, it provides no access to individual data elements. Instead, once the data is read in from a file using the ReadTable() method, it should be copied into a matrixview<T> object using CopyToData(). Alternatively, it can be output to a stream using the print() method. Before output, the FlexibleTable can be truncated using TruncateLength() and TruncateWidth(), or re-initialized using Clear().
Notes: