USGS

Isis 3.0 Application Source Code Reference

Home

Column Class Reference

#include <Column.h>

List of all members.


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

Definition at line 43 of file Column.h.

Public Types

 NoAlign = 0
 Right = 1
 Left = 2
 Decimal = 3
 NoType = 0
 Integer = 1
 Real = 2
 String = 3
 Pixel = 4
enum  Align { NoAlign = 0, Right = 1, Left = 2, Decimal = 3 }
enum  Type {
  NoType = 0, Integer = 1, Real = 2, String = 3,
  Pixel = 4
}

Public Member Functions

 Column ()
 Constructor.
 Column (std::string name, int width, Column::Type type, Align align=Column::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 ()
unsigned int Width ()
Column::Type DataType ()
 Returns the type of data this column will contain.
Column::Align Alignment ()
unsigned int Precision ()


Member Enumeration Documentation

enum Align

Enumerator:
NoAlign 
Right 
Left 
Decimal 

Definition at line 46 of file Column.h.

enum Type

Enumerator:
NoType 
Integer 
Real 
String 
Pixel 

Definition at line 50 of file Column.h.


Constructor & Destructor Documentation

Column (  ) 

Constructor.

Sets the precision for decimal-aligned columns to 4

Definition at line 34 of file Column.cpp.

Column ( std::string  name,
int  width,
Column::Type  type,
Column::Align  align = Column::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

Definition at line 50 of file Column.cpp.


Member Function Documentation

void SetName ( std::string  name  ) 

Sets the Column name, or header.

Parameters:
name The name of the Column

Definition at line 65 of file Column.cpp.

void SetWidth ( unsigned int  width  ) 

Sets the width of the Column, in text columns.

Parameters:
width The number of text columns the Column will hold

Definition at line 78 of file Column.cpp.

void SetType ( Column::Type  type  ) 

Sets the data type of the Column.

Parameters:
type The data type for the Column

Definition at line 92 of file Column.cpp.

void 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

Definition at line 111 of file Column.cpp.

void 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

Definition at line 129 of file Column.cpp.

std::string Name (  )  [inline]

Definition at line 63 of file Column.h.

unsigned int Width (  )  [inline]

Definition at line 64 of file Column.h.

Column::Type DataType (  ) 

Returns the type of data this column will contain.

Returns:
Column::Type The data type of this column

Definition at line 143 of file Column.cpp.

Column::Align Alignment (  )  [inline]

Definition at line 66 of file Column.h.

unsigned int Precision (  )  [inline]

Definition at line 67 of file Column.h.


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