CookieParser

Server-side cookie parser. See RFC 2109 for details.

Constructors

this
this(CookieStack stack)

Members

Functions

parse
bool parse(char[] header)

Locate the next token from the provided buffer, and map a buffer reference into token. Returns true if a token was located, false otherwise.

scan
size_t scan(const(void)[] data)

Callback for iterator.next(). We scan for name-value pairs, populating Cookie instances along the way.

Static functions

toLower
char[] toLower(char[] src)

in-place conversion to lowercase

Inherited Members

From Iterator

slice
cstring slice;
delim
cstring delim;
Undocumented in source.
scan
size_t scan(const(void)[] data)

The pattern scanner, implemented via subclasses.

set
Iterator set(InputStream stream)

Set the provided stream as the scanning source.

get
cstring get()

Return the current token as a slice of the content.

opApply
int opApply(int delegate(ref cstring) dg)

Iterate over the set of tokens. This should really provide read-only access to the tokens, but D does not support that at this time.

opApply
int opApply(int delegate(ref int, ref cstring) dg)

Iterate over a set of tokens, exposing a token count starting at zero.

opApply
int opApply(int delegate(ref int, ref cstring, ref cstring) dg)

Iterate over a set of tokens and delimiters, exposing a token count starting at zero.

next
cstring next()

Locate the next token. Returns the token if found, null otherwise. Null indicates an end of stream condition. To sweep a conduit for lines using method next():

set
size_t set(const(char)* content, size_t start, size_t end)

Set the content of the current slice to the provided start and end points.

set
size_t set(const(char)* content, size_t start, size_t end, size_t next)

Set the content of the current slice to the provided start and end points, and delimiter to the segment between end & next (inclusive.)

notFound
size_t notFound()

Called when a scanner fails to find a matching pattern. This may cause more content to be loaded, and a rescan initiated.

found
size_t found(size_t i)

Invoked when a scanner matches a pattern. The provided value should be the index of the last element of the matching pattern, which is converted back to a void[] index.

has
bool has(cstring set, char match)

See if set of characters holds a particular instance.

Meta