Panda3D
Public Member Functions | Static Public Member Functions | List of all members
HTTPDate Class Reference

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

Public Member Functions

 __init__ ()
 
 __init__ (const HTTPDate copy)
 
 __init__ (str format)
 Decodes the string into a sensible date. More...
 
 __init__ (time_t time)
 
int compareTo (const HTTPDate other)
 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. More...
 
str getString ()
 
time_t getTime ()
 Returns the date as a C time_t value. More...
 
bool input (Istream in)
 
bool isValid ()
 Returns true if the date is meaningful, or false if it is -1 (which generally indicates the source string could not be parsed.) More...
 
bool operator != (const HTTPDate other)
 
int operator - (const HTTPDate other)
 
HTTPDate operator - (int seconds)
 
HTTPDate operator -= (int seconds)
 
bool operator > (const HTTPDate other)
 
HTTPDate operator+ (int seconds)
 
HTTPDate operator+= (int seconds)
 
bool operator< (const HTTPDate other)
 
HTTPDate operator= (const HTTPDate copy)
 
bool operator== (const HTTPDate other)
 
 output (Ostream out)
 

Static Public Member Functions

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

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.

Member Function Documentation

◆ __init__() [1/4]

__init__ ( )

◆ __init__() [2/4]

__init__ ( const HTTPDate  copy)

◆ __init__() [3/4]

__init__ ( str  format)

Decodes the string into a sensible date.

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

◆ __init__() [4/4]

__init__ ( time_t  time)

◆ compareTo()

int compareTo ( const HTTPDate  other)

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.

◆ getString()

str getString ( )

◆ getTime()

time_t getTime ( )

Returns the date as a C time_t value.

◆ input()

bool input ( Istream  in)

◆ isValid()

bool isValid ( )

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

◆ now()

static HTTPDate now ( )
static

Returns an HTTPDate that represents the current time and date.

◆ operator !=()

bool operator != ( const HTTPDate  other)

◆ operator -() [1/2]

int operator - ( const HTTPDate  other)

◆ operator -() [2/2]

HTTPDate operator - ( int  seconds)

◆ operator -=()

HTTPDate operator -= ( int  seconds)

◆ operator >()

bool operator > ( const HTTPDate  other)

◆ operator+()

HTTPDate operator+ ( int  seconds)

◆ operator+=()

HTTPDate operator+= ( int  seconds)

◆ operator<()

bool operator< ( const HTTPDate  other)

◆ operator=()

HTTPDate operator= ( const HTTPDate  copy)

◆ operator==()

bool operator== ( const HTTPDate  other)

◆ output()

output ( Ostream  out)