Isis 3.0 Application Source Code Reference |
Home |
Format ascii tables. More...
#include <WriteTabular.h>
Public Member Functions | |
WriteTabular (std::ostream &strm, std::vector< Column > cols) | |
Constructor. | |
WriteTabular (std::ostream &strm) | |
Constructor. | |
void | SetColumns (std::vector< Column > cols) |
Sets the vector of Columns and writes out the first row of the file. | |
void | Write () |
Writes a blank space in the next column in the current row. | |
void | Write (int item) |
Add an integer value to the next column in this row. | |
void | Write (std::string item) |
Writes a string to the next column in the current row. | |
void | Write (double item) |
Writes a floating-point value out to the next column in the current row. | |
void | SetDelimiter (std::string delim) |
Sets the string to be put between columns for this table. | |
int | Columns () |
int | Rows () |
Format ascii tables.
This class takes in a series of string vectors and writes them out to a file as a table. Formatting options are up to the user.
Definition at line 42 of file WriteTabular.h.
WriteTabular | ( | std::ostream & | strm, | |
std::vector< Column > | cols | |||
) |
Constructor.
filename | The name of the target file to contain the table, once formatted | |
cols | The Column headers, containing information about the Columns |
Definition at line 52 of file WriteTabular.cpp.
WriteTabular | ( | std::ostream & | strm | ) |
Constructor.
filename | The name of the file where the table will be written |
Definition at line 40 of file WriteTabular.cpp.
void SetColumns | ( | std::vector< Column > | cols | ) |
Sets the vector of Columns and writes out the first row of the file.
cols | A vector of Columns, setting the format of the table |
Definition at line 64 of file WriteTabular.cpp.
void Write | ( | ) |
Writes a blank space in the next column in the current row.
Definition at line 103 of file WriteTabular.cpp.
void Write | ( | int | item | ) |
Add an integer value to the next column in this row.
item | The integer value to put in this column. |
Definition at line 134 of file WriteTabular.cpp.
void Write | ( | std::string | item | ) |
Writes a string to the next column in the current row.
item | The string to write out |
Definition at line 185 of file WriteTabular.cpp.
void Write | ( | double | item | ) |
Writes a floating-point value out to the next column in the current row.
item | The value to be printed out |
Definition at line 230 of file WriteTabular.cpp.
void SetDelimiter | ( | std::string | delim | ) |
Sets the string to be put between columns for this table.
delim | The string to separate columns |
Definition at line 344 of file WriteTabular.cpp.
int Columns | ( | ) | [inline] |
Definition at line 55 of file WriteTabular.h.
int Rows | ( | ) | [inline] |
Definition at line 58 of file WriteTabular.h.