Inheritance diagram for HttpTokens:
Public Member Functions | |
this (char separator, bool inclusive=false) | |
this (HttpTokens source) | |
void | parse (IBuffer input) |
void | parse (char[] content) |
void | reset () |
bool | isParsed () |
void | setParsed (bool parsed) |
char[] | get (char[] name) |
int | getInt (char[] name, int ret=-1) |
long | getDate (char[] name, long date=Rfc1123.InvalidEpoch) |
int | opApply (int(*dg)(inout HttpToken)) |
void | write (IWriter writer) |
private bool | split (Token t, inout HttpToken element) |
FilteredTokens | createFilter (char[] match) |
char[] | toOutputString () |
Static Public Member Functions | |
static | this () |
Protected Member Functions | |
void | setOutputBuffer (IBuffer output) |
IBuffer | getOutputBuffer () |
void | add (char[] name, void(*dg)(IBuffer)) |
void | add (char[] name, char[] value) |
void | addInt (char[] name, int value) |
void | addDate (char[] name, long value) |
Protected Attributes | |
TokenStack | stack |
Private Attributes | |
IBuffer | input |
IBuffer | output |
bool | parsed |
bool | inclusive |
char | separator |
char[1] | sepString |
Static Private Attributes | |
char[] | emptyString |
Classes | |
class | FilteredTokens |
All tokens are mapped directly onto a buffer, so there is no memory allocation or copying involved.
Note that this class does not support deleting tokens. Supporting such operations require a different approach, such as mapping the tokens into a temporary buffer, and then setting token content in the stack to be null when it is deleted. This could be implemented as a wrapper upon the subclasses of HttpToken.
Definition at line 85 of file HttpTokens.d.
|
Setup an empty character array for later assignment. Reimplemented in HttpHeaders, HttpHeaders, HttpParams, and HttpParams. Definition at line 103 of file HttpTokens.d. References emptyString. |
|
Construct a set of tokens based upon the given delimeter, and an indication of whether said delimeter should be considered part of the left side (effectively the name). The latter is useful with headers, since the seperating ':' character should really be considered part of the name for purposes of subsequent token matching. Definition at line 120 of file HttpTokens.d. References inclusive, input, separator, sepString, stack, and TokenStack. |
|
Clone a source set of HttpTokens Definition at line 140 of file HttpTokens.d. References TokenStack::clone(), inclusive, input, output, parsed, separator, sepString, and stack. |
|
Read all tokens. Everything is mapped rather than being allocated & copied Reimplemented in HttpHeaders, and HttpParams. Referenced by parse(). |
|
Parse an input string. Definition at line 166 of file HttpTokens.d. References input, parse(), and IBuffer::setValidContent(). |
|
Reset this set of tokens. Definition at line 178 of file HttpTokens.d. References IBuffer::clear(), output, parsed, TokenStack::reset(), and stack. Referenced by HttpRequest::reset(), and HttpClient::reset(). |
|
Have tokens been parsed yet? Definition at line 194 of file HttpTokens.d. References parsed. Referenced by HttpRequest::getInputParameters(). |
|
Indicate whether tokens have been parsed or not. Definition at line 205 of file HttpTokens.d. Referenced by HttpParams::parse(), and HttpHeaders::parse(). |
|
Return the value of the provided header, or null if the header does not exist Definition at line 217 of file HttpTokens.d. References TokenStack::findToken(), split(), stack, and HttpToken::value. Referenced by AdminServlet::addLogger(), getDate(), getInt(), AdminServlet::service(), and AdminServlet::setLoggerLevel(). |
|
Return the integer value of the provided header, or the provided default-vaule if the header does not exist Definition at line 237 of file HttpTokens.d. References get(). Referenced by AdminServlet::addLogger(). |
|
Return the date value of the provided header, or the provided default-value if the header does not exist Definition at line 254 of file HttpTokens.d. References get(). |
|
Iterate over the set of tokens Definition at line 270 of file HttpTokens.d. |
|
Output the token list to the provided writer Reimplemented from IWritable. Definition at line 291 of file HttpTokens.d. References IWriter::cr(), IWriter::put(), and stack. |
|
split basic token into an HttpToken Definition at line 307 of file HttpTokens.d. References emptyString, inclusive, separator, and Token::toString(). Referenced by get(), HttpTokens::FilteredTokens::opApply(), and opApply(). |
|
Create a filter for iterating over the tokens matching a particular name. Definition at line 338 of file HttpTokens.d. |
|
Set the output buffer for adding tokens to. This is used by the various MutableXXXX classes. Definition at line 407 of file HttpTokens.d. References output. |
|
Return the buffer used for output. Reimplemented in HttpMutableHeaders. Definition at line 418 of file HttpTokens.d. References output. |
|
Return a char[] representing the output. An empty array is returned if output was not configured. Definition at line 430 of file HttpTokens.d. References output, and IBuffer::toString(). |
|
Add a token with the given name. The content is provided via the specified delegate. We stuff this name & content into the output buffer, and map a new Token onto the appropriate buffer slice. Definition at line 448 of file HttpTokens.d. References IBuffer::append(), IBuffer::getLimit(), inclusive, output, TokenStack::push(), sepString, stack, and IBuffer::toString(). |
|
Add a simple name/value pair to the output Reimplemented in HttpMutableParams. Definition at line 474 of file HttpTokens.d. References add(), and IBuffer::append(). |
|
Add a name/integer pair to the output Reimplemented in HttpMutableParams. Definition at line 490 of file HttpTokens.d. References add(). |
|
Add a name/date(long) pair to the output Reimplemented in HttpMutableParams. Definition at line 504 of file HttpTokens.d. References add(). |
|
Definition at line 87 of file HttpTokens.d. Referenced by add(), get(), HttpTokens::FilteredTokens::opApply(), opApply(), reset(), this(), and write(). |
|
Definition at line 89 of file HttpTokens.d. |
|
Definition at line 89 of file HttpTokens.d. Referenced by add(), getOutputBuffer(), reset(), setOutputBuffer(), this(), and toOutputString(). |
|
Definition at line 91 of file HttpTokens.d. Referenced by isParsed(), reset(), and this(). |
|
Definition at line 92 of file HttpTokens.d. |
|
Definition at line 93 of file HttpTokens.d. |
|
Definition at line 94 of file HttpTokens.d. |
|
Definition at line 95 of file HttpTokens.d. |