Module: Internet Protocols Module Package: HTTP
Does not inherit
operator!=() operator>>() |
operator>() operator>=() |
operator<<() operator<() |
operator<=() operator==() |
#include <rw/http/RWHttpDate.h>
RWHttpDate maintains the date and time. It outputs the date as a string that conforms to the HTTP/1.0 date specification.
RWHttpDate();
Constructs a default RWHttpDate object. Internal date and time are initialized to the current date and time, respectively.
RWHttpDate(const RWDateTime& dt);
Constructs an RWHttpDate object with the internal date and time set to those in dt.
RWHttpDate(const RWCString& str);
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:
Sun, 06 Nov 1994 08:49:37 GMT; RFC 822, updated by RFC 1123
Sunday, 06-Nov-94 08:49:37 GMT; RFC 850, obsoleted by RFC 1036
Sun Nov 6 08:49:37 1994; ANSI C's asctime() format
RWCString asString() const;
Returns the interna l 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 getDate() const;
Returns an RWDateTime constructed on the date associated with the RWHttpDate object.
bool isValid() const;
Returns true if the internal RWDateTime is not a sentinel value.
void 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.
void setDate(const RWDateTime& dt);
Sets the internal date of the RWHttpDate object to the date and time in dt.
ostream& operator<<(ostream& s, const RWHttpDate& d);
Outputs an RWHttpDate object to an ostream.
istream& operator>>(istream& s, RWHttpDate& d);
Restores an RWHttpDate from an istream into d, replacing the previous contents of d.
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);
Comparison operators.
© 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.