conf::ConfStr Class Reference

Class implementing a string directive type. More...

#include <directives.h>

Inheritance diagram for conf::ConfStr:

conf::ConfValue< std::string > conf::ConfDir conf::ConfStrChar conf::ConfString List of all members.

Public Member Functions

 ConfStr (std::string const &name, bool reloadable, std::string::size_type minlen, std::string::size_type maxlen, std::string const &validchars)
 Constructor without default value.
 ConfStr (std::string const &name, std::string const &defval, bool reloadable, std::string::size_type minlen, std::string::size_type maxlen, std::string const &validchars)
 Constructor with default value.
 ConfStr (std::string const &name, bool reloadable)
 ConfArray-specific constructor.
 ConfStr (ConfStr const &cd)
 Copy constructor.
virtual ConfStroperator= (ConfStr const &right)
 Assignment operator.
bool operator== (ConfStr const &right) const
 == operator
bool operator== (std::string const &right) const
 == operator for std::string r-values
bool operator!= (ConfStr const &right) const
 != operator
bool operator!= (std::string const &right) const
 != operator for std::string r-values
bool operator< (ConfStr const &right) const
 < operator
bool operator< (std::string const &right) const
 < operator for std::string r-values
bool operator<= (ConfStr const &right) const
 <= operator
bool operator<= (std::string const &right) const
 <= operator for std::string r-values
bool operator> (ConfStr const &right) const
 > operator
bool operator> (std::string const &right) const
 > operator for std::string r-values
bool operator>= (ConfStr const &right) const
 >= operator
bool operator>= (std::string const &right) const
 >= operator for std::string r-values
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.
virtual bool check (Conf &conf, std::string const &value) const
 Checks if the string length is in the range m_minlen..m_maxlen.

Protected Attributes

std::string::size_type m_minlen
std::string::size_type m_maxlen
std::string m_validchars

Detailed Description

This class is used to store string values. So as you guess, there's no conversion going on... it's just a copy.


Constructor & Destructor Documentation

conf::ConfStr::ConfStr ( std::string const &  name,
bool  reloadable,
std::string::size_type  minlen,
std::string::size_type  maxlen,
std::string const &  validchars 
) [inline, explicit]

This constructor sets the directive name and whether it can be reloaded, along with the minimum and maximum string length that will be accepted when the directive is set.

Parameters:
[in] name The name of the directive
[in] reloadable true if the directive can be reloaded, false otherwise.
[in] minlen The minimum length to accept as a value.
[in] maxlen The maximum length to accept as a value.
[in] validchars All characters that may be in the value (an error is generated if a character which is not in this string is used). Can be an empty string to accept all characters.

conf::ConfStr::ConfStr ( std::string const &  name,
std::string const &  defval,
bool  reloadable,
std::string::size_type  minlen,
std::string::size_type  maxlen,
std::string const &  validchars 
) [inline]

This constructor sets the directive name, default value and whether it can be reloaded, along with the minimum and maximum string length that will be accepted when the directive is set.

Parameters:
[in] name The name of the directive
[in] defval The default value.
[in] reloadable true if the directive can be reloaded, false otherwise.
[in] minlen The minimum length to accept as a value.
[in] maxlen The maximum length to accept as a value.
[in] validchars All characters that may be in the value (an error is generated if a character which is not in this string is used). Can be an empty string to accept all characters.


Member Function Documentation

virtual bool conf::ConfStr::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< std::string >.


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