#include <directives.h>
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 ConfStr & | operator= (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 |
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.
[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.
[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. |
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).
[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). |
Implements conf::ConfValue< std::string >.