SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
Helper class to convert an RWDateTime instance to a date from a string and vice versa, conforming to the HTTP/1.1 specification. More...
#include <rw/http/RWHttpDate.h>
Public Member Functions | |
RWHttpDate (void) | |
RWHttpDate (const RWDateTime &dt) | |
RWHttpDate (const RWCString &str) | |
RWCString | asString () const |
RWDateTime | getDate () const |
void | setDate (const RWCString &str) |
void | setDate (const RWDateTime &dt) |
bool | isValid () const |
Related Functions | |
(Note that these are not member functions.) | |
bool | operator== (const RWHttpDate &date1, const RWHttpDate &date2) |
bool | operator!= (const RWHttpDate &date1, const RWHttpDate &date2) |
bool | operator< (const RWHttpDate &date1, const RWHttpDate &date2) |
bool | operator<= (const RWHttpDate &date1, const RWHttpDate &date2) |
bool | operator> (const RWHttpDate &date1, const RWHttpDate &date2) |
bool | operator>= (const RWHttpDate &date1, const RWHttpDate &date2) |
std::ostream & | operator<< (std::ostream &s, const RWHttpDate &d) |
std::istream & | operator>> (std::istream &s, RWHttpDate &d) |
RWHttpDate maintains the date and time. It outputs the date as a string that conforms to the HTTP/1.1 date specification.
RWHttpDate::RWHttpDate | ( | void | ) | [inline] |
Constructs a default RWHttpDate object. Internal date and time are initialized to the current date and time, respectively.
RWHttpDate::RWHttpDate | ( | const RWDateTime & | dt | ) | [inline] |
Constructs an RWHttpDate object with the internal date and time set to those in dt.
RWHttpDate::RWHttpDate | ( | const RWCString & | str | ) | [inline] |
Constructs an RWHttpDate object with the input str. The str argument must be an HTTP/1.1-compliant date string. The str is parsed for date and time, and the internals are set to the result. If str cannot be parsed, an invalid date is constructed.
HTTP/1.1 defines the following formats as acceptable date strings:
asctime()
formatRWCString RWHttpDate::asString | ( | ) | const |
Returns the internal date and time formatted to comply with the HTTP/1.1 specification. The RWCString should contain 7-bit US-ASCII data. Throws RWInternalErr if isValid() is false
.
RWDateTime RWHttpDate::getDate | ( | ) | const [inline] |
Returns an RWDateTime constructed on the date associated with the RWHttpDate object.
bool RWHttpDate::isValid | ( | void | ) | const [inline] |
Returns true
if the internal RWDateTime is not a sentinel value.
void RWHttpDate::setDate | ( | const RWDateTime & | dt | ) | [inline] |
Sets the internal date of the RWHttpDate object to the date and time in dt.
void RWHttpDate::setDate | ( | const RWCString & | str | ) |
Sets the internal date of the RWHttpDate object from the string str. The str argument must be an HTTP/1.1-compliant date string. The str is parsed for date and time, and the internals are set to the result. If str cannot be parsed, an invalid date is constructed. The RWCString should contain 7-bit US-ASCII data.
bool operator!= | ( | const RWHttpDate & | date1, | |
const RWHttpDate & | date2 | |||
) | [related] |
Comparison operators.
bool operator< | ( | const RWHttpDate & | date1, | |
const RWHttpDate & | date2 | |||
) | [related] |
Comparison operators.
std::ostream & operator<< | ( | std::ostream & | s, | |
const RWHttpDate & | d | |||
) | [related] |
Outputs an RWHttpDate object to an std::ostream
.
bool operator<= | ( | const RWHttpDate & | date1, | |
const RWHttpDate & | date2 | |||
) | [related] |
Comparison operators.
bool operator== | ( | const RWHttpDate & | date1, | |
const RWHttpDate & | date2 | |||
) | [related] |
Comparison operators.
bool operator> | ( | const RWHttpDate & | date1, | |
const RWHttpDate & | date2 | |||
) | [related] |
Comparison operators.
bool operator>= | ( | const RWHttpDate & | date1, | |
const RWHttpDate & | date2 | |||
) | [related] |
Comparison operators.
std::istream & operator>> | ( | std::istream & | s, | |
RWHttpDate & | d | |||
) | [related] |
Restores an RWHttpDate from an std::istream
into d, replacing the previous contents of d.
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.