Isis 3 Programmer Reference
|
Format ascii tables. More...
#include <Column.h>
Public Types | |
enum | Align { NoAlign = 0, Right = 1, Left = 2, Decimal = 3 } |
Alignment of data in the Column. More... | |
enum | Type { NoType = 0, Integer = 1, Real = 2, String = 3, Pixel = 4 } |
Type of data in the Column. More... | |
Public Member Functions | |
Column () | |
Constructor. More... | |
Column (QString name, int width, Column::Type type, Column::Align align=Right) | |
Constructor with parameter. More... | |
void | SetName (QString name) |
Sets the Column name, or header. More... | |
void | SetWidth (unsigned int width) |
Sets the width of the Column, in text columns. More... | |
void | SetType (Column::Type type) |
Sets the data type of the Column. More... | |
void | SetAlignment (Column::Align alignment) |
Sets the alignment of the Column. More... | |
void | SetPrecision (unsigned int precision) |
Sets the precision of the Column, for real number values. More... | |
QString | Name () const |
Get the Column's name. More... | |
unsigned int | Width () const |
Get the Column's width. More... | |
Column::Type | DataType () const |
Returns the type of data this column will contain. More... | |
Column::Align | Alignment () const |
Get the Column's alignment. More... | |
unsigned int | Precision () const |
Get the Column's precision. More... | |
Private Attributes | |
QString | p_name |
Name of the Column. More... | |
unsigned int | p_width |
Width of the Column. More... | |
Column::Type | p_type |
Type of the data in the Column. More... | |
Column::Align | p_align |
Alignment of the data in the Column. More... | |
unsigned int | p_precision |
Precision of the data in the Column. More... | |
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. This was developed for cubediff's table output option, and is being utilized by the WriteTabular class (which currently resides in the cubediff folder).
enum Isis::Column::Align |
enum Isis::Column::Type |
Isis::Column::Column | ( | ) |
Constructor.
Sets the precision for decimal-aligned columns to 4
Definition at line 20 of file Column.cpp.
References NoAlign, p_align, p_name, p_precision, p_type, and p_width.
Isis::Column::Column | ( | QString | name, |
int | width, | ||
Column::Type | type, | ||
Column::Align | align = Right |
||
) |
Constructor with parameter.
name | The name of the column, used as the header |
width | The width (in characters) to make the column |
type | The type of information the column is to represent |
align | The alignment, within the column, the data is to conform to |
Definition at line 36 of file Column.cpp.
References NoAlign, p_align, p_name, p_precision, p_type, p_width, SetAlignment(), SetName(), SetType(), and SetWidth().
Column::Align Isis::Column::Alignment | ( | ) | const |
Get the Column's alignment.
Definition at line 162 of file Column.cpp.
References p_align.
Column::Type Isis::Column::DataType | ( | ) | const |
Returns the type of data this column will contain.
Definition at line 152 of file Column.cpp.
References p_type.
Referenced by SetPrecision().
QString Isis::Column::Name | ( | ) | const |
Get the Column's name.
Definition at line 133 of file Column.cpp.
References p_name.
unsigned int Isis::Column::Precision | ( | ) | const |
Get the Column's precision.
Definition at line 172 of file Column.cpp.
References p_precision.
void Isis::Column::SetAlignment | ( | Column::Align | alignment | ) |
Sets the alignment of the Column.
The text in the Column will be aligned according to this parameter, which is Right, Left, or, possible only with real-number values, aligned by the decimal point
alignment | The alignment of the text in the Column |
Definition at line 101 of file Column.cpp.
References Decimal, Integer, p_align, p_type, Isis::IException::Programmer, and String.
Referenced by Column().
void Isis::Column::SetName | ( | QString | name | ) |
Sets the Column name, or header.
name | The name of the Column |
Definition at line 55 of file Column.cpp.
References p_name, p_width, and Isis::IException::User.
Referenced by Column().
void Isis::Column::SetPrecision | ( | unsigned int | precision | ) |
Sets the precision of the Column, for real number values.
This sets the number of digits after the decimal point, for decimal aligned values. If the Column's alignment is anything else, an error is thrown.
precision | The number of digits after the decimal point to be shown |
Definition at line 119 of file Column.cpp.
References DataType(), p_precision, Pixel, Real, and Isis::IException::User.
void Isis::Column::SetType | ( | Column::Type | type | ) |
void Isis::Column::SetWidth | ( | unsigned int | width | ) |
Sets the width of the Column, in text columns.
width | The number of text columns the Column will hold |
Definition at line 68 of file Column.cpp.
References p_name, p_width, and Isis::IException::User.
Referenced by Column().
unsigned int Isis::Column::Width | ( | ) | const |
Get the Column's width.
Definition at line 142 of file Column.cpp.
References p_width.
|
private |
Alignment of the data in the Column.
Definition at line 89 of file Column.h.
Referenced by Alignment(), Column(), SetAlignment(), and SetType().
|
private |
|
private |
Precision of the data in the Column.
Definition at line 92 of file Column.h.
Referenced by Column(), Precision(), and SetPrecision().
|
private |
Type of the data in the Column.
Definition at line 86 of file Column.h.
Referenced by Column(), DataType(), SetAlignment(), and SetType().
|
private |