#include <directives.h>
Inheritance diagram for conf::ConfHostname:
Public Member Functions | |
ConfHostname (std::string const &name, bool reloadable) | |
Constructor setting the directive name. | |
ConfHostname (std::string const &name, struct in_addr const &defval, bool reloadable) | |
Constructor setting the directive name and default value. | |
operator struct in_addr const & () 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. |
It takes a hostname (example: localhost) or a string IP address (example: 127.0.0.1) and resolves/converts it to an integer IP address stored in the s_addr field of struct in_addr. If the parameter is not a valid hostname/IP address, then an error is generated.
A conversion operator to struct in_addr is also provided for easier value access.
|
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< struct in_addr >. |