HttpStack

A stack of Tokens, used for capturing http headers. The tokens themselves are typically mapped onto the content of a Buffer, or some other external content, so there's minimal allocation involved (typically zero).

Constructors

this
this(int size)

Construct a HttpStack with the specified initial size. The stack will later be resized as necessary.

Members

Functions

clone
HttpStack clone()

Clone this stack of tokens

findToken
Token findToken(cstring match)

Scan the tokens looking for the first one with a matching name. Returns the matching Token, or null if there is no such match.

opApply
int opApply(int delegate(ref Token) dg)

Iterate over all tokens in stack

pop
void pop()

Pop the stack by one.

push
Token push(cstring content)

Push a new token onto the stack, and set it content to that provided. Returns the new Token.

push
Token push(Token token)

Push a new token onto the stack, and set it content to be that of the specified token. Returns the new Token.

push
Token push()

Push a new token onto the stack, and return it.

removeToken
bool removeToken(cstring match)

Scan the tokens looking for the first one with a matching name, and remove it. Returns true if a match was found, or false if not.

reset
void reset()

Pop the stack all the way back to zero

size
int size()

Return the current stack depth

Static functions

isMatch
bool isMatch(Token token, cstring match)

See if the given token matches the specified text. The two must match the minimal extent exactly.

resize
void resize(Token[] tokens, int size)

Resize this stack by extending the array.

Meta