Main Page | User's Guide | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members

Talos::ConfigStreams Class Reference

Streams associated with several configuration files. More...

#include <Files.hxx>

List of all members.

Public Member Functions

 ConfigStreams ()
 Default constructor.
 ConfigStreams (const vector< string > &files)
 Main constructor.
 ConfigStreams (string file0)
 Constructor.
 ConfigStreams (string file0, string file1)
 Constructor.
 ConfigStreams (string file0, string file1, string file2)
 Constructor.
 ~ConfigStreams ()
 Destructor.
vector< ConfigStream * > & GetStreams ()
 Returns the vector of streams.
vector< ConfigStream
* >::iterator 
GetCurrent ()
 Returns the current position in the vector of streams.
void AddFile (string file)
 Adds a file to the streams.
void NoSection ()
 Deselects the section.
void SetSection (string section)
 Sets the current section.
string GetSection () const
 Returns the current section.
bool Discard (string line) const
 Checks whether a line should be discarded.
ConfigStreamsSkipDiscarded ()
 Skips discarded lines.
ConfigStreamsSkipDelimiters ()
 Skips delimiters.
string RemoveDelimiters (const string &str) const
 Removes delimiters at both ends of a string.
ConfigStreamsSkip ()
 Skips discarded lines and delimiters.
bool IsEmpty ()
 Checks whether the streams are empty.
ConfigStreamsRewind ()
 Rewinds all streams and goes back to the first stream.
string GetFullLine ()
 Returns the next line.
bool GetFullLine (string &line)
 Returns the next line.
string PeekFullLine ()
 Returns the next line without extracting it from the stream.
string PeekFullLine (streampos &position)
 Returns the next line without extracting it from the stream.
bool PeekFullLine (string &line)
 Returns the next line without extracting it from the stream.
void SkipFullLines (int nb)
 Skips full lines.
string GetRawLine ()
 Returns the next valid line, without markups substitution.
string GetLine ()
 Returns the next valid line.
bool GetLine (string &line)
 Returns the next valid line.
string PeekLine ()
 Returns the next valid line without extracting it from the stream.
string PeekLine (streampos &position)
 Returns the next valid line without extracting it from the stream.
bool PeekLine (string &line)
 Returns the next valid line without extracting it from the stream.
void SkipLines (int nb)
 Skips valid lines.
bool Find (string element)
 Sets the position of the get pointer after a given element.
bool FindFromBeginning (string element)
 Sets the position of the get pointer after a given element.
string GetRawElement ()
 Returns the next valid element, without markups substitution.
string GetElement ()
 Returns the next valid element.
template<class T>
bool GetElement (T &element)
 Gets the next valid element.
string PeekElement ()
 Returns the next valid element without extracting it from the stream.
template<class T>
bool PeekElement (T &element)
 Gets the next valid element without extracting it from the stream.
void SkipElements (int nb)
 Skips valid elements.
double GetNumber ()
 Returns the next valid number.
template<class T>
bool GetNumber (T &number)
 Gets the next valid number.
double PeekNumber ()
 Returns the next valid number without extracting it from the stream.
template<class T>
bool PeekNumber (T &number)
 Gets the next valid number without extracting it from the stream.
void SkipNumbers (int nb)
 Skips numbers.
string GetValue (string name)
 Gets the value of a given variable.
string PeekValue (string name)
 Gets the value of a given variable without extracting from the stream.
template<class T>
bool GetValue (string name, T &value)
 Gets the value of a given variable.
template<class T>
bool PeekValue (string name, T &value)
 Gets the value of a given variable without extracting them from the stream.
bool GetValue (string name, string &value)
 Gets the value of a given variable.
bool PeekValue (string name, string &value)
 Gets the value of a given variable without extracting them from the stream.
bool GetValue (string name, bool &value)
 Gets the value of a given variable.
bool PeekValue (string name, bool &value)
 Gets the value of a given variable without extracting from the stream.

Protected Attributes

vector< ConfigStream * > streams_
vector< ConfigStream
* >::iterator 
current_
string section_
string searching_
 Field currently searched.


Detailed Description

Streams associated with several configuration files.


Constructor & Destructor Documentation

Talos::ConfigStreams::ConfigStreams  ) 
 

Default constructor.

Nothing is performed.

Talos::ConfigStreams::ConfigStreams const vector< string > &  files  ) 
 

Main constructor.

Opens a set of file.

Parameters:
files files to be opened.

Talos::ConfigStreams::ConfigStreams string  file  ) 
 

Constructor.

Opens a file.

Parameters:
file file to be opened.

Talos::ConfigStreams::ConfigStreams string  file0,
string  file1
 

Constructor.

Opens two files.

Parameters:
file0 first file to be opened.
file1 second file to be opened.

Talos::ConfigStreams::ConfigStreams string  file0,
string  file1,
string  file2
 

Constructor.

Opens three files.

Parameters:
file0 first file to be opened.
file1 second file to be opened.
file2 third file to be opened.


Member Function Documentation

void Talos::ConfigStreams::AddFile string  file  ) 
 

Adds a file to the streams.

