USGS

Isis 3.0 Developer's Reference (API)

Home

Isis::Column Class Reference
[Utility]

Format ascii tables. More...

#include <Column.h>

List of all members.

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 (std::string name, int width, Column::Type type, Column::Align align=Right)
 Constructor with parameter.
void SetName (std::string 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.
std::string Name ()
 get the Column's name
unsigned int Width ()
 get the Column's width
Column::Type DataType ()
 Returns the type of data this column will contain.
Column::Align Alignment ()
 get the Column's alignment
unsigned int Precision ()
 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.

Author:
2007-05-01 Brendan George

Member Enumeration Documentation

Alignment of data in the Column.

Enumerator:
NoAlign 

no alignment

Right 

right alignment

Left 

left alignment

Decimal 

decimal alignment

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

Isis::Column::Column (  ) 

Constructor.

Sets the precision for decimal-aligned columns to 4

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

Constructor with parameter.

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

Member Function Documentation

Column::Align Isis::Column::Alignment (  )  [inline]

get the Column's alignment

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

Returns the type of data this column will contain.

Returns:
Column::Type The data type of this column
std::string Isis::Column::Name (  )  [inline]

get the Column's name

unsigned int Isis::Column::Precision (  )  [inline]

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

Parameters:
alignment The alignment of the text in the Column
void Isis::Column::SetName ( std::string  name  ) 

Sets the Column name, or header.

Parameters:
name The name of the 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.

Parameters:
precision The number of digits after the decimal point to be shown
void Isis::Column::SetType ( Column::Type  type  ) 

Sets the data type of the Column.

Parameters:
type The data type for the Column
void Isis::Column::SetWidth ( unsigned int  width  ) 

Sets the width of the Column, in text columns.

Parameters:
width The number of text columns the Column will hold
unsigned int Isis::Column::Width (  )  [inline]

get the Column's width


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