Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

Rfc1123 Class Reference

Inheritance diagram for Rfc1123:

Epoch List of all members.

Static Public Member Functions

static char[] format (long time)
static char[] format (char[] buffer, long time)
static long parse (char[] date, uint *ate=null)

Static Private Member Functions

static int rfc1123 (char[] src, inout ulong value)
static int rfc850 (char[] src, inout ulong value)
static int asctime (char[] src, inout ulong value)
static bool time (inout Fields fields, inout char *p)
static int parseMonth (inout char *p)
static int parseShortDay (inout char *p)
static int parseFullDay (inout char *p)
static int parseInt (inout char *p)
static long startTime ()

Private Attributes

const long InvalidEpoch = -1

Detailed Description

Converts between native and text representations of HTTP time values. Internally, time is represented as UTC with an epoch fixed at Jan 1st 1970. The text representation is formatted in accordance with RFC 1123, and the parser will accept one of RFC 1123, RFC 850, or asctime formats.

See http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html for further detail.

Definition at line 62 of file Rfc1123.d.


Member Function Documentation

static char [] format long  time  )  [inline, static]
 

RFC 1123 formatted time

Provides enough space to construct a standard date in the following format: "Sun, 06 Nov 1994 08:49:37 GMT"

Definition at line 73 of file Rfc1123.d.

static char [] format char[]  buffer,
long  time
[inline, static]
 

RFC 1123 formatted time

Converts to the format "Sun, 06 Nov 1994 08:49:37 GMT", and returns a populated slice of the provided buffer; with zero length if the date was invalid.

Note that RFC 1123 format is always in absolute GMT time

Definition at line 90 of file Rfc1123.d.

static long parse char[]  date,
uint *  ate = null
[inline, static]
 

Parse provided input and return a UTC epoch time. A return value of InvalidEpoch indicated a parse-failure.

An option is provided to return the count of characters parsed ~ a zero value here also indicated invalid input.

Definition at line 129 of file Rfc1123.d.

References asctime(), rfc1123(), and rfc850().

static int rfc1123 char[]  src,
inout ulong  value
[inline, static, private]
 

RFC 822, updated by RFC 1123

"Sun, 06 Nov 1994 08:49:37 GMT"

Definition at line 154 of file Rfc1123.d.

References parseInt(), parseMonth(), parseShortDay(), and time().

Referenced by parse().

static int rfc850 char[]  src,
inout ulong  value
[inline, static, private]
 

RFC 850, obsoleted by RFC 1036

"Sunday, 06-Nov-94 08:49:37 GMT"

Definition at line 192 of file Rfc1123.d.

References parseFullDay(), parseInt(), parseMonth(), and time().

Referenced by parse().

static int asctime char[]  src,
inout ulong  value
[inline, static, private]
 

ANSI C's asctime() format

"Sun Nov 6 08:49:37 1994"

Definition at line 236 of file Rfc1123.d.

References parseInt(), parseMonth(), parseShortDay(), and time().

Referenced by parse().

static bool time inout Fields  fields,
inout char *  p
[inline, static, private]
 

Parse a time field

Definition at line 271 of file Rfc1123.d.

References parseInt().

Referenced by asctime(), rfc1123(), and rfc850().

static int parseMonth inout char *  p  )  [inline, static, private]
 

Match a month from the input

Definition at line 286 of file Rfc1123.d.

Referenced by asctime(), rfc1123(), and rfc850().

static int parseShortDay inout char *  p  )  [inline, static, private]
 

Match a day from the input

Definition at line 342 of file Rfc1123.d.

Referenced by asctime(), and rfc1123().

static int parseFullDay inout char *  p  )  [inline, static, private]
 

Match a day from the input

Definition at line 383 of file Rfc1123.d.

References memcmp().

Referenced by rfc850().

static int parseInt inout char *  p  )  [inline, static, private]
 

Extract an integer from the input

Definition at line 401 of file Rfc1123.d.

Referenced by asctime(), rfc1123(), rfc850(), and time().

static long startTime  )  [inline, static, inherited]
 

Utc time this executable started

Definition at line 366 of file Epoch.d.


Member Data Documentation

const long InvalidEpoch = -1 [inherited]
 

Definition at line 81 of file Epoch.d.


The documentation for this class was generated from the following file:
Generated on Fri Nov 11 18:44:42 2005 for Mango by  doxygen 1.4.0