conf::ConfQ Class Reference

Class for easy use of the configuration parser. More...

#include <quick.h>

Inheritance diagram for conf::ConfQ:

conf::DirectivesQ::DConfQ List of all members.

Public Member Functions

 ConfQ (ConfLogger &logger)
 Constructor.
 ConfQ (ConfQ const &cq)
 Copy constructor.
virtual ConfQoperator= (ConfQ const &right)
 Assignment operator.
virtual ~ConfQ ()
 Destructor.
virtual bool setup ()
 Adds directives.
bool parse (ConfGlobalQ &cgq, bool reload, std::istream &is, std::string const &context)
 Parses a stream.
bool parse_file (ConfGlobalQ &cgq, bool reload, std::string const &filename)
 Parses a file.
bool parse_string (ConfGlobalQ &cgq, bool reload, std::string const &str, std::string const &context)
 Parses a string.
Confconf ()
 Returns the configuration parser object.
bool is_setup () const
 Has the setup() function been called?

Protected Attributes

Conf m_conf
 Add directives to this object.

Detailed Description

ConfQ is a class that encapsulates all configuration parser stuff, allowing you to focus on the essential, i.e. adding directives.

The setup() function must be called prior to using the parse(), parse_file() and parse_string() functions.


Constructor & Destructor Documentation

conf::ConfQ::ConfQ ConfLogger logger  )  [inline]
 

Constructs the ConfQ object.

Parameters:
[in] logger Logger used by the parser to report errors and debug messages (see Conf::Conf()).


Member Function Documentation

bool conf::ConfQ::parse ConfGlobalQ cgq,
bool  reload,
std::istream &  is,
std::string const &  context
 

Parses a stream. This function calls the Conf::begin(), Conf::parse() and Conf::end() functions for the parser.

Parameters:
[in] cgq Sets the ConfGlobalQ object used to initialize the parser.
[in] reload Specifies whether the configuration is being reloaded (true) or not (false).
[in] is The input stream to parse.
[in] context An arbitrary string giving indication on the parsing location.
Returns:
true if everything succeeded, false otherwise (appropriate error should have been logged by the parser in the latter case).
See also:
Conf::begin(), Conf::parse(), Conf::end()

bool conf::ConfQ::parse_file ConfGlobalQ cgq,
bool  reload,
std::string const &  filename
 

Parses a file. This function calls the Conf::begin(), Conf::parse_file() and Conf::end() functions for the parser.

Parameters:
[in] cgq Sets the ConfGlobalQ object used to initialize the parser.
[in] reload Specifies whether the configuration is being reloaded (true) or not (false).
[in] filename The file to parse.
Returns:
true if everything succeeded, false otherwise (appropriate error should have been logged by the parser in the latter case).
See also:
Conf::begin(), Conf::parse_file(), Conf::end()

bool conf::ConfQ::parse_string ConfGlobalQ cgq,
bool  reload,
std::string const &  str,
std::string const &  context
 

Parses a string. This function calls the Conf::begin(), Conf::parse_string() and Conf::end() functions for the parser.

Parameters:
[in] cgq Sets the ConfGlobalQ object used to initialize the parser.
[in] reload Specifies whether the configuration is being reloaded (true) or not (false).
[in] str The string to parse.
[in] context An arbitrary string giving indication on the parsing location.
Returns:
true if everything succeeded, false otherwise (appropriate error should have been logged by the parser in the latter case).
See also:
Conf::begin(), Conf::parse_string(), Conf::end()

virtual bool conf::ConfQ::setup  )  [inline, virtual]
 

Override this function to add directives to the parser.

This function is called once per instance by parse(), parse_file() and parse_string().

Returns:
true if setup completed successfully, false otherwise.
See also:
parse(), parse_file(), parse_string()

Reimplemented in conf::DirectivesQ::DConfQ.


The documentation for this class was generated from the following file:
Generated on Sun May 20 21:32:19 2007 for Epona API by  doxygen 1.4.6