Parser Class Reference

Parser class. More...

#include <Parser.h>

List of all members.

Public Member Functions

 Parser (char *)
 Constructor.
 Parser ()
 ~Parser ()
 Destructor.
int setConfigFile (char *)
 Set (new) configuration file.
char * getConfigFile (void)
 Returns the currently used filename.
bool findValue (Glib::ustring &, Glib::ustring &)
 Find the value of a given property.

Private Member Functions

int initParser (void)
 Initialize the parser.

Private Attributes

char * m_cfgFile
 Name of configuration file.
Glib::ustring * m_cfgProperties
 List of properties in config file.
Glib::ustring * m_cfgValues
 List of according values.
unsigned int m_cfgSize
 Number of entries in both lists.


Detailed Description

Parser class.

This class is responsible to load and parse a configuration file. It stores all properties and values internally and returns a correspondig value of a given property


Constructor & Destructor Documentation

Parser::Parser ( char *  cfgFileName  ) 

Constructor.

Sets up the class

Parameters:
[in] cfgFileName Configuration file to parse

Parser::Parser (  ) 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parser::~Parser (  ) 

Destructor.

The destructor disposes the memory used by the class


Member Function Documentation

int Parser::initParser ( void   )  [private]

Initialize the parser.

Return values:
NO_ERROR Initialization successful

int Parser::setConfigFile ( char *  newFile  ) 

Set (new) configuration file.

This method accepts a filename for a (new) configuration file to parse. It discards all old data and opens and parses the new file

Parameters:
[in] newFile Filename of (new) configuration file
Return values:
NO_ERROR New configuration file successfully parsed
COULD_NOT_OPEN_FILE The given file could not be opened
NO_VALID_ENTRIES No valid entries were found in the given file

char * Parser::getConfigFile ( void   ) 

Returns the currently used filename.

Returns:
Filename of configuration file

bool Parser::findValue ( Glib::ustring &  prop,
Glib::ustring &  val 
)

Find the value of a given property.

This method returns the value of the given property or NULL if the given property could not be found in the list of all properties

Parameters:
[in] prop Property
[out] val Return value
Return values:
true Requested value found
false There is no such property


Member Data Documentation

char* Parser::m_cfgFile [private]

Name of configuration file.

Glib::ustring* Parser::m_cfgProperties [private]

List of properties in config file.

Glib::ustring* Parser::m_cfgValues [private]

List of according values.

unsigned int Parser::m_cfgSize [private]

Number of entries in both lists.


The documentation for this class was generated from the following files:
Generated on Sun Aug 19 10:06:09 2007 for cvsntLCP by  doxygen 1.5.3