Isis Developer Reference
Isis::Column Class Reference

Format ascii tables. More...

#include <Column.h>

Collaboration diagram for Isis::Column:
Collaboration graph

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.
 

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. This was developed for cubediff's table output option, and is being utilized by the WriteTabular class (which currently resides in the cubediff folder).

Author
2007-05-01 Brendan George

Member Enumeration Documentation

◆ Align

Alignment of data in the Column.

Enumerator
NoAlign 

no alignment

Right 

right alignment

Left 

left alignment

Decimal 

decimal alignment

◆ 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.

Constructor & Destructor Documentation

◆ Column() [1/2]

Isis::Column::Column ( )

Constructor.

Sets the precision for decimal-aligned columns to 4

References NoAlign, and NoType.

◆ Column() [2/2]

Isis::Column::Column ( QString name,
int width,
Column::Type type,
Column::Align align = Right )

Constructor with parameter.

Parameters
nameThe name of the column, used as the header
widthThe width (in characters) to make the column
typeThe type of information the column is to represent
alignThe alignment, within the column, the data is to conform to

References NoAlign, NoType, SetAlignment(), SetName(), SetType(), and SetWidth().

Member Function Documentation

◆ Alignment()

Column::Align Isis::Column::Alignment ( ) const

Get the Column's alignment.

Returns
The column's alignment

◆ DataType()

Column::Type Isis::Column::DataType ( ) const

Returns the type of data this column will contain.

Returns
Column::Type The data type of this column

Referenced by SetPrecision().

◆ Name()

QString Isis::Column::Name ( ) const

Get the Column's name.

Returns
The column's name

◆ Precision()

unsigned int Isis::Column::Precision ( ) const

Get the Column's precision.

Returns
The column's presicion

◆ SetAlignment()

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

Parameters
alignmentThe alignment of the text in the Column

References _FILEINFO_, Decimal, Integer, Isis::IException::Programmer, and String.

Referenced by Column().

◆ SetName()

void Isis::Column::SetName ( QString name)

Sets the Column name, or header.

Parameters
nameThe name of the Column

References _FILEINFO_, and Isis::IException::User.

Referenced by Column().

◆ SetPrecision()

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.

Parameters
precisionThe number of digits after the decimal point to be shown

References _FILEINFO_, DataType(), Pixel, Real, and Isis::IException::User.

◆ SetType()

void Isis::Column::SetType ( Column::Type type)

Sets the data type of the Column.

Parameters
typeThe data type for the Column

References _FILEINFO_, Decimal, Integer, String, and Isis::IException::User.

Referenced by Column().

◆ SetWidth()

void Isis::Column::SetWidth ( unsigned int width)

Sets the width of the Column, in text columns.

Parameters
widthThe number of text columns the Column will hold

References _FILEINFO_, and Isis::IException::User.

Referenced by Column().

◆ Width()

unsigned int Isis::Column::Width ( ) const

Get the Column's width.

Returns
The column's width

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