Functions |
int | StrBufReplaceToken (StrBuf *Buf, long where, long HowLong, const char *Repl, long ReplLen) |
| Replace a token at a given place with a given length by another token with given length.
|
int | StrBufNum_tokens (const StrBuf *source, char tok) |
| Counts the numbmer of tokens in a buffer.
|
int | StrBufRemove_token (StrBuf *Source, int parmnum, char separator) |
| a string tokenizer
|
int | StrBufExtract_token (StrBuf *dest, const StrBuf *Source, int parmnum, char separator) |
| a string tokenizer
|
int | StrBufExtract_int (const StrBuf *Source, int parmnum, char separator) |
| a string tokenizer to fetch an integer
|
long | StrBufExtract_long (const StrBuf *Source, int parmnum, char separator) |
| a string tokenizer to fetch a long integer
|
unsigned long | StrBufExtract_unsigned_long (const StrBuf *Source, int parmnum, char separator) |
| a string tokenizer to fetch an unsigned long
|
Detailed Description
versatile tokenizer; random access to tokens, but slower; Prefer the Next Tokenizer
Function Documentation
int StrBufExtract_int |
( |
const StrBuf * |
Source, |
|
|
int |
parmnum, |
|
|
char |
separator | |
|
) |
| | |
a string tokenizer to fetch an integer
- Parameters:
-
| Source | String containing tokens |
| parmnum | n'th Parameter to extract |
| separator | tokenizer character |
- Returns:
- 0 if not found, else integer representation of the token
long StrBufExtract_long |
( |
const StrBuf * |
Source, |
|
|
int |
parmnum, |
|
|
char |
separator | |
|
) |
| | |
a string tokenizer to fetch a long integer
- Parameters:
-
| Source | String containing tokens |
| parmnum | n'th Parameter to extract |
| separator | tokenizer character |
- Returns:
- 0 if not found, else long integer representation of the token
int StrBufExtract_token |
( |
StrBuf * |
dest, |
|
|
const StrBuf * |
Source, |
|
|
int |
parmnum, |
|
|
char |
separator | |
|
) |
| | |
a string tokenizer
- Parameters:
-
| dest | Destination StringBuffer |
| Source | StringBuffer to read into |
| parmnum | n'th Parameter to extract |
| separator | tokenizer character |
- Returns:
- -1 if not found, else length of token.
unsigned long StrBufExtract_unsigned_long |
( |
const StrBuf * |
Source, |
|
|
int |
parmnum, |
|
|
char |
separator | |
|
) |
| | |
a string tokenizer to fetch an unsigned long
- Parameters:
-
| Source | String containing tokens |
| parmnum | n'th Parameter to extract |
| separator | tokenizer character |
- Returns:
- 0 if not found, else unsigned long representation of the token
int StrBufNum_tokens |
( |
const StrBuf * |
source, |
|
|
char |
tok | |
|
) |
| | |
Counts the numbmer of tokens in a buffer.
- Parameters:
-
| source | String to count tokens in |
| tok | Tokenizer char to count |
- Returns:
- numbers of tokenizer chars found
int StrBufRemove_token |
( |
StrBuf * |
Source, |
|
|
int |
parmnum, |
|
|
char |
separator | |
|
) |
| | |
a string tokenizer
- Parameters:
-
| Source | StringBuffer to read into |
| parmnum | n'th Parameter to remove |
| separator | tokenizer character |
- Returns:
- -1 if not found, else length of token.
int StrBufReplaceToken |
( |
StrBuf * |
Buf, |
|
|
long |
where, |
|
|
long |
HowLong, |
|
|
const char * |
Repl, |
|
|
long |
ReplLen | |
|
) |
| | |
Replace a token at a given place with a given length by another token with given length.
- Parameters:
-
| Buf | String where to work on |
| where | where inside of the Buf is the search-token |
| HowLong | How long is the token to be replaced |
| Repl | Token to insert at 'where' |
| ReplLen | Length of repl |
- Returns:
- -1 if fail else length of resulting Buf