String Tokenizer.
More...
|
s32 | gf_token_get (const char *Buffer, s32 Start, const char *Separator, char *Container, s32 ContainerSize) |
| get string component More...
|
|
s32 | gf_token_get_strip (const char *Buffer, s32 Start, const char *Separator, const char *strip_set, char *Container, s32 ContainerSize) |
| get string component without delimitting characters More...
|
|
s32 | gf_token_get_line (const char *buffer, u32 start, u32 size, char *line_buffer, u32 line_buffer_size) |
| line removal More...
|
|
s32 | gf_token_find (const char *Buffer, u32 Start, u32 Size, const char *Pattern) |
| pattern location More...
|
|
const char * | gf_token_find_word (const char *in_str, const char *word, char *charsep) |
| word location More...
|
|
This section documents the basic string tokenizer of the GPAC framework.
◆ gf_token_get()
s32 gf_token_get |
( |
const char * |
Buffer, |
|
|
s32 |
Start, |
|
|
const char * |
Separator, |
|
|
char * |
Container, |
|
|
s32 |
ContainerSize |
|
) |
| |
Gets the next string component comprised in a given set of characters
- Parameters
-
Buffer | source string to scan |
Start | char offset from beginning of buffer where tokenization shall start |
Separator | separator characters to use |
Container | output buffer location |
ContainerSize | output buffer allocated size |
- Returns
- position of the first char in the buffer after the last terminating separator, or -1 if token could not be found
◆ gf_token_get_strip()
s32 gf_token_get_strip |
( |
const char * |
Buffer, |
|
|
s32 |
Start, |
|
|
const char * |
Separator, |
|
|
const char * |
strip_set, |
|
|
char * |
Container, |
|
|
s32 |
ContainerSize |
|
) |
| |
Gets the next string component comprised in a given set of characters, removing surrounding characters
- Parameters
-
Buffer | source string to scan |
Start | char offset from beginning of buffer where tokenization shall start |
Separator | separator characters to use |
strip_set | surrounding characters to remove |
Container | output buffer location |
ContainerSize | output buffer allocated size |
- Returns
- position of the first char in the buffer after the last terminating separator, or -1 if token could not be found
◆ gf_token_get_line()
s32 gf_token_get_line |
( |
const char * |
buffer, |
|
|
u32 |
start, |
|
|
u32 |
size, |
|
|
char * |
line_buffer, |
|
|
u32 |
line_buffer_size |
|
) |
| |
Gets one line from buffer and remove delimiters CR, LF and CRLF
- Parameters
-
buffer | source string to scan |
start | char offset from beginning of buffer where tokenization shall start |
size | size of the input buffer to analyze |
line_buffer | output buffer location |
line_buffer_size | output buffer allocated size |
- Returns
- position of the first char in the buffer after the last line delimiter, or -1 if no line could be found
◆ gf_token_find()
s32 gf_token_find |
( |
const char * |
Buffer, |
|
|
u32 |
Start, |
|
|
u32 |
Size, |
|
|
const char * |
Pattern |
|
) |
| |
Locates a pattern in the buffer
- Parameters
-
Buffer | source string to scan |
Start | char offset from beginning of buffer where tokenization shall start |
Size | size of the input buffer to analyze |
Pattern | pattern to locate |
- Returns
- position of the first char in the buffer after the pattern, or -1 if pattern could not be found
◆ gf_token_find_word()
const char* gf_token_find_word |
( |
const char * |
in_str, |
|
|
const char * |
word, |
|
|
char * |
charsep |
|
) |
| |
Locates a word in a string
- Parameters
-
in_str | source string to scan |
word | word to locate |
charsep | set of separators to use. If NULL, function acts as strstr |
- Returns
- first occurence of word, or NULL if none