Panda3D
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
HTTPDate Class Reference

A container for an HTTP-legal time/date indication. More...

#include "httpDate.h"

Public Member Functions

 HTTPDate (const HTTPDate &copy)
 
 HTTPDate (const std::string &format)
 Decodes the string into a sensible date.
 
 HTTPDate (time_t time)
 
int compare_to (const HTTPDate &other) const
 Returns a number less than zero if this HTTPDate sorts before the other one, greater than zero if it sorts after, or zero if they are equivalent.
 
std::string get_string () const
 
time_t get_time () const
 Returns the date as a C time_t value.
 
bool input (std::istream &in)
 
bool is_valid () const
 Returns true if the date is meaningful, or false if it is -1 (which generally indicates the source string could not be parsed.)
 
bool operator!= (const HTTPDate &other) const
 
HTTPDate operator+ (int seconds) const
 
void operator+= (int seconds)
 
int operator- (const HTTPDate &other) const
 
HTTPDate operator- (int seconds) const
 
void operator-= (int seconds)
 
bool operator< (const HTTPDate &other) const
 
void operator= (const HTTPDate &copy)
 
bool operator== (const HTTPDate &other) const
 
bool operator> (const HTTPDate &other) const
 
void output (std::ostream &out) const
 

Static Public Member Functions

static HTTPDate now ()
 Returns an HTTPDate that represents the current time and date.
 

Detailed Description

A container for an HTTP-legal time/date indication.

This can accept a string from an HTTP header and will decode it into a C time_t value; conversely, it can accept a time_t value and encode it for output as a string.

Definition at line 27 of file httpDate.h.

Constructor & Destructor Documentation

◆ HTTPDate() [1/4]

HTTPDate::HTTPDate ( )
inline

Definition at line 17 of file httpDate.I.

◆ HTTPDate() [2/4]

HTTPDate::HTTPDate ( time_t time)
inline

Definition at line 24 of file httpDate.I.

◆ HTTPDate() [3/4]

HTTPDate::HTTPDate ( const std::string & format)

Decodes the string into a sensible date.

Returns 0 (!is_valid()) if the string cannot be correctly decoded.

Definition at line 38 of file httpDate.cxx.

References now().

◆ HTTPDate() [4/4]

HTTPDate::HTTPDate ( const HTTPDate & copy)
inline

Definition at line 31 of file httpDate.I.

Member Function Documentation

◆ compare_to()

int HTTPDate::compare_to ( const HTTPDate & other) const
inline

Returns a number less than zero if this HTTPDate sorts before the other one, greater than zero if it sorts after, or zero if they are equivalent.

Definition at line 104 of file httpDate.I.

◆ get_string()

string HTTPDate::get_string ( ) const

Definition at line 244 of file httpDate.cxx.

◆ get_time()

time_t HTTPDate::get_time ( ) const
inline

Returns the date as a C time_t value.

Definition at line 63 of file httpDate.I.

◆ input()

bool HTTPDate::input ( std::istream & in)

Definition at line 269 of file httpDate.cxx.

◆ is_valid()

bool HTTPDate::is_valid ( ) const
inline

Returns true if the date is meaningful, or false if it is -1 (which generally indicates the source string could not be parsed.)

Definition at line 55 of file httpDate.I.

◆ now()

HTTPDate HTTPDate::now ( )
inlinestatic

Returns an HTTPDate that represents the current time and date.

Definition at line 46 of file httpDate.I.

Referenced by HTTPDate().

◆ operator!=()

bool HTTPDate::operator!= ( const HTTPDate & other) const
inline

Definition at line 79 of file httpDate.I.

◆ operator+()

HTTPDate HTTPDate::operator+ ( int seconds) const
inline

Definition at line 128 of file httpDate.I.

◆ operator+=()

void HTTPDate::operator+= ( int seconds)
inline

Definition at line 112 of file httpDate.I.

◆ operator-() [1/2]

int HTTPDate::operator- ( const HTTPDate & other) const
inline

Definition at line 144 of file httpDate.I.

◆ operator-() [2/2]

HTTPDate HTTPDate::operator- ( int seconds) const
inline

Definition at line 136 of file httpDate.I.

◆ operator-=()

void HTTPDate::operator-= ( int seconds)
inline

Definition at line 120 of file httpDate.I.

◆ operator<()

bool HTTPDate::operator< ( const HTTPDate & other) const
inline

Definition at line 87 of file httpDate.I.

◆ operator=()

void HTTPDate::operator= ( const HTTPDate & copy)
inline

Definition at line 38 of file httpDate.I.

◆ operator==()

bool HTTPDate::operator== ( const HTTPDate & other) const
inline

Definition at line 71 of file httpDate.I.

◆ operator>()

bool HTTPDate::operator> ( const HTTPDate & other) const
inline

Definition at line 95 of file httpDate.I.

◆ output()

void HTTPDate::output ( std::ostream & out) const

Definition at line 300 of file httpDate.cxx.


The documentation for this class was generated from the following files: