Isis Developer 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. | |
Column (QString name, int width, Column::Type type, Column::Align align=Right) | |
Constructor with parameter. | |
void | SetName (QString name) |
Sets the Column name, or header. | |
void | SetWidth (unsigned int width) |
Sets the width of the Column, in text columns. | |
void | SetType (Column::Type type) |
Sets the data type of the Column. | |
void | SetAlignment (Column::Align alignment) |
Sets the alignment of the Column. | |
void | SetPrecision (unsigned int precision) |
Sets the precision of the Column, for real number values. | |
QString | Name () const |
Get the Column's name. | |
unsigned int | Width () const |
Get the Column's width. | |
Column::Type | DataType () const |
Returns the type of data this column will contain. | |
Column::Align | Alignment () const |
Get the Column's alignment. | |
unsigned int | Precision () const |
Get the Column's precision. | |
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 |
Alignment of data in the Column.
Enumerator | |
---|---|
NoAlign | no alignment |
Right | right alignment |
Left | left alignment |
Decimal | decimal alignment |
enum Isis::Column::Type |
Type of data in the Column.
Enumerator | |
---|---|
NoType | |
Integer | No data type. |
Real | Integer data type. |
String | Real data type. |
Pixel | String data type. |
Isis::Column::Column | ( | ) |
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 |
References NoAlign, NoType, SetAlignment(), SetName(), SetType(), and SetWidth().
Column::Align Isis::Column::Alignment | ( | ) | const |
Get the Column's alignment.
Column::Type Isis::Column::DataType | ( | ) | const |
Returns the type of data this column will contain.
Referenced by SetPrecision().
QString Isis::Column::Name | ( | ) | const |
Get the Column's name.
unsigned int Isis::Column::Precision | ( | ) | const |
Get the Column's 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 |
References _FILEINFO_, Decimal, Integer, 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 |
References _FILEINFO_, 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 |
References _FILEINFO_, DataType(), 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 |
References _FILEINFO_, Decimal, Integer, 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 |
References _FILEINFO_, and Isis::IException::User.
Referenced by Column().
unsigned int Isis::Column::Width | ( | ) | const |
Get the Column's width.