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).
2007-06-18 Brendan George Fixed error message outputs and unitTest
2009-10-14 Eric Hyer Added documentation; Moved from base/apps/cubediff to base/objs;
2012-09-20 Steven Lambright - Improved unit test, fixed bug where uninitialized member variables were causing errors to be thrown sometimes. Fixes #1125.
2017-08-30 Summer Stapleton - Updated documentation. References #4807.
enum Isis::Column::Align |
enum Isis::Column::Type |
Isis::Column::Column | ( | ) |
Constructor.
Sets the precision for decimal-aligned columns to 4
Definition at line 35 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 51 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 177 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 167 of file Column.cpp.
References p_type.
Referenced by SetPrecision().
QString Isis::Column::Name | ( | ) | const |
Get the Column's name.
Definition at line 148 of file Column.cpp.
References p_name.
unsigned int Isis::Column::Precision | ( | ) | const |
Get the Column's precision.
Definition at line 187 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 116 of file Column.cpp.
References _FILEINFO_, 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 70 of file Column.cpp.
References _FILEINFO_, 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 134 of file Column.cpp.
References _FILEINFO_, DataType(), p_precision, Pixel, Real, and Isis::IException::User.
void Isis::Column::SetType | ( | Column::Type | type | ) |
Sets the data type of the Column.
type | The data type for the Column |
Definition at line 97 of file Column.cpp.
References _FILEINFO_, Decimal, Integer, p_align, p_type, String, and Isis::IException::User.
Referenced by Column().
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 83 of file Column.cpp.
References _FILEINFO_, 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 157 of file Column.cpp.
References p_width.
|
private |
Alignment of the data in the Column.
Definition at line 104 of file Column.h.
Referenced by Alignment(), Column(), SetAlignment(), and SetType().
|
private |
|
private |
Precision of the data in the Column.
Definition at line 107 of file Column.h.
Referenced by Column(), Precision(), and SetPrecision().
|
private |
Type of the data in the Column.
Definition at line 101 of file Column.h.
Referenced by Column(), DataType(), SetAlignment(), and SetType().
|
private |