USGS

Isis 3.0 Application Source Code Reference

Home

WriteTabular Class Reference

Format ascii tables. More...

#include <WriteTabular.h>

List of all members.

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 ()

Detailed Description

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.

Author:
2007-05-01 Brendan George

Definition at line 42 of file WriteTabular.h.


Constructor & Destructor Documentation

WriteTabular ( std::ostream &  strm,
std::vector< Column >  cols 
)

Constructor.

Parameters:
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.

Parameters:
filename The name of the file where the table will be written

Definition at line 40 of file WriteTabular.cpp.


Member Function Documentation

void SetColumns ( std::vector< Column >  cols  ) 

Sets the vector of Columns and writes out the first row of the file.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.


The documentation for this class was generated from the following files: