SDTS_AL
cpl_string.h
Go to the documentation of this file.
1 /**********************************************************************
2  * $Id: cpl_string.h 38064 2017-04-19 08:58:09Z rouault $
3  *
4  * Name: cpl_string.h
5  * Project: CPL - Common Portability Library
6  * Purpose: String and StringList functions.
7  * Author: Daniel Morissette, dmorissette@mapgears.com
8  *
9  **********************************************************************
10  * Copyright (c) 1998, Daniel Morissette
11  * Copyright (c) 2008-2014, Even Rouault <even dot rouault at mines-paris dot org>
12  *
13  * Permission is hereby granted, free of charge, to any person obtaining a
14  * copy of this software and associated documentation files (the "Software"),
15  * to deal in the Software without restriction, including without limitation
16  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
17  * and/or sell copies of the Software, and to permit persons to whom the
18  * Software is furnished to do so, subject to the following conditions:
19  *
20  * The above copyright notice and this permission notice shall be included
21  * in all copies or substantial portions of the Software.
22  *
23  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29  * DEALINGS IN THE SOFTWARE.
30  ****************************************************************************/
31 
32 #ifndef CPL_STRING_H_INCLUDED
33 #define CPL_STRING_H_INCLUDED
34 
35 #include "cpl_error.h"
36 #include "cpl_conv.h"
37 #include "cpl_vsi.h"
38 
61 CPL_C_START
62 
63 char CPL_DLL **CSLAddString(char **papszStrList,
64  const char *pszNewString) CPL_WARN_UNUSED_RESULT;
65 char CPL_DLL **CSLAddStringMayFail(
66  char **papszStrList, const char *pszNewString) CPL_WARN_UNUSED_RESULT;
67 #ifdef __cplusplus
68  int CPL_DLL CSLCount(const char * const *papszStrList);
69 #else
70  int CPL_DLL CSLCount(char **papszStrList);
71 #endif
72 const char CPL_DLL *CSLGetField( char **, int );
73 void CPL_DLL CPL_STDCALL CSLDestroy(char **papszStrList);
74 char CPL_DLL **CSLDuplicate(char **papszStrList) CPL_WARN_UNUSED_RESULT;
75 char CPL_DLL **CSLMerge( char **papszOrig,
76  char **papszOverride ) CPL_WARN_UNUSED_RESULT;
77 
78 char CPL_DLL **CSLTokenizeString(const char *pszString ) CPL_WARN_UNUSED_RESULT;
79 char CPL_DLL **CSLTokenizeStringComplex(
80  const char *pszString, const char *pszDelimiter, int bHonourStrings,
81  int bAllowEmptyTokens ) CPL_WARN_UNUSED_RESULT;
82 char CPL_DLL **CSLTokenizeString2( const char *pszString,
83  const char *pszDelimiter,
84  int nCSLTFlags ) CPL_WARN_UNUSED_RESULT;
85 
87 #define CSLT_HONOURSTRINGS 0x0001
88 
89 #define CSLT_ALLOWEMPTYTOKENS 0x0002
90 
91 #define CSLT_PRESERVEQUOTES 0x0004
92 
93 #define CSLT_PRESERVEESCAPES 0x0008
94 
95 #define CSLT_STRIPLEADSPACES 0x0010
96 
97 #define CSLT_STRIPENDSPACES 0x0020
98 
99 int CPL_DLL CSLPrint(char **papszStrList, FILE *fpOut);
100 char CPL_DLL **CSLLoad(const char *pszFname) CPL_WARN_UNUSED_RESULT;
101 #ifdef __cplusplus
102 char CPL_DLL **CSLLoad2(
103  const char *pszFname, int nMaxLines, int nMaxCols,
104  const char * const * papszOptions) CPL_WARN_UNUSED_RESULT;
105 #else
106 char CPL_DLL **CSLLoad2(
107  const char *pszFname, int nMaxLines, int nMaxCols,
108  char **papszOptions) CPL_WARN_UNUSED_RESULT;
109 #endif
110 int CPL_DLL CSLSave(char **papszStrList, const char *pszFname);
111 
112 char CPL_DLL **CSLInsertStrings(char **papszStrList, int nInsertAtLineNo,
113  char **papszNewLines) CPL_WARN_UNUSED_RESULT;
114 char CPL_DLL **CSLInsertString(char **papszStrList, int nInsertAtLineNo,
115  const char *pszNewLine) CPL_WARN_UNUSED_RESULT;
116 char CPL_DLL **CSLRemoveStrings(
117  char **papszStrList, int nFirstLineToDelete,
118  int nNumToRemove, char ***ppapszRetStrings) CPL_WARN_UNUSED_RESULT;
119 #ifdef __cplusplus
120 int CPL_DLL CSLFindString( const char * const *papszList,
121  const char *pszTarget );
122 int CPL_DLL CSLFindStringCaseSensitive( const char * const *papszList,
123  const char *pszTarget );
124 int CPL_DLL CSLPartialFindString( const char * const *papszHaystack,
125  const char *pszNeedle );
126 #else
127 // Present non-const to C code that does not like passing non-const to const.
128 // Should be ABI compatible with the const versions.
129 int CPL_DLL CSLFindString( char **papszList, const char *pszTarget );
130 int CPL_DLL CSLFindStringCaseSensitive( char * const *papszList,
131  const char *pszTarget );
132 int CPL_DLL CSLPartialFindString( char * const *papszHaystack,
133  const char *pszNeedle );
134 #endif
135 int CPL_DLL CSLFindName(char **papszStrList, const char *pszName);
136 int CPL_DLL CSLFetchBoolean( char **papszStrList, const char *pszKey,
137  int bDefault );
138 
139 /* TODO: Deprecate CSLTestBoolean. Remove in GDAL 3.x. */
140 int CPL_DLL CSLTestBoolean( const char *pszValue );
141 /* Do not use CPLTestBoolean in C++ code. Use CPLTestBool. */
142 int CPL_DLL CPLTestBoolean( const char *pszValue );
143 
144 #ifdef __cplusplus
145 #ifdef DO_NOT_USE_DEBUG_BOOL
146 #define CPLTestBool(x) CPL_TO_BOOL(CPLTestBoolean(x))
147 #define CPLFetchBool(list,key,default) \
148  CPL_TO_BOOL(CSLFetchBoolean(list,key,default))
149 #else /* DO_NOT_USE_DEBUG_BOOL */
150 /* Prefer these for C++ code. */
151 #ifdef DEBUG_BOOL
152 extern "C++" {
153 #endif
154 bool CPL_DLL CPLTestBool( const char *pszValue );
155 bool CPL_DLL CPLFetchBool( const char * const *papszStrList, const char *pszKey,
156  bool bDefault );
157 #ifdef DEBUG_BOOL
158 }
159 #endif
160 #endif
161 #endif /* __cplusplus */
162 
163 const char CPL_DLL *
164  CPLParseNameValue( const char *pszNameValue, char **ppszKey );
165 
166 #ifdef __cplusplus
167 const char CPL_DLL *
168  CSLFetchNameValue( const char * const *papszStrList, const char *pszName);
169 const char CPL_DLL *
170  CSLFetchNameValueDef( const char * const *papszStrList,
171  const char *pszName,
172  const char *pszDefault );
173 #else
174 const char CPL_DLL *
175  CSLFetchNameValue( char **papszStrList, const char *pszName);
176 const char CPL_DLL *
177  CSLFetchNameValueDef( char **papszStrList,
178  const char *pszName,
179  const char *pszDefault );
180 #endif
181 
182 char CPL_DLL **
183  CSLFetchNameValueMultiple(char **papszStrList, const char *pszName);
184 char CPL_DLL **
185  CSLAddNameValue(char **papszStrList,
186  const char *pszName,
187  const char *pszValue) CPL_WARN_UNUSED_RESULT;
188 char CPL_DLL **
189  CSLSetNameValue(char **papszStrList,
190  const char *pszName,
191  const char *pszValue) CPL_WARN_UNUSED_RESULT;
192 void CPL_DLL CSLSetNameValueSeparator( char ** papszStrList,
193  const char *pszSeparator );
194 
195 char CPL_DLL ** CSLParseCommandLine(const char* pszCommandLine);
196 
198 #define CPLES_BackslashQuotable 0
199 
200 #define CPLES_XML 1
201 
202 #define CPLES_URL 2
203 
204 #define CPLES_SQL 3
205 
206 #define CPLES_CSV 4
207 
208 #define CPLES_XML_BUT_QUOTES 5
209 
210 char CPL_DLL *CPLEscapeString( const char *pszString, int nLength,
211  int nScheme ) CPL_WARN_UNUSED_RESULT;
212 char CPL_DLL *CPLUnescapeString( const char *pszString, int *pnLength,
213  int nScheme ) CPL_WARN_UNUSED_RESULT;
214 
215 char CPL_DLL *CPLBinaryToHex( int nBytes,
216  const GByte *pabyData ) CPL_WARN_UNUSED_RESULT;
217 GByte CPL_DLL *CPLHexToBinary( const char *pszHex,
218  int *pnBytes ) CPL_WARN_UNUSED_RESULT;
219 
220 char CPL_DLL *CPLBase64Encode( int nBytes,
221  const GByte *pabyData ) CPL_WARN_UNUSED_RESULT;
222 int CPL_DLL CPLBase64DecodeInPlace( GByte* pszBase64 );
223 
225 typedef enum
226 {
230 } CPLValueType;
231 
232 CPLValueType CPL_DLL CPLGetValueType(const char* pszValue);
233 
234 size_t CPL_DLL CPLStrlcpy(char* pszDest, const char* pszSrc, size_t nDestSize);
235 size_t CPL_DLL CPLStrlcat(char* pszDest, const char* pszSrc, size_t nDestSize);
236 size_t CPL_DLL CPLStrnlen(const char *pszStr, size_t nMaxLen);
237 
238 /* -------------------------------------------------------------------- */
239 /* Locale independent formatting functions. */
240 /* -------------------------------------------------------------------- */
241 int CPL_DLL CPLvsnprintf( char *str, size_t size,
242  CPL_FORMAT_STRING(const char* fmt),
243  va_list args )
244  CPL_PRINT_FUNC_FORMAT(3, 0 );
245 
246 /* ALIAS_CPLSNPRINTF_AS_SNPRINTF might be defined to enable GCC 7 */
247 /* -Wformat-truncation= warnings, but shouldn't be set for normal use */
248 #if defined(ALIAS_CPLSNPRINTF_AS_SNPRINTF)
249 #define CPLsnprintf snprintf
250 #else
251 int CPL_DLL CPLsnprintf( char *str, size_t size,
252  CPL_FORMAT_STRING(const char* fmt), ... )
253  CPL_PRINT_FUNC_FORMAT(3, 4);
254 #endif
255 
257 #if defined(GDAL_COMPILATION) && !defined(DONT_DEPRECATE_SPRINTF)
258 int CPL_DLL CPLsprintf( char *str, CPL_FORMAT_STRING(const char* fmt), ... )
260  CPL_WARN_DEPRECATED("Use CPLsnprintf instead");
261 #else
262 int CPL_DLL CPLsprintf( char *str, CPL_FORMAT_STRING(const char* fmt), ... )
263  CPL_PRINT_FUNC_FORMAT(2, 3);
264 #endif
265 
266 int CPL_DLL CPLprintf( CPL_FORMAT_STRING(const char* fmt), ... )
267  CPL_PRINT_FUNC_FORMAT(1, 2);
268 
269 /* For some reason Doxygen_Suppress is needed to avoid warning. Not sure why */
271 /* caution: only works with limited number of formats */
272 int CPL_DLL CPLsscanf( const char* str,
273  CPL_SCANF_FORMAT_STRING(const char* fmt), ... )
274  CPL_SCAN_FUNC_FORMAT(2, 3);
277 const char CPL_DLL *CPLSPrintf( CPL_FORMAT_STRING(const char *fmt), ... )
279 char CPL_DLL **CSLAppendPrintf( char **papszStrList,
280  CPL_FORMAT_STRING(const char *fmt), ... )
282 int CPL_DLL CPLVASPrintf( char **buf,
283  CPL_FORMAT_STRING(const char *fmt), va_list args )
284  CPL_PRINT_FUNC_FORMAT(2, 0);
285 
286 /* -------------------------------------------------------------------- */
287 /* RFC 23 character set conversion/recoding API (cpl_recode.cpp). */
288 /* -------------------------------------------------------------------- */
290 #define CPL_ENC_LOCALE ""
291 
292 #define CPL_ENC_UTF8 "UTF-8"
293 
294 #define CPL_ENC_UTF16 "UTF-16"
295 
296 #define CPL_ENC_UCS2 "UCS-2"
297 
298 #define CPL_ENC_UCS4 "UCS-4"
299 
300 #define CPL_ENC_ASCII "ASCII"
301 
302 #define CPL_ENC_ISO8859_1 "ISO-8859-1"
303 
304 int CPL_DLL CPLEncodingCharSize( const char *pszEncoding );
306 void CPL_DLL CPLClearRecodeWarningFlags( void );
308 char CPL_DLL *CPLRecode(
309  const char *pszSource, const char *pszSrcEncoding,
310  const char *pszDstEncoding ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
311 char CPL_DLL *CPLRecodeFromWChar(
312  const wchar_t *pwszSource, const char *pszSrcEncoding,
313  const char *pszDstEncoding ) CPL_WARN_UNUSED_RESULT;
314 wchar_t CPL_DLL *CPLRecodeToWChar(
315  const char *pszSource, const char *pszSrcEncoding,
316  const char *pszDstEncoding ) CPL_WARN_UNUSED_RESULT;
317 int CPL_DLL CPLIsUTF8( const char* pabyData, int nLen );
318 char CPL_DLL *CPLForceToASCII(
319  const char* pabyData, int nLen,
320  char chReplacementChar ) CPL_WARN_UNUSED_RESULT;
321 int CPL_DLL CPLStrlenUTF8( const char *pszUTF8Str );
322 
323 CPL_C_END
324 
325 /************************************************************************/
326 /* CPLString */
327 /************************************************************************/
328 
329 #if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
330 
331 extern "C++"
332 {
333 #ifndef DOXYGEN_SKIP
334 #include <string>
335 #endif
336 
338 class CPL_DLL CPLString : public std::string
339 {
340 public:
341 
343  CPLString(void) {}
345  // cppcheck-suppress noExplicitConstructor
346  CPLString( const std::string &oStr ) : std::string( oStr ) {}
348  // cppcheck-suppress noExplicitConstructor
349  CPLString( const char *pszStr ) : std::string( pszStr ) {}
351  CPLString( const char *pszStr, size_t n ) : std::string( pszStr, n ) {}
352 
354  operator const char* (void) const { return c_str(); }
355 
357  char& operator[](std::string::size_type i)
358  {
359  return std::string::operator[](i);
360  }
361 
363  const char& operator[](std::string::size_type i) const
364  {
365  return std::string::operator[](i);
366  }
367 
369  char& operator[](int i)
370  {
371  return std::string::operator[](
372  static_cast<std::string::size_type>(i));
373  }
374 
376  const char& operator[](int i) const
377  {
378  return std::string::operator[](
379  static_cast<std::string::size_type>(i));
380  }
381 
382  // Note: This is standard in C++11.
383 #ifndef HAVE_CXX11
384 
385  const char& back() const { return operator[](size()-1); }
387  char& back() { return operator[](size()-1); }
388 #endif
389 
391  void Clear() { resize(0); }
392 
396  void Seize( char *pszValue )
397  {
398  if (pszValue == NULL )
399  Clear();
400  else
401  {
402  *this = pszValue;
403  CPLFree(pszValue);
404  }
405  }
406 
407  /* There seems to be a bug in the way the compiler count indices...
408  * Should be CPL_PRINT_FUNC_FORMAT (1, 2) */
409  CPLString &Printf(
410  CPL_FORMAT_STRING(const char *pszFormat), ... )
411  CPL_PRINT_FUNC_FORMAT (2, 3);
412  CPLString &vPrintf(
413  CPL_FORMAT_STRING(const char *pszFormat), va_list args )
414  CPL_PRINT_FUNC_FORMAT(2, 0);
415  CPLString &FormatC( double dfValue, const char *pszFormat = NULL );
416  CPLString &Trim();
417  CPLString &Recode( const char *pszSrcEncoding, const char *pszDstEncoding );
418  CPLString &replaceAll(
419  const std::string &osBefore, const std::string& osAfter );
420  CPLString &replaceAll( const std::string &osBefore, char chAfter );
421  CPLString &replaceAll( char chBefore, const std::string &osAfter );
422  CPLString &replaceAll( char chBefore, char chAfter );
423 
424  /* case insensitive find alternates */
425  size_t ifind( const std::string & str, size_t pos = 0 ) const;
426  size_t ifind( const char * s, size_t pos = 0 ) const;
427  CPLString &toupper( void );
428  CPLString &tolower( void );
429 };
430 
431 CPLString CPL_DLL CPLOPrintf(CPL_FORMAT_STRING(const char *pszFormat), ... )
432  CPL_PRINT_FUNC_FORMAT (1, 2);
433 CPLString CPL_DLL CPLOvPrintf(
434  CPL_FORMAT_STRING(const char *pszFormat), va_list args)
435  CPL_PRINT_FUNC_FORMAT (1, 0);
436 
437 /* -------------------------------------------------------------------- */
438 /* URL processing functions, here since they depend on CPLString. */
439 /* -------------------------------------------------------------------- */
440 CPLString CPL_DLL CPLURLGetValue(const char* pszURL, const char* pszKey);
441 CPLString CPL_DLL CPLURLAddKVP(const char* pszURL, const char* pszKey,
442  const char* pszValue);
443 
444 /************************************************************************/
445 /* CPLStringList */
446 /************************************************************************/
447 
449 class CPL_DLL CPLStringList
450 {
451  char **papszList;
452  mutable int nCount;
453  mutable int nAllocation;
454  bool bOwnList;
455  bool bIsSorted;
456 
457  void Initialize();
458  void MakeOurOwnCopy();
459  void EnsureAllocation( int nMaxLength );
460  int FindSortedInsertionPoint( const char *pszLine );
461 
462  public:
463  CPLStringList();
464  CPLStringList( char **papszList, int bTakeOwnership=TRUE );
465  CPLStringList( const CPLStringList& oOther );
466  ~CPLStringList();
467 
468  CPLStringList &Clear();
469 
471  int size() const { return Count(); }
472  int Count() const;
473 
475  bool empty() const { return Count() == 0; }
476 
477  CPLStringList &AddString( const char *pszNewString );
478  CPLStringList &AddStringDirectly( char *pszNewString );
479 
480  CPLStringList &InsertString( int nInsertAtLineNo, const char *pszNewLine )
481  { return InsertStringDirectly( nInsertAtLineNo, CPLStrdup(pszNewLine) ); }
482  CPLStringList &InsertStringDirectly( int nInsertAtLineNo, char *pszNewLine);
483 
484  // CPLStringList &InsertStrings( int nInsertAtLineNo, char **papszNewLines );
485  // CPLStringList &RemoveStrings( int nFirstLineToDelete, int nNumToRemove=1 );
486 
488  int FindString( const char *pszTarget ) const
489  { return CSLFindString( papszList, pszTarget ); }
491  int PartialFindString( const char *pszNeedle ) const
492  { return CSLPartialFindString( papszList, pszNeedle ); }
493 
494  int FindName( const char *pszName ) const;
495  bool FetchBool( const char *pszKey, bool bDefault ) const;
496  // Deprecated.
497  int FetchBoolean( const char *pszKey, int bDefault ) const;
498  const char *FetchNameValue( const char *pszKey ) const;
499  const char *FetchNameValueDef(
500  const char *pszKey, const char *pszDefault ) const;
501  CPLStringList &AddNameValue( const char *pszKey, const char *pszValue );
502  CPLStringList &SetNameValue( const char *pszKey, const char *pszValue );
503 
504  CPLStringList &Assign( char **papszListIn, int bTakeOwnership=TRUE );
506  CPLStringList &operator=(char **papszListIn) {
507  return Assign( papszListIn, TRUE ); }
509  CPLStringList &operator=(const CPLStringList& oOther);
510 
512  char * operator[](int i);
514  char * operator[](size_t i) { return (*this)[static_cast<int>(i)]; }
516  const char * operator[](int i) const;
518  const char * operator[](size_t i) const {
519  return (*this)[static_cast<int>(i)]; }
520 
522  char **List() { return papszList; }
523  char **StealList();
524 
525  CPLStringList &Sort();
527  int IsSorted() const { return bIsSorted; }
528 
530  operator char**(void) { return List(); }
531 };
532 
533 } // extern "C++"
534 
535 #endif /* def __cplusplus && !CPL_SUPRESS_CPLUSPLUS */
536 
537 #endif /* CPL_STRING_H_INCLUDED */
char CPL_DLL * CPLBase64Encode(int nBytes, const GByte *pabyData) CPL_WARN_UNUSED_RESULT
Definition: cpl_base64.cpp:199
char CPL_DLL * CPLRecode(const char *pszSource, const char *pszSrcEncoding, const char *pszDstEncoding) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_recode.cpp:81
size_t CPL_DLL CPLStrnlen(const char *pszStr, size_t nMaxLen)
Definition: cpl_string.cpp:2765
char CPL_DLL ** CSLInsertString(char **papszStrList, int nInsertAtLineNo, const char *pszNewLine) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:560
int CPL_DLL CPLTestBoolean(const char *pszValue)
Definition: cpl_string.cpp:1571
int CPL_DLL CPLStrlenUTF8(const char *pszUTF8Str)
Definition: cpl_recode.cpp:363
int CPL_DLL CPLIsUTF8(const char *pabyData, int nLen)
Definition: cpl_recode.cpp:251
char CPL_DLL ** CSLSetNameValue(char **papszStrList, const char *pszName, const char *pszValue) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:1873
CPLValueType CPL_DLL CPLGetValueType(const char *pszValue)
Definition: cpl_string.cpp:2541
char CPL_DLL * CPLStrdup(const char *) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_conv.cpp:284
int CPL_DLL CSLFetchBoolean(char **papszStrList, const char *pszKey, int bDefault)
Definition: cpl_string.cpp:1631
wchar_t CPL_DLL * CPLRecodeToWChar(const char *pszSource, const char *pszSrcEncoding, const char *pszDstEncoding) CPL_WARN_UNUSED_RESULT
Definition: cpl_recode.cpp:208
CPLValueType
Definition: cpl_string.h:225
char CPL_DLL ** CSLTokenizeStringComplex(const char *pszString, const char *pszDelimiter, int bHonourStrings, int bAllowEmptyTokens) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:767
Definition: cpl_string.h:228
unsigned char GByte
Definition: cpl_port.h:207
char CPL_DLL ** CSLDuplicate(char **papszStrList) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:228
char CPL_DLL * CPLEscapeString(const char *pszString, int nLength, int nScheme) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:2018
char CPL_DLL ** CSLFetchNameValueMultiple(char **papszStrList, const char *pszName)
Definition: cpl_string.cpp:1797
CPL_C_START char CPL_DLL ** CSLAddString(char **papszStrList, const char *pszNewString) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:83
#define CPL_PRINT_FUNC_FORMAT(format_idx, arg_idx)
Definition: cpl_port.h:967
int CPL_DLL CPLEncodingCharSize(const char *pszEncoding)
Definition: cpl_recode.cpp:318
char CPL_DLL * CPLUnescapeString(const char *pszString, int *pnLength, int nScheme) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:2227
char CPL_DLL ** CSLParseCommandLine(const char *pszCommandLine)
Definition: cpl_string.cpp:2789
void CPL_DLL CPL_STDCALL CSLDestroy(char **papszStrList)
Definition: cpl_string.cpp:200
size_t CPL_DLL CPLStrlcpy(char *pszDest, const char *pszSrc, size_t nDestSize)
Definition: cpl_string.cpp:2673
size_t CPL_DLL CPLStrlcat(char *pszDest, const char *pszSrc, size_t nDestSize)
Definition: cpl_string.cpp:2730
char CPL_DLL ** CSLMerge(char **papszOrig, char **papszOverride) CPL_WARN_UNUSED_RESULT
Merge two lists.
Definition: cpl_string.cpp:268
int CPL_DLL CSLTestBoolean(const char *pszValue)
Definition: cpl_string.cpp:1549
int CPL_DLL CPLBase64DecodeInPlace(GByte *pszBase64)
Definition: cpl_base64.cpp:93
char CPL_DLL ** CSLTokenizeString(const char *pszString) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:757
GByte CPL_DLL * CPLHexToBinary(const char *pszHex, int *pnBytes) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:2502
#define CPLFree
Definition: cpl_conv.h:81
char CPL_DLL * CPLForceToASCII(const char *pabyData, int nLen, char chReplacementChar) CPL_WARN_UNUSED_RESULT
Definition: cpl_recode.cpp:276
char CPL_DLL ** CSLLoad(const char *pszFname) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:397
#define CPL_FORMAT_STRING(arg)
Definition: cpl_port.h:989
#define CPL_WARN_UNUSED_RESULT
Definition: cpl_port.h:999
Definition: cpl_string.h:227
#define CPL_RETURNS_NONNULL
Definition: cpl_port.h:1032
#define CPL_SCANF_FORMAT_STRING(arg)
Definition: cpl_port.h:991
const char CPL_DLL * CPLParseNameValue(const char *pszNameValue, char **ppszKey)
Definition: cpl_string.cpp:1750
char CPL_DLL ** CSLAddStringMayFail(char **papszStrList, const char *pszNewString) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:92
char CPL_DLL ** CSLTokenizeString2(const char *pszString, const char *pszDelimiter, int nCSLTFlags) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:834
char CPL_DLL ** CSLRemoveStrings(char **papszStrList, int nFirstLineToDelete, int nNumToRemove, char ***ppapszRetStrings) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:586
int CPL_DLL CSLPrint(char **papszStrList, FILE *fpOut)
Definition: cpl_string.cpp:461
int CPL_DLL CSLSave(char **papszStrList, const char *pszFname)
Definition: cpl_string.cpp:412
const char CPL_DLL * CSLGetField(char **, int)
Definition: cpl_string.cpp:173
#define CPL_SCAN_FUNC_FORMAT(format_idx, arg_idx)
Definition: cpl_port.h:969
char CPL_DLL * CPLBinaryToHex(int nBytes, const GByte *pabyData) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:2444
int CPL_DLL CSLFindName(char **papszStrList, const char *pszName)
Definition: cpl_string.cpp:1704
char CPL_DLL ** CSLInsertStrings(char **papszStrList, int nInsertAtLineNo, char **papszNewLines) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:497
void CPL_DLL CSLSetNameValueSeparator(char **papszStrList, const char *pszSeparator)
Definition: cpl_string.cpp:1946
char CPL_DLL * CPLRecodeFromWChar(const wchar_t *pwszSource, const char *pszSrcEncoding, const char *pszDstEncoding) CPL_WARN_UNUSED_RESULT
Definition: cpl_recode.cpp:149
Definition: cpl_string.h:229
char CPL_DLL ** CSLAddNameValue(char **papszStrList, const char *pszName, const char *pszValue) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:1834