libgpac 0.4.5
Functions

tokenizer

utils

String Tokenizer Functions. More...

Functions

s32 gf_token_get (char *buffer, s32 start, char *separators, char *token, s32 token_size)
 get string component
s32 gf_token_get_strip (char *buffer, s32 start, char *separators, char *strip_set, char *token, s32 token_size)
 get string component without delimitting characters
s32 gf_token_get_line (char *buffer, u32 start, u32 size, char *line_buffer, u32 line_buffer_size)
 line removal
s32 gf_token_find (char *buffer, u32 start, u32 size, char *pattern)
 pattern location

Detailed Description

This section documents the basic string tokenizer of the GPAC framework.


Function Documentation

s32 gf_token_get ( char *  buffer,
s32  start,
char *  separators,
char *  token,
s32  token_size 
)

Gets the next string component comprised in a given set of characters

Parameters:
buffersource string to scan
startchar offset from begining of buffer where tokenization shall start
separatorsseparator characters to use
tokenoutput buffer location
token_sizeoutput 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
s32 gf_token_get_strip ( char *  buffer,
s32  start,
char *  separators,
char *  strip_set,
char *  token,
s32  token_size 
)

Gets the next string component comprised in a given set of characters, removing surrounding characters

Parameters:
buffersource string to scan
startchar offset from begining of buffer where tokenization shall start
separatorsseparator characters to use
strip_setsurrounding characters to remove
tokenoutput buffer location
token_sizeoutput 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
s32 gf_token_get_line ( 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:
buffersource string to scan
startchar offset from begining of buffer where tokenization shall start
sizesize of the input buffer to analyze
line_bufferoutput buffer location
line_buffer_sizeoutput 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
s32 gf_token_find ( char *  buffer,
u32  start,
u32  size,
char *  pattern 
)

Locates a pattern in the buffer

Parameters:
buffersource string to scan
startchar offset from begining of buffer where tokenization shall start
sizesize of the input buffer to analyze
patternpattern to locate
Returns:
position of the first char in the buffer after the pattern, or -1 if pattern could not be found