 |
Kea
1.5.0
|
Go to the documentation of this file.
7 #ifndef HTTP_DATE_TIME_H
8 #define HTTP_DATE_TIME_H
11 #include <boost/date_time/posix_time/posix_time.hpp>
52 explicit HttpDateTime(
const boost::posix_time::ptime& t);
129 std::string toString(
const std::string&
format,
130 const std::string& method_name)
const;
148 static boost::posix_time::ptime
149 fromString(
const std::string& time_string,
const std::string&
format,
150 const std::string& method_name,
const bool zone_check =
true);
153 boost::posix_time::ptime time_;
static HttpDateTime fromRfc850(const std::string &time_string)
Creates an instance from a string containing time value formatted as specified in RFC 850.
std::string rfc1123Format() const
Returns time value formatted as specified in RFC 1123.
HttpDateTime()
Default constructor.
static HttpDateTime fromAsctime(const std::string &time_string)
Creates an instance from a string containing time value formatted as output from asctime() function.
This is a base class for exceptions thrown from the DNS library module.
Defines the logger used by the top-level component of kea-dhcp-ddns.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
std::string format(const std::string &format, const std::vector< std::string > &args)
Apply Formatting.
std::string asctimeFormat() const
Returns time value formatted as output of ANSI C's asctime().
HttpTimeConversionError(const char *file, size_t line, const char *what)
static HttpDateTime fromRfc1123(const std::string &time_string)
Creates an instance from a string containing time value formatted as specified in RFC 1123.
static HttpDateTime fromAny(const std::string &time_string)
Creates an instance from a string containing time value formatted in one of the supported formats.
boost::posix_time::ptime getPtime() const
Returns time encapsulated by this class.
std::string rfc850Format() const
Returns time value formatted as specified in RFC 850.
This class parses and generates time values used in HTTP.
Exception thrown when there is an error during time conversion.