OSDN Git Service

add tstools.
[rec10/rec10-git.git] / tstools / DtsEdit / src / gpac / token.h
1 /*\r
2  *                      GPAC - Multimedia Framework C SDK\r
3  *\r
4  *                      Copyright (c) Jean Le Feuvre 2000-2005 \r
5  *                                      All rights reserved\r
6  *\r
7  *  This file is part of GPAC / common tools sub-project\r
8  *\r
9  *  GPAC is free software; you can redistribute it and/or modify\r
10  *  it under the terms of the GNU Lesser General Public License as published by\r
11  *  the Free Software Foundation; either version 2, or (at your option)\r
12  *  any later version.\r
13  *   \r
14  *  GPAC is distributed in the hope that it will be useful,\r
15  *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
16  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
17  *  GNU Lesser General Public License for more details.\r
18  *   \r
19  *  You should have received a copy of the GNU Lesser General Public\r
20  *  License along with this library; see the file COPYING.  If not, write to\r
21  *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
22  *\r
23  */\r
24 \r
25 #ifndef _GF_TOKEN_H_\r
26 #define _GF_TOKEN_H_\r
27 \r
28 #ifdef __cplusplus\r
29 extern "C" {\r
30 #endif\r
31 \r
32 /*!\r
33  *      \file <gpac/token.h>\r
34  *      \brief tokenizer functions.\r
35  */\r
36 \r
37  /*!\r
38  *      \addtogroup tok_grp tokenizer\r
39  *      \ingroup utils_grp\r
40  *      \brief String Tokenizer Functions\r
41  *\r
42  *This section documents the basic string tokenizer of the GPAC framework.\r
43  *      @{\r
44  */\r
45 \r
46 #include <gpac/tools.h>\r
47 \r
48 /*!\r
49  *\brief get string component \r
50  *\r
51  *Gets the next string component comprised in a given set of characters\r
52  *\param buffer source string to scan\r
53  *\param start char offset from begining of buffer where tokenization shall start\r
54  *\param separators separator characters to use\r
55  *\param token output buffer location\r
56  *\param token_size output buffer allocated size\r
57  *\return position of the first char in the buffer after the last terminating separator, or -1 if token could not be found\r
58  */\r
59 s32 gf_token_get(char *buffer, s32 start, char *separators, char *token, s32 token_size);\r
60 /*!\r
61  *\brief get string component without delimitting characters\r
62  *\r
63  *Gets the next string component comprised in a given set of characters, removing surrounding characters\r
64  *\param buffer source string to scan\r
65  *\param start char offset from begining of buffer where tokenization shall start\r
66  *\param separators separator characters to use\r
67  *\param strip_set surrounding characters to remove\r
68  *\param token output buffer location\r
69  *\param token_size output buffer allocated size\r
70  *\return position of the first char in the buffer after the last terminating separator, or -1 if token could not be found\r
71  */\r
72 s32 gf_token_get_strip(char *buffer, s32 start, char *separators, char *strip_set, char *token, s32 token_size);\r
73 /*!\r
74  *\brief line removal\r
75  *\r
76  *Gets one line from buffer and remove delimiters CR, LF and CRLF\r
77  *\param buffer source string to scan\r
78  *\param start char offset from begining of buffer where tokenization shall start\r
79  *\param size size of the input buffer to analyze\r
80  *\param line_buffer output buffer location\r
81  *\param line_buffer_size output buffer allocated size\r
82  *\return position of the first char in the buffer after the last line delimiter, or -1 if no line could be found\r
83  */\r
84 s32 gf_token_get_line(char      *buffer, u32 start, u32 size, char *line_buffer, u32 line_buffer_size);\r
85 /*!\r
86  *\brief pattern location\r
87  *\r
88  *Locates a pattern in the buffer\r
89  *\param buffer source string to scan\r
90  *\param start char offset from begining of buffer where tokenization shall start\r
91  *\param size size of the input buffer to analyze\r
92  *\param pattern pattern to locate\r
93  *\return position of the first char in the buffer after the pattern, or -1 if pattern could not be found\r
94  */\r
95 s32 gf_token_find(char *buffer, u32 start, u32 size, char *pattern);\r
96 \r
97 \r
98 /*! @} */\r
99 \r
100 #ifdef __cplusplus\r
101 }\r
102 #endif\r
103 \r
104 \r
105 #endif          /*_GF_TOKEN_H_*/\r
106 \r