#include <Files.hxx>
Inheritance diagram for Talos::ConfigStream:
Public Member Functions | |
ConfigStream () | |
Default constructor. | |
ConfigStream (string file_name, string comments="#%", string delimiters=" \t:=|\n,;\r\x0D\x0A", string markup_tags="<>$") | |
Main constructor. | |
void | NoSection () |
Deselects the section. | |
void | SetSection (string section) |
Sets the current section. | |
string | GetSection () const |
Returns the current section. | |
void | SetMarkupTags (string markup_tags) |
Sets the markup tags. | |
string | GetMarkupTags () const |
Returns the markup tags. | |
bool | IsEmpty () |
Checks whether the stream or the current section is empty. | |
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. | |
virtual string | GetElement () |
Returns the next valid element. | |
virtual string | GetLine () |
Returns the next valid line. | |
virtual bool | GetLine (string &line) |
Returns the next valid line. | |
Protected Attributes | |
string | markup_tags_ |
string | section_ |
Friends | |
class | ConfigStreams |
Talos::ConfigStream::ConfigStream | ( | ) |
Default constructor.
Nothing is performed.
Talos::ConfigStream::ConfigStream | ( | string | file_name, | |
string | comments = "#%" , |
|||
string | delimiters = " \t:=|\n,;\r\x0D\x0A" , |
|||
string | markup_tags = "<>$" | |||
) |
Main constructor.
Opens a file.
file_name | file to be opened. |
void Talos::ConfigStream::NoSection | ( | ) |
Deselects the section.
Deselects the section (this is equivalent to SetSection("")).
void Talos::ConfigStream::SetSection | ( | string | section | ) |
Sets the current section.
section | current section. |
string Talos::ConfigStream::GetSection | ( | ) | const |
Returns the current section.
void Talos::ConfigStream::SetMarkupTags | ( | string | markup_tags | ) |
Sets the markup tags.
markup_tags | the new markup tags. |
string Talos::ConfigStream::GetMarkupTags | ( | ) | const |
Returns the markup tags.
bool Talos::ConfigStream::IsEmpty | ( | ) |
Checks whether the stream or the current section is empty.
If no section has been selected, this method checks whether the stream has still valid elements to be read. If the stream is bound to a given section, this method checks whether there remains at least one element in the section.
Reimplemented from Talos::ExtStream.
bool Talos::ConfigStream::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.
element | the element to be found. |
Reimplemented from Talos::ExtStream.
bool Talos::ConfigStream::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.
element | the element to be found from the beginning of the stream. |
Reimplemented from Talos::ExtStream.
string Talos::ConfigStream::GetElement | ( | ) | [virtual] |
Returns the next valid element.
Returns the next valid element, i.e. the next element that is not in a line to be discarded.
Reimplemented from Talos::ExtStream.
string Talos::ConfigStream::GetLine | ( | ) | [virtual] |
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.
Reimplemented from Talos::ExtStream.
bool Talos::ConfigStream::GetLine | ( | string & | line | ) | [virtual] |
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.
line | (output) the next valid line. |
Reimplemented from Talos::ExtStream.