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

TokenStack Class Reference

List of all members.

Public Member Functions

 this (int size=10)
TokenStack clone ()
int opApply (int(*dg)(inout Token))
void reset ()
Token findToken (char[] match)
int size ()
Token push (char[] content)
Token push (Token token)
Token push ()
void pop ()

Static Public Member Functions

static bool isMatch (Token token, char[] match)
static void resize (inout Token[] tokens, int size)

Private Attributes

int depth
Token[] tokens

Static Private Attributes

static const int MaxTokenStackSize = 256

Detailed Description

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).

Definition at line 70 of file TokenStack.d.


Member Function Documentation

this int  size = 10  )  [inline]
 

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

Definition at line 84 of file TokenStack.d.

References resize(), size(), and tokens.

TokenStack clone  )  [inline]
 

Clone this stack of tokens

Definition at line 96 of file TokenStack.d.

References clone(), depth, Token::set(), tokens, TokenStack, and toString().

Referenced by clone(), and HttpTokens::this().

int opApply int(*)(inout Token dg  )  [inline]
 

Iterate over all tokens in stack

Definition at line 116 of file TokenStack.d.

References depth, and tokens.

void reset  )  [inline]
 

Pop the stack all the way back to zero

Definition at line 132 of file TokenStack.d.

References depth.

Referenced by HttpTokens::reset().

Token findToken char[]  match  )  [inline]
 

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

Definition at line 145 of file TokenStack.d.

References depth, isMatch(), and tokens.

Referenced by HttpTokens::get().

int size  )  [inline]
 

Return the current stack depth

Definition at line 164 of file TokenStack.d.

References depth.

Referenced by this().

Token push char[]  content  )  [inline]
 

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

Definition at line 176 of file TokenStack.d.

References push(), and Token::set().

Referenced by HttpTokens::add(), HttpParams::parse(), and HttpHeaders::parse().

Token push Token  token  )  [inline]
 

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

Definition at line 188 of file TokenStack.d.

References push(), and Token::toString().

Token push  )  [inline]
 

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

Definition at line 199 of file TokenStack.d.

References depth, resize(), and tokens.

Referenced by push().

void pop  )  [inline]
 

Pop the stack by one.

Definition at line 212 of file TokenStack.d.

References depth.

static bool isMatch Token  token,
char[]  match
[inline, static]
 

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

Definition at line 227 of file TokenStack.d.

References Token::toString(), and version.

Referenced by findToken(), and HttpTokens::FilteredTokens::opApply().

static void resize inout Token[]  tokens,
int  size
[inline, static]
 

Resize this stack by extending the array.

Definition at line 247 of file TokenStack.d.

References MaxTokenStackSize, and Token.

Referenced by push(), and this().


Member Data Documentation

int depth [private]
 

Definition at line 72 of file TokenStack.d.

Referenced by clone(), findToken(), opApply(), pop(), push(), reset(), and size().

Token [] tokens [private]
 

Definition at line 73 of file TokenStack.d.

Referenced by clone(), findToken(), opApply(), push(), and this().

const int MaxTokenStackSize = 256 [static, private]
 

Definition at line 75 of file TokenStack.d.

Referenced by resize().


The documentation for this class was generated from the following file:
Generated on Sat Dec 24 17:28:42 2005 for Mango by  doxygen 1.4.0