Parameters:
file file to be added.

bool Talos::ConfigStreams::Discard string  line  )  const
 

Checks whether a line should be discarded.

Parameters:
line line to be checked.

bool Talos::ConfigStreams::Find string  element  ) 
 

Sets the position of the get pointer after a given element.

Sets the position of the get pointer exactly after a given element.

Parameters:
element the element to be found.
Returns:
true if the element was found, false otherwise.

bool Talos::ConfigStreams::FindFromBeginning string  element  ) 
 

Sets the position of the get pointer after a given element.

Sets the position of the get pointer exactly after a given element.

Parameters:
element the element to be found from the beginning of the stream.
Returns:
true if the element was found, false otherwise.

vector< ConfigStream * >::iterator Talos::ConfigStreams::GetCurrent  ) 
 

Returns the current position in the vector of streams.

Returns:
An iterator that points to the current element of the vector of streams.

template<class T>
bool Talos::ConfigStreams::GetElement T &  element  ) 
 

Gets the next valid element.

Gets the next valid element, i.e. the next element that is not in a line to be discarded.

Parameters:
element (output) the next valid element.

string Talos::ConfigStreams::GetElement  ) 
 

Returns the next valid element.

Returns the next valid element, i.e. the next element that is not in a line to be discarded.

Returns:
The next valid element.

bool Talos::ConfigStreams::GetFullLine string &  line  ) 
 

Returns the next line.

Parameters:
line (output) the next line.

string Talos::ConfigStreams::GetFullLine  ) 
 

Returns the next line.

Returns:
The next line.

bool Talos::ConfigStreams::GetLine string &  line  ) 
 

Returns the next valid line.

Returns the next valid line, i.e. the next line that is not a line to be discarded and from which comments have been extracted.

Parameters:
line (output) the next valid line.

string Talos::ConfigStreams::GetLine  ) 
 

Returns the next valid line.

Returns the next valid line, i.e. the next line that is not a line to be discarded and from which comments have been extracted.

Returns:
The next valid line.

template<class T>
bool Talos::ConfigStreams::GetNumber T &  number  ) 
 

Gets the next valid number.

Gets the next valid number, i.e. the next number that is not in a line to be discarded.

Parameters:
element (output) the next valid number.

double Talos::ConfigStreams::GetNumber  ) 
 

Returns the next valid number.

Returns the next valid number, i.e. the next number that is not in a line to be discarded.

Returns:
The next valid number.

string Talos::ConfigStreams::GetRawElement  ) 
 

Returns the next valid element, without markups substitution.

Returns the next valid element, i.e. the next element that is not in a line to be discarded. No markup substitution is performed.

Returns:
The next valid element.

string Talos::ConfigStreams::GetRawLine  ) 
 

Returns the next valid line, without markups substitution.

Returns the next valid line, i.e. the next line that is not a line to be discarded and from which comments have been extracted. No markup substitution is performed.

Returns:
The next valid line.

string Talos::ConfigStreams::GetSection  )  const
 

Returns the current section.

Returns:
The current section.

vector< ConfigStream * > & Talos::ConfigStreams::GetStreams  ) 
 

Returns the vector of streams.

Returns:
A reference to the vector of ConfigStream.

bool Talos::ConfigStreams::GetValue string  name,
bool &  value
 

Gets the value of a given variable.

Gets the value of a given variable, i.e. the next valid (not in a discarded line) number or element following the variable name.

Parameters:
name the name of the variable.
value boolean associated with the variable.

bool Talos::ConfigStreams::GetValue string  name,
string &  value
 

Gets the value of a given variable.

Gets the value of a given variable, i.e. the next valid (not in a discarded line) number or element following the variable name.

Parameters:
name the name of the variable.
value value associated with the variable.

template<class T>
bool Talos::ConfigStreams::GetValue string  name,
T &  value
 

Gets the value of a given variable.

Gets the (numerical) value of a given variable, i.e. the next valid (not in a discarded line) number or element following the variable name.

Parameters:
name the name of the variable.
value value associated with the variable.

string Talos::ConfigStreams::GetValue string  name  ) 
 

Gets the value of a given variable.

Gets the value of a given variable, i.e. the next valid (not in a discarded line) element following the variable name.

Parameters:
name the name of the variable.
Returns:
the value of the variable.

bool Talos::ConfigStreams::IsEmpty  ) 
 

Checks whether the streams are empty.

Checcks whether the streams have still valid elements to be read.

Returns:
'true' is the streams are empty, 'false' otherwise.

void Talos::ConfigStreams::NoSection  ) 
 

Deselects the section.

Deselects the section (this is equivalent to SetSection("")) and rewinds the stream.

template<class T>
bool Talos::ConfigStreams::PeekElement T &  element  ) 
 

Gets the next valid element without extracting it from the stream.

Gets the next valid element, i.e. the next element that is not in a line to be discarded.

Parameters:
element (output) the next valid element.

string Talos::ConfigStreams::PeekElement  ) 
 

Returns the next valid element without extracting it from the stream.

Returns the next valid element, i.e. the next element that is not in a line to be discarded.

Returns:
The next valid element.

bool Talos::ConfigStreams::PeekFullLine string &  line  ) 
 

Returns the next line without extracting it from the stream.

Parameters:
line (output) the next line.

string Talos::ConfigStreams::PeekFullLine streampos &  position  ) 
 

Returns the next line without extracting it from the stream.

Parameters:
position (output) the position of the line following the next line.
Returns:
The next line.

string Talos::ConfigStreams::PeekFullLine  ) 
 

Returns the next line without extracting it from the stream.

Returns:
The next line.

bool Talos::ConfigStreams::PeekLine string &  line  ) 
 

Returns the next valid line without extracting it from the stream.

Returns the next valid line, i.e. the next line that is not a line to be discarded and from which comments have been extracted. Nothing is extracted from the stream.

Parameters:
line (output) the next valid line.

string Talos::ConfigStreams::PeekLine streampos &  position  ) 
 

Returns the next valid line without extracting it from the stream.

Returns the next valid line, i.e. the next line that is not a line to be discarded and from which comments have been extracted. Nothing is extracted from the stream.

Parameters:
position (output) the position of the line following the next valid line.
Returns:
The valid line.

string Talos::ConfigStreams::PeekLine  ) 
 

Returns the next valid line without extracting it from the stream.

Returns the next valid line, i.e. the next line that is not a line to be discarded and from which comments have been extracted. Nothing is extracted from the stream.

Returns:
The next valid line.

template<class T>
bool Talos::ConfigStreams::PeekNumber T &  number  ) 
 

Gets the next valid number without extracting it from the stream.

Gets the next valid number, i.e. the next number that is not in a line to be discarded.

Parameters:
number (output) the next valid number.

double Talos::ConfigStreams::PeekNumber  ) 
 

Returns the next valid number without extracting it from the stream.

Returns the next valid number, i.e. the next number that is not in a line to be discarded.

Returns:
The next valid number.

bool Talos::ConfigStreams::PeekValue string  name,
bool &  value
 

Gets the value of a given variable without extracting from the stream.

Gets the value of a given variable, i.e. the next valid (not in a discarded line) number or element following the variable name. Nothing is extracted from the stream.

Parameters:
name the name of the variable.
value boolean associated with the variable.

bool Talos::ConfigStreams::PeekValue string  name,
string &  value
 

Gets the value of a given variable without extracting them from the stream.

Gets the value of a given variable, i.e. the next valid (not in a discarded line) number or element following the variable name. Nothing is extracted from the stream.

Parameters:
name the name of the variable.
value value associated with the variable.

template<class T>
bool Talos::ConfigStreams::PeekValue string  name,
T &  value
 

Gets the value of a given variable without extracting them from the stream.

Gets the (numerical) value of a given variable, i.e. the next valid (not in a discarded line) number or element following the variable name. Nothing is extracted from the stream.

Parameters:
name the name of the variable.
value value associated with the variable.

string Talos::ConfigStreams::PeekValue string  name  ) 
 

Gets the value of a given variable without extracting from the stream.

Gets the value of a given variable, i.e. the next valid (not in a discarded line) element following the variable name. Nothing is extracted from the stream.

Parameters:
name the name of the variable.
Returns:
the value associated with the variable.

string Talos::ConfigStreams::RemoveDelimiters const string &  str  )  const
 

Removes delimiters at both ends of a string.

Removes delimiters at the beginning and at the end of a string.

Parameters:
 

ConfigStreams & Talos::ConfigStreams::Rewind  ) 
 

Rewinds all streams and goes back to the first stream.

Goes back to the beginning of each stream, clears the control state and goes back to the first stream.

Returns:
A reference to 'this'.

void Talos::ConfigStreams::SetSection string  section  ) 
 

Sets the current section.

Parameters:
section current section.

ConfigStreams & Talos::ConfigStreams::Skip  ) 
 

Skips discarded lines and delimiters.

Extracts discarded lines and delimiters.

Returns:
A reference to this.

ConfigStreams & Talos::ConfigStreams::SkipDelimiters  ) 
 

Skips delimiters.

Extracts following delimiters from the string, until another character is found.

Returns:
A reference to this.

ConfigStreams & Talos::ConfigStreams::SkipDiscarded  ) 
 

Skips discarded lines.

Extracts discarded lines.

Returns:
A reference to 'this'.

void Talos::ConfigStreams::SkipElements int  nb  ) 
 

Skips valid elements.

Parameters:
nb number of valid elements to be skipped.

void Talos::ConfigStreams::SkipFullLines int  nb  ) 
 

Skips full lines.

Parameters:
nb number of lines to be skipped.

void Talos::ConfigStreams::SkipLines int  nb  ) 
 

Skips valid lines.

Parameters:
nb number of lines to be skipped.

void Talos::ConfigStreams::SkipNumbers int  nb  ) 
 

Skips numbers.

Parameters:
nb number of numbers to be skipped.


The documentation for this class was generated from the following files:
Generated on Wed Apr 25 11:18:06 2007 for Talos by  doxygen 1.4.2