basso::InputCard Class Reference

Holds a input card. More...

#include <Input.h>

List of all members.

Public Member Functions

 InputCard (char keyword='$', char comment='#')
 InputCard (istream &in, char keyword='$', char comment='#')
void Read (istream &in)
int NumFields () const
const String & Keyword () const
const String & Field (int i) const
int iField (int i) const
Numeric nField (int i) const
void Print (ostream &out=StdOutput) const

Protected Member Functions

void AddRecord (const String &record)

Protected Attributes

char fComment
char fKeyword
Array< String > fCardFields


Detailed Description

Holds a input card.

This class can be used to read from input files that use a keyword leading symbol ('$' is the default). When the InputCard tries to read a record from a istream it will look for the keyword symbol then assume that this denotes a record and will read all the space or comma delineated fields until another keyword symbol is found. Also this class suports the use of a comment symbol ('#' is default). Any line which begins with the comment symbol is not processed.

Definition at line 35 of file Input.h.


Constructor & Destructor Documentation

basso::InputCard::InputCard ( char  keyword = '$',
char  comment = '#' 
) [inline]

empty constructor

Parameters:
keyword sets the keyword symbol ('$' is default)
comment sets the comment symbol ('#' is default)

Definition at line 42 of file Input.h.

References fComment, and fKeyword.

basso::InputCard::InputCard ( istream &  in,
char  keyword = '$',
char  comment = '#' 
) [inline]

constructor which reads card from istream

Parameters:
in input stream where the card is to be read from
keyword sets the keyword symbol ('$' is default)
comment sets the comment symbol ('#' is default)

Definition at line 49 of file Input.h.

References fComment, fKeyword, and Read().


Member Function Documentation

void basso::InputCard::Read ( istream &  in  ) 

reads the next keyword card. This will clear any existing record stored

Definition at line 117 of file Input.h.

References AddRecord(), fCardFields, fComment, fKeyword, and String.

Referenced by InputCard(), and basso::TextInput::ProcessFile().

int basso::InputCard::NumFields (  )  const [inline]

Returns the number of fields in the card, not including the keyword

Definition at line 56 of file Input.h.

References fCardFields.

const String& basso::InputCard::Keyword (  )  const [inline]

Returns the keyword as a String for the card

Definition at line 59 of file Input.h.

References fCardFields.

Referenced by basso::TextInput::ProcessFile().

const String& basso::InputCard::Field ( int  i  )  const [inline]

Returns the a particular field of the card as a String. This is safe since the fields are stored as Strings.

Parameters:
i field to be returned. This is zero offset and does not include the keyword

Definition at line 65 of file Input.h.

References fCardFields.

int basso::InputCard::iField ( int  i  )  const [inline]

Returns the a particular field of the card as an integer. This is not safe since the fields are stored as Strings and may not convert to integers.

Parameters:
i field to be returned. This is zero offset and does not include the keyword

Definition at line 71 of file Input.h.

References fCardFields.

Numeric basso::InputCard::nField ( int  i  )  const [inline]

Returns the a particular field of the card as a Numeric. This is not safe since the fields are stored as Strings and may not convert to Numericss.

Parameters:
i field to be returned. This is zero offset and does not include the keyword

Definition at line 77 of file Input.h.

References fCardFields.

void basso::InputCard::AddRecord ( const String &  record  )  [protected]

Takes a string of teh entire record and breaks it up with spaces and commas then adds teh fields to the record

Definition at line 103 of file Input.h.

References fCardFields.

Referenced by Read().


The documentation for this class was generated from the following file:
Generated on Sat Jan 19 09:03:59 2008 for Basso by  doxygen 1.5.2