#include <directives.h>
Inheritance diagram for conf::ConfDuration:
Public Member Functions | |
ConfDuration (std::string const &name, bool reloadable, time_t mindur, time_t maxdur) | |
Constructor without default value. | |
ConfDuration (std::string const &name, time_t defval, bool reloadable, time_t mindur, time_t maxdur) | |
Constructor with default value. | |
ConfDuration (std::string const &name, bool reloadable) | |
ConfArray-specific constructor. | |
ConfDuration (ConfDuration const &cd) | |
Copy constructor. | |
virtual ConfDuration & | operator= (ConfDuration const &right) |
Assignment operator. | |
operator time_t () 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. | |
virtual bool | check (Conf &conf, time_t value) const |
Checks if the duration is in the range m_mindur..m_maxdur. | |
Protected Attributes | |
time_t | m_mindur |
The minimum duration. | |
time_t | m_maxdur |
The maximum duration. |
It converts string expressions of a duration to a number of seconds. The conversion function used to do the job is duration_scan() from the misc library. See its help for more information about valid expressions.
A conversion operator to time_t is provided for easy value access.
|
This constructor sets the directive name and whether it can be reloaded, along with the minimum and maximum duration that will be accepted when the directive is set.
|
|
This constructor sets the directive name, default value and whether it can be reloaded, along with the minimum and maximum duration that will be accepted when the directive is set.
|
|
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).
Implements conf::ConfValue< time_t >. |