Functions

Fast tokenizer to pull tokens in sequence
[Stringbuffer, A class for manipulating strings with dynamic buffers]

Functions

int StrBufHaveNextToken (const StrBuf *Source, const char **pStart)
 a string tokenizer; Bounds checker function to make shure whether StrBufExtract_NextToken and friends have reached the end of the string.
int StrBufExtract_NextToken (StrBuf *dest, const StrBuf *Source, const char **pStart, char separator)
 a string tokenizer
int StrBufSkip_NTokenS (const StrBuf *Source, const char **pStart, char separator, int nTokens)
 a string tokenizer
int StrBufExtractNext_int (const StrBuf *Source, const char **pStart, char separator)
 a string tokenizer to fetch an integer
long StrBufExtractNext_long (const StrBuf *Source, const char **pStart, char separator)
 a string tokenizer to fetch a long integer
unsigned long StrBufExtractNext_unsigned_long (const StrBuf *Source, const char **pStart, char separator)
 a string tokenizer to fetch an unsigned long

Detailed Description

Quick tokenizer; demands of the user to pull its tokens in sequence


Function Documentation

int StrBufExtract_NextToken ( StrBuf dest,
const StrBuf Source,
const char **  pStart,
char  separator 
)

a string tokenizer

Parameters:
dest Destination StringBuffer
Source StringBuffer to read into
pStart pointer to the end of the last token. Feed with NULL on start.
separator tokenizer
Returns:
-1 if not found, else length of token.
int StrBufExtractNext_int ( const StrBuf Source,
const char **  pStart,
char  separator 
)

a string tokenizer to fetch an integer

Parameters:
Source StringBuffer to read from
pStart Cursor on the tokenstring
separator tokenizer character
Returns:
0 if not found, else integer representation of the token
long StrBufExtractNext_long ( const StrBuf Source,
const char **  pStart,
char  separator 
)

a string tokenizer to fetch a long integer

Parameters:
Source StringBuffer to read from
pStart Cursor on the tokenstring
separator tokenizer character
Returns:
0 if not found, else long integer representation of the token
unsigned long StrBufExtractNext_unsigned_long ( const StrBuf Source,
const char **  pStart,
char  separator 
)

a string tokenizer to fetch an unsigned long

Parameters:
Source StringBuffer to read from
pStart Cursor on the tokenstring
separator tokenizer character
Returns:
0 if not found, else unsigned long representation of the token
int StrBufHaveNextToken ( const StrBuf Source,
const char **  pStart 
)

a string tokenizer; Bounds checker function to make shure whether StrBufExtract_NextToken and friends have reached the end of the string.

Parameters:
Source our tokenbuffer
pStart the token iterator pointer to inspect
Returns:
whether the revolving pointer is inside of the search range
int StrBufSkip_NTokenS ( const StrBuf Source,
const char **  pStart,
char  separator,
int  nTokens 
)

a string tokenizer

Parameters:
Source StringBuffer to read from
pStart pointer to the end of the last token. Feed with NULL.
separator tokenizer character
nTokens number of tokens to fastforward over
Returns:
-1 if not found, else length of token.
 All Classes Variables