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 #ifndef _CPL_STRING_H_INCLUDED
00086 #define _CPL_STRING_H_INCLUDED
00087
00088 #include "cpl_vsi.h"
00089 #include "cpl_error.h"
00090 #include "cpl_conv.h"
00091
00110 CPL_C_START
00111
00112 char CPL_DLL **CSLAddString(char **papszStrList, const char *pszNewString);
00113 int CPL_DLL CSLCount(char **papszStrList);
00114 const char CPL_DLL *CSLGetField( char **, int );
00115 void CPL_DLL CSLDestroy(char **papszStrList);
00116 char CPL_DLL **CSLDuplicate(char **papszStrList);
00117
00118 char CPL_DLL **CSLTokenizeString(const char *pszString );
00119 char CPL_DLL **CSLTokenizeStringComplex(const char *pszString,
00120 const char *pszDelimiter,
00121 int bHonourStrings, int bAllowEmptyTokens );
00122 char CPL_DLL **CSLTokenizeString2( const char *pszString,
00123 const char *pszDelimeter,
00124 int nCSLTFlags );
00125
00126 #define CSLT_HONOURSTRINGS 0x0001
00127 #define CSLT_ALLOWEMPTYTOKENS 0x0002
00128 #define CSLT_PRESERVEQUOTES 0x0004
00129 #define CSLT_PRESERVEESCAPES 0x0008
00130
00131 int CPL_DLL CSLPrint(char **papszStrList, FILE *fpOut);
00132 char CPL_DLL **CSLLoad(const char *pszFname);
00133 int CPL_DLL CSLSave(char **papszStrList, const char *pszFname);
00134
00135 char CPL_DLL **CSLInsertStrings(char **papszStrList, int nInsertAtLineNo,
00136 char **papszNewLines);
00137 char CPL_DLL **CSLInsertString(char **papszStrList, int nInsertAtLineNo,
00138 char *pszNewLine);
00139 char CPL_DLL **CSLRemoveStrings(char **papszStrList, int nFirstLineToDelete,
00140 int nNumToRemove, char ***ppapszRetStrings);
00141 int CPL_DLL CSLFindString( char **, const char * );
00142 int CPL_DLL CSLTestBoolean( const char *pszValue );
00143 int CPL_DLL CSLFetchBoolean( char **papszStrList, const char *pszKey,
00144 int bDefault );
00145
00146 const char CPL_DLL *CPLSPrintf(char *fmt, ...);
00147 char CPL_DLL **CSLAppendPrintf(char **papszStrList, char *fmt, ...);
00148
00149 const char CPL_DLL *
00150 CPLParseNameValue(const char *pszNameValue, char **ppszKey );
00151 const char CPL_DLL *
00152 CSLFetchNameValue(char **papszStrList, const char *pszName);
00153 char CPL_DLL **
00154 CSLFetchNameValueMultiple(char **papszStrList, const char *pszName);
00155 char CPL_DLL **
00156 CSLAddNameValue(char **papszStrList,
00157 const char *pszName, const char *pszValue);
00158 char CPL_DLL **
00159 CSLSetNameValue(char **papszStrList,
00160 const char *pszName, const char *pszValue);
00161 void CPL_DLL CSLSetNameValueSeparator( char ** papszStrList,
00162 const char *pszSeparator );
00163
00164 #define CPLES_BackslashQuotable 0
00165 #define CPLES_XML 1
00166 #define CPLES_URL 2
00167 #define CPLES_SQL 3
00168 #define CPLES_CSV 4
00169
00170 char CPL_DLL *CPLEscapeString( const char *pszString, int nLength,
00171 int nScheme );
00172 char CPL_DLL *CPLUnescapeString( const char *pszString, int *pnLength,
00173 int nScheme );
00174
00175 CPL_C_END
00176
00177 #endif