conf::ConfBool Class Reference

Class implementing boolean directive type. More...

#include <directives.h>

Inheritance diagram for conf::ConfBool:

conf::ConfValue< bool > conf::ConfDir List of all members.

Public Member Functions

 ConfBool (std::string const &name, bool reloadable)
 Constructor setting the directive name.
 ConfBool (std::string const &name, bool const &defval, bool reloadable)
 Constructor setting the directive name and default value.
 operator bool () const
 Conversion operator.
virtual char const * label (size_t index) const
 Implements ConfDir::label().

Protected Member Functions

virtual bool assign (Conf &conf, unsigned short count, std::string const params[])
 Sets the value.

Detailed Description

This class is used to store bool values. If param is "yes" the value is set to true, and if it is "no", the value is set to false.

A conversion operator to bool is also provided for easy value access.


Member Function Documentation

virtual bool conf::ConfBool::assign ( Conf conf,
unsigned short  count,
std::string const  params[] 
) [protected, virtual]

Transforms the string array passed by the parser into the directive's value. This function must ensure that the value is valid through a call to check() before setting it (you don't need to set m_value_set to true, this will be handled by set() when the function returns successfully).

Parameters:
[in] conf The Conf object that called set().
[in] count Number of parameters in params.
[in] params Parameters passed to the directive (NULL if count is 0).
Returns:
true if the function is successful, false otherwise (conf.error() should have be called with an appropriate error message in that case).

Implements conf::ConfValue< bool >.


The documentation for this class was generated from the following file:
Generated on Wed Aug 15 00:37:22 2007 for Epona API by  doxygen 1.5.2