00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088 #ifndef _CPL_STRING_H_INCLUDED
00089 #define _CPL_STRING_H_INCLUDED
00090
00091 #include "cpl_vsi.h"
00092 #include "cpl_error.h"
00093 #include "cpl_conv.h"
00094
00113 CPL_C_START
00114
00115 char CPL_DLL **CSLAddString(char **papszStrList, const char *pszNewString);
00116 int CPL_DLL CSLCount(char **papszStrList);
00117 const char CPL_DLL *CSLGetField( char **, int );
00118 void CPL_DLL CPL_STDCALL CSLDestroy(char **papszStrList);
00119 char CPL_DLL **CSLDuplicate(char **papszStrList);
00120
00121 char CPL_DLL **CSLTokenizeString(const char *pszString );
00122 char CPL_DLL **CSLTokenizeStringComplex(const char *pszString,
00123 const char *pszDelimiter,
00124 int bHonourStrings, int bAllowEmptyTokens );
00125 char CPL_DLL **CSLTokenizeString2( const char *pszString,
00126 const char *pszDelimeter,
00127 int nCSLTFlags );
00128
00129 #define CSLT_HONOURSTRINGS 0x0001
00130 #define CSLT_ALLOWEMPTYTOKENS 0x0002
00131 #define CSLT_PRESERVEQUOTES 0x0004
00132 #define CSLT_PRESERVEESCAPES 0x0008
00133
00134 int CPL_DLL CSLPrint(char **papszStrList, FILE *fpOut);
00135 char CPL_DLL **CSLLoad(const char *pszFname);
00136 int CPL_DLL CSLSave(char **papszStrList, const char *pszFname);
00137
00138 char CPL_DLL **CSLInsertStrings(char **papszStrList, int nInsertAtLineNo,
00139 char **papszNewLines);
00140 char CPL_DLL **CSLInsertString(char **papszStrList, int nInsertAtLineNo,
00141 char *pszNewLine);
00142 char CPL_DLL **CSLRemoveStrings(char **papszStrList, int nFirstLineToDelete,
00143 int nNumToRemove, char ***ppapszRetStrings);
00144 int CPL_DLL CSLFindString( char **, const char * );
00145 int CPL_DLL CSLTestBoolean( const char *pszValue );
00146 int CPL_DLL CSLFetchBoolean( char **papszStrList, const char *pszKey,
00147 int bDefault );
00148
00149 const char CPL_DLL *CPLSPrintf(char *fmt, ...);
00150 char CPL_DLL **CSLAppendPrintf(char **papszStrList, char *fmt, ...);
00151
00152 const char CPL_DLL *
00153 CPLParseNameValue(const char *pszNameValue, char **ppszKey );
00154 const char CPL_DLL *
00155 CSLFetchNameValue(char **papszStrList, const char *pszName);
00156 char CPL_DLL **
00157 CSLFetchNameValueMultiple(char **papszStrList, const char *pszName);
00158 char CPL_DLL **
00159 CSLAddNameValue(char **papszStrList,
00160 const char *pszName, const char *pszValue);
00161 char CPL_DLL **
00162 CSLSetNameValue(char **papszStrList,
00163 const char *pszName, const char *pszValue);
00164 void CPL_DLL CSLSetNameValueSeparator( char ** papszStrList,
00165 const char *pszSeparator );
00166
00167 #define CPLES_BackslashQuotable 0
00168 #define CPLES_XML 1
00169 #define CPLES_URL 2
00170 #define CPLES_SQL 3
00171 #define CPLES_CSV 4
00172
00173 char CPL_DLL *CPLEscapeString( const char *pszString, int nLength,
00174 int nScheme );
00175 char CPL_DLL *CPLUnescapeString( const char *pszString, int *pnLength,
00176 int nScheme );
00177
00178 CPL_C_END
00179
00180 #endif