SDTS_AL
cpl_string.h
Go to the documentation of this file.
1/**********************************************************************
2 * $Id$
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
61CPL_C_START
62
63char CPL_DLL **CSLAddString(char **papszStrList,
64 const char *pszNewString) CPL_WARN_UNUSED_RESULT;
65char CPL_DLL **CSLAddStringMayFail(
66 char **papszStrList, const char *pszNewString) CPL_WARN_UNUSED_RESULT;
67int CPL_DLL CSLCount(CSLConstList papszStrList);
68const char CPL_DLL *CSLGetField( CSLConstList, int );
69void CPL_DLL CPL_STDCALL CSLDestroy(char **papszStrList);
70char CPL_DLL **CSLDuplicate(CSLConstList papszStrList) CPL_WARN_UNUSED_RESULT;
71char CPL_DLL **CSLMerge( char **papszOrig,
73
74char CPL_DLL **CSLTokenizeString(const char *pszString ) CPL_WARN_UNUSED_RESULT;
75char CPL_DLL **CSLTokenizeStringComplex(
76 const char *pszString, const char *pszDelimiter, int bHonourStrings,
77 int bAllowEmptyTokens ) CPL_WARN_UNUSED_RESULT;
78char CPL_DLL **CSLTokenizeString2( const char *pszString,
79 const char *pszDelimiter,
80 int nCSLTFlags ) CPL_WARN_UNUSED_RESULT;
81
83#define CSLT_HONOURSTRINGS 0x0001
85#define CSLT_ALLOWEMPTYTOKENS 0x0002
87#define CSLT_PRESERVEQUOTES 0x0004
89#define CSLT_PRESERVEESCAPES 0x0008
91#define CSLT_STRIPLEADSPACES 0x0010
93#define CSLT_STRIPENDSPACES 0x0020
94
95int CPL_DLL CSLPrint(CSLConstList papszStrList, FILE *fpOut);
96char CPL_DLL **CSLLoad(const char *pszFname) CPL_WARN_UNUSED_RESULT;
97char CPL_DLL **CSLLoad2(
98 const char *pszFname, int nMaxLines, int nMaxCols,
100int CPL_DLL CSLSave(CSLConstList papszStrList, const char *pszFname);
101
102char CPL_DLL **CSLInsertStrings(char **papszStrList, int nInsertAtLineNo,
104char CPL_DLL **CSLInsertString(char **papszStrList, int nInsertAtLineNo,
105 const char *pszNewLine) CPL_WARN_UNUSED_RESULT;
106char CPL_DLL **CSLRemoveStrings(
107 char **papszStrList, int nFirstLineToDelete,
108 int nNumToRemove, char ***ppapszRetStrings) CPL_WARN_UNUSED_RESULT;
109int CPL_DLL CSLFindString( CSLConstList papszList, const char *pszTarget );
110int CPL_DLL CSLFindStringCaseSensitive( CSLConstList papszList,
111 const char *pszTarget );
112int CPL_DLL CSLPartialFindString( CSLConstList papszHaystack,
113 const char *pszNeedle );
114int CPL_DLL CSLFindName(CSLConstList papszStrList, const char *pszName);
115int CPL_DLL CSLFetchBoolean( CSLConstList papszStrList, const char *pszKey,
116 int bDefault );
117
118/* TODO: Deprecate CSLTestBoolean. Remove in GDAL 3.x. */
119int CPL_DLL CSLTestBoolean( const char *pszValue );
120/* Do not use CPLTestBoolean in C++ code. Use CPLTestBool. */
121int CPL_DLL CPLTestBoolean( const char *pszValue );
122
123#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
124#ifdef DO_NOT_USE_DEBUG_BOOL
125#define CPLTestBool(x) CPL_TO_BOOL(CPLTestBoolean(x))
126#define CPLFetchBool(list,key,default) \
127 CPL_TO_BOOL(CSLFetchBoolean(list,key,default))
128#else /* DO_NOT_USE_DEBUG_BOOL */
129/* Prefer these for C++ code. */
130#ifdef DEBUG_BOOL
131extern "C++" {
132#endif
133bool CPL_DLL CPLTestBool( const char *pszValue );
134bool CPL_DLL CPLFetchBool( CSLConstList papszStrList, const char *pszKey,
135 bool bDefault );
136#ifdef DEBUG_BOOL
137}
138#endif
139#endif
140#endif /* __cplusplus */
141
142const char CPL_DLL *
143 CPLParseNameValue( const char *pszNameValue, char **ppszKey );
144
145const char CPL_DLL *
146 CSLFetchNameValue( CSLConstList papszStrList, const char *pszName);
147const char CPL_DLL *
149 const char *pszName,
150 const char *pszDefault );
151char CPL_DLL **
152 CSLFetchNameValueMultiple(CSLConstList papszStrList, const char *pszName);
153char CPL_DLL **
154 CSLAddNameValue(char **papszStrList,
155 const char *pszName,
156 const char *pszValue) CPL_WARN_UNUSED_RESULT;
157char CPL_DLL **
158 CSLSetNameValue(char **papszStrList,
159 const char *pszName,
160 const char *pszValue) CPL_WARN_UNUSED_RESULT;
161void CPL_DLL CSLSetNameValueSeparator( char ** papszStrList,
162 const char *pszSeparator );
163
164char CPL_DLL ** CSLParseCommandLine(const char* pszCommandLine);
165
167#define CPLES_BackslashQuotable 0
169#define CPLES_XML 1
171#define CPLES_URL 2
173#define CPLES_SQL 3
175#define CPLES_CSV 4
177#define CPLES_XML_BUT_QUOTES 5
179#define CPLES_CSV_FORCE_QUOTING 6
180
181char CPL_DLL *CPLEscapeString( const char *pszString, int nLength,
182 int nScheme ) CPL_WARN_UNUSED_RESULT;
183char CPL_DLL *CPLUnescapeString( const char *pszString, int *pnLength,
184 int nScheme ) CPL_WARN_UNUSED_RESULT;
185
186char CPL_DLL *CPLBinaryToHex( int nBytes,
187 const GByte *pabyData ) CPL_WARN_UNUSED_RESULT;
188GByte CPL_DLL *CPLHexToBinary( const char *pszHex,
189 int *pnBytes ) CPL_WARN_UNUSED_RESULT;
190
191char CPL_DLL *CPLBase64Encode( int nBytes,
192 const GByte *pabyData ) CPL_WARN_UNUSED_RESULT;
193int CPL_DLL CPLBase64DecodeInPlace( GByte* pszBase64 ) CPL_WARN_UNUSED_RESULT;
194
196typedef enum
197{
202
203CPLValueType CPL_DLL CPLGetValueType(const char* pszValue);
204
205size_t CPL_DLL CPLStrlcpy(char* pszDest, const char* pszSrc, size_t nDestSize);
206size_t CPL_DLL CPLStrlcat(char* pszDest, const char* pszSrc, size_t nDestSize);
207size_t CPL_DLL CPLStrnlen(const char *pszStr, size_t nMaxLen);
208
209/* -------------------------------------------------------------------- */
210/* Locale independent formatting functions. */
211/* -------------------------------------------------------------------- */
212int CPL_DLL CPLvsnprintf( char *str, size_t size,
213 CPL_FORMAT_STRING(const char* fmt),
214 va_list args )
216
217/* ALIAS_CPLSNPRINTF_AS_SNPRINTF might be defined to enable GCC 7 */
218/* -Wformat-truncation= warnings, but shouldn't be set for normal use */
219#if defined(ALIAS_CPLSNPRINTF_AS_SNPRINTF)
220#define CPLsnprintf snprintf
221#else
222int CPL_DLL CPLsnprintf( char *str, size_t size,
223 CPL_FORMAT_STRING(const char* fmt), ... )
225#endif
226
228#if defined(GDAL_COMPILATION) && !defined(DONT_DEPRECATE_SPRINTF)
229int CPL_DLL CPLsprintf( char *str, CPL_FORMAT_STRING(const char* fmt), ... )
231 CPL_WARN_DEPRECATED("Use CPLsnprintf instead");
232#else
233int CPL_DLL CPLsprintf( char *str, CPL_FORMAT_STRING(const char* fmt), ... )
235#endif
237int CPL_DLL CPLprintf( CPL_FORMAT_STRING(const char* fmt), ... )
239
240/* For some reason Doxygen_Suppress is needed to avoid warning. Not sure why */
242/* caution: only works with limited number of formats */
243int CPL_DLL CPLsscanf( const char* str,
244 CPL_SCANF_FORMAT_STRING(const char* fmt), ... )
248const char CPL_DLL *CPLSPrintf( CPL_FORMAT_STRING(const char *fmt), ... )
250char CPL_DLL **CSLAppendPrintf( char **papszStrList,
251 CPL_FORMAT_STRING(const char *fmt), ... )
253int CPL_DLL CPLVASPrintf( char **buf,
254 CPL_FORMAT_STRING(const char *fmt), va_list args )
256
257/* -------------------------------------------------------------------- */
258/* RFC 23 character set conversion/recoding API (cpl_recode.cpp). */
259/* -------------------------------------------------------------------- */
261#define CPL_ENC_LOCALE ""
263#define CPL_ENC_UTF8 "UTF-8"
265#define CPL_ENC_UTF16 "UTF-16"
267#define CPL_ENC_UCS2 "UCS-2"
269#define CPL_ENC_UCS4 "UCS-4"
271#define CPL_ENC_ASCII "ASCII"
273#define CPL_ENC_ISO8859_1 "ISO-8859-1"
274
275int CPL_DLL CPLEncodingCharSize( const char *pszEncoding );
277void CPL_DLL CPLClearRecodeWarningFlags( void );
279char CPL_DLL *CPLRecode(
280 const char *pszSource, const char *pszSrcEncoding,
281 const char *pszDstEncoding ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
282char CPL_DLL *CPLRecodeFromWChar(
283 const wchar_t *pwszSource, const char *pszSrcEncoding,
284 const char *pszDstEncoding ) CPL_WARN_UNUSED_RESULT;
285wchar_t CPL_DLL *CPLRecodeToWChar(
286 const char *pszSource, const char *pszSrcEncoding,
287 const char *pszDstEncoding ) CPL_WARN_UNUSED_RESULT;
288int CPL_DLL CPLIsUTF8( const char* pabyData, int nLen );
289char CPL_DLL *CPLForceToASCII(
290 const char* pabyData, int nLen,
291 char chReplacementChar ) CPL_WARN_UNUSED_RESULT;
292int CPL_DLL CPLStrlenUTF8( const char *pszUTF8Str );
293CPL_C_END
294
295/************************************************************************/
296/* CPLString */
297/************************************************************************/
298
299#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
300
301extern "C++"
302{
303#ifndef DOXYGEN_SKIP
304#include <string>
305#endif
306
307// VC++ implicitly applies __declspec(dllexport) to template base
308// classes of classes marked with __declspec(dllexport).
309// Hence, VC++ would export symbols for the specialization of std::basic_string<char>,
310// since it is a base class of CPLString, which is marked with CPL_DLL.
311// As a result, if an application linked both gdal.dll and a static library that
312// (implicitly) instantiates std::string (almost all do!), then the linker would
313// emit an error concerning duplicate symbols for std::string.
314// The least intrusive solution is to turn CPLString into a template class
315// (that is not marked with CPL_DLL), make CPLString a typedef for a specialization
316// of that template class, and mark only the few non-inline member functions of
317// CPLStringT with CPL_DLL.
318#ifdef _MSC_VER
319
320# define CPLSTRING_DLL CPL_DLL
321
322template< class Dummy = void > class CPLStringT;
323typedef CPLStringT<> CPLString;
324
325template< class Dummy >
326class CPLStringT : public std::string
327
328#else
329
331# define CPLSTRING_DLL
332# define CPLStringT CPLString
336class CPL_DLL CPLString : public std::string
337
338#endif
339{
340public:
341
343 CPLStringT(void) {}
345 // cppcheck-suppress noExplicitConstructor
346 CPLStringT( const std::string &oStr ) : std::string( oStr ) {}
348 // cppcheck-suppress noExplicitConstructor
349 CPLStringT( const char *pszStr ) : std::string( pszStr ) {}
351 CPLStringT( 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
383 void Clear() { resize(0); }
384
388 void Seize( char *pszValue )
389 {
390 if (pszValue == nullptr )
391 Clear();
392 else
393 {
394 *this = pszValue;
395 CPLFree(pszValue);
396 }
397 }
398
399 /* There seems to be a bug in the way the compiler count indices...
400 * Should be CPL_PRINT_FUNC_FORMAT (1, 2) */
401 CPLSTRING_DLL CPLString &Printf(
402 CPL_FORMAT_STRING(const char *pszFormat), ... )
404 CPLSTRING_DLL CPLString &vPrintf(
405 CPL_FORMAT_STRING(const char *pszFormat), va_list args )
407 CPLSTRING_DLL CPLString &FormatC( double dfValue, const char *pszFormat = nullptr );
408 CPLSTRING_DLL CPLString &Trim();
409 CPLSTRING_DLL CPLString &Recode( const char *pszSrcEncoding, const char *pszDstEncoding );
410 CPLSTRING_DLL CPLString &replaceAll(
411 const std::string &osBefore, const std::string& osAfter );
412 CPLSTRING_DLL CPLString &replaceAll( const std::string &osBefore, char chAfter );
413 CPLSTRING_DLL CPLString &replaceAll( char chBefore, const std::string &osAfter );
414 CPLSTRING_DLL CPLString &replaceAll( char chBefore, char chAfter );
415
416 /* case insensitive find alternates */
417 CPLSTRING_DLL size_t ifind( const std::string & str, size_t pos = 0 ) const;
418 CPLSTRING_DLL size_t ifind( const char * s, size_t pos = 0 ) const;
419 CPLSTRING_DLL CPLString &toupper( void );
420 CPLSTRING_DLL CPLString &tolower( void );
421
422 CPLSTRING_DLL bool endsWith( const std::string& osStr ) const;
423};
424
425#ifndef _MSC_VER
426# undef CPLStringT
427#endif
428
429CPLString CPL_DLL CPLOPrintf(CPL_FORMAT_STRING(const char *pszFormat), ... )
431CPLString CPL_DLL CPLOvPrintf(
432 CPL_FORMAT_STRING(const char *pszFormat), va_list args)
434
435/* -------------------------------------------------------------------- */
436/* URL processing functions, here since they depend on CPLString. */
437/* -------------------------------------------------------------------- */
438CPLString CPL_DLL CPLURLGetValue(const char* pszURL, const char* pszKey);
439CPLString CPL_DLL CPLURLAddKVP(const char* pszURL, const char* pszKey,
440 const char* pszValue);
441
442/************************************************************************/
443/* CPLStringList */
444/************************************************************************/
445
447class CPL_DLL CPLStringList
448{
449 char **papszList;
450 mutable int nCount;
451 mutable int nAllocation;
452 bool bOwnList;
453 bool bIsSorted;
454
455 void Initialize();
456 void MakeOurOwnCopy();
457 void EnsureAllocation( int nMaxLength );
458 int FindSortedInsertionPoint( const char *pszLine );
459
460 public:
461 CPLStringList();
462 CPLStringList( char **papszList, int bTakeOwnership=TRUE );
463 // cppcheck-suppress noExplicitConstructor
464 CPLStringList( CSLConstList papszList );
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);
511 CPLStringList &operator=(CSLConstList papszListIn);
512
514 char * operator[](int i);
516 char * operator[](size_t i) { return (*this)[static_cast<int>(i)]; }
518 const char * operator[](int i) const;
520 const char * operator[](size_t i) const {
521 return (*this)[static_cast<int>(i)]; }
523 const char * operator[](const char* pszKey) const {
524 return FetchNameValue(pszKey); }
525
527 char** List() { return papszList; }
529 CSLConstList List() const { return papszList; }
530 char **StealList();
531
532 CPLStringList &Sort();
534 int IsSorted() const { return bIsSorted; }
535
537 operator char**(void) { return List(); }
539 operator CSLConstList(void) const { return List(); }
540};
541
542#ifdef GDAL_COMPILATION
543
544#include <memory>
545
547struct CSLDestroyReleaser
548{
549 void operator()(char** papszStr) const { CSLDestroy(papszStr); }
550};
554using CSLUniquePtr = std::unique_ptr< char*, CSLDestroyReleaser>;
555
556#endif
557
558} // extern "C++"
559
560#endif /* def __cplusplus && !CPL_SUPRESS_CPLUSPLUS */
561
562#endif /* CPL_STRING_H_INCLUDED */
#define CPLFree
Definition: cpl_conv.h:81
char CPL_DLL * CPLStrdup(const char *) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_conv.cpp:293
#define CPL_SCAN_FUNC_FORMAT(format_idx, arg_idx)
Definition: cpl_port.h:906
#define CPL_FORMAT_STRING(arg)
Definition: cpl_port.h:919
#define CPL_RETURNS_NONNULL
Definition: cpl_port.h:962
#define CPL_PRINT_FUNC_FORMAT(format_idx, arg_idx)
Definition: cpl_port.h:904
#define CPL_WARN_UNUSED_RESULT
Definition: cpl_port.h:929
char ** CSLConstList
Definition: cpl_port.h:1184
#define CPL_SCANF_FORMAT_STRING(arg)
Definition: cpl_port.h:921
unsigned char GByte
Definition: cpl_port.h:213
size_t CPL_DLL CPLStrlcat(char *pszDest, const char *pszSrc, size_t nDestSize)
Definition: cpl_string.cpp:2755
size_t CPL_DLL CPLStrnlen(const char *pszStr, size_t nMaxLen)
Definition: cpl_string.cpp:2790
int CPL_DLL CSLFetchBoolean(CSLConstList papszStrList, const char *pszKey, int bDefault)
Definition: cpl_string.cpp:1635
char CPL_DLL ** CSLParseCommandLine(const char *pszCommandLine)
Definition: cpl_string.cpp:2814
int CPL_DLL CPLIsUTF8(const char *pabyData, int nLen)
Definition: cpl_recode.cpp:251
char CPL_DLL * CPLUnescapeString(const char *pszString, int *pnLength, int nScheme) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:2243
size_t CPL_DLL CPLStrlcpy(char *pszDest, const char *pszSrc, size_t nDestSize)
Definition: cpl_string.cpp:2698
char CPL_DLL * CPLBinaryToHex(int nBytes, const GByte *pabyData) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:2469
char CPL_DLL ** CSLAddStringMayFail(char **papszStrList, const char *pszNewString) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:92
int CPL_DLL CSLFindStringCaseSensitive(CSLConstList papszList, const char *pszTarget)
Definition: cpl_string.cpp:704
char CPL_DLL * CPLEscapeString(const char *pszString, int nLength, int nScheme) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:2032
void CPL_DLL CSLSetNameValueSeparator(char **papszStrList, const char *pszSeparator)
Definition: cpl_string.cpp:1957
char CPL_DLL ** CSLTokenizeString(const char *pszString) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:759
GByte CPL_DLL * CPLHexToBinary(const char *pszHex, int *pnBytes) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:2527
int CPL_DLL CSLSave(CSLConstList papszStrList, const char *pszFname)
Definition: cpl_string.cpp:412
CPLValueType
Definition: cpl_string.h:197
@ CPL_VALUE_INTEGER
Definition: cpl_string.h:200
@ CPL_VALUE_STRING
Definition: cpl_string.h:198
@ CPL_VALUE_REAL
Definition: cpl_string.h:199
char CPL_DLL ** CSLLoad2(const char *pszFname, int nMaxLines, int nMaxCols, CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:316
char CPL_DLL ** CSLFetchNameValueMultiple(CSLConstList papszStrList, const char *pszName)
Definition: cpl_string.cpp:1801
const char CPL_DLL * CSLFetchNameValueDef(CSLConstList papszStrList, const char *pszName, const char *pszDefault)
Definition: cpl_string.cpp:1646
char CPL_DLL ** CSLMerge(char **papszOrig, CSLConstList papszOverride) CPL_WARN_UNUSED_RESULT
Merge two lists.
Definition: cpl_string.cpp:268
char CPL_DLL ** CSLTokenizeString2(const char *pszString, const char *pszDelimiter, int nCSLTFlags) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:836
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
const char CPL_DLL * CSLGetField(CSLConstList, int)
Definition: cpl_string.cpp:173
char CPL_DLL * CPLBase64Encode(int nBytes, const GByte *pabyData) CPL_WARN_UNUSED_RESULT
Definition: cpl_base64.cpp:199
char CPL_DLL ** CSLSetNameValue(char **papszStrList, const char *pszName, const char *pszValue) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:1877
const char CPL_DLL * CSLFetchNameValue(CSLConstList papszStrList, const char *pszName)
Definition: cpl_string.cpp:1674
char CPL_DLL ** CSLRemoveStrings(char **papszStrList, int nFirstLineToDelete, int nNumToRemove, char ***ppapszRetStrings) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:588
char CPL_DLL ** CSLAddNameValue(char **papszStrList, const char *pszName, const char *pszValue) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:1838
char CPL_DLL ** CSLLoad(const char *pszFname) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:397
int CPL_DLL CPLStrlenUTF8(const char *pszUTF8Str)
Definition: cpl_recode.cpp:363
char CPL_DLL * CPLRecodeFromWChar(const wchar_t *pwszSource, const char *pszSrcEncoding, const char *pszDstEncoding) CPL_WARN_UNUSED_RESULT
Definition: cpl_recode.cpp:149
int CPL_DLL CSLCount(CSLConstList papszStrList)
Definition: cpl_string.cpp:147
CPLValueType CPL_DLL CPLGetValueType(const char *pszValue)
Definition: cpl_string.cpp:2566
int CPL_DLL CSLFindName(CSLConstList papszStrList, const char *pszName)
Definition: cpl_string.cpp:1708
int CPL_DLL CSLPrint(CSLConstList papszStrList, FILE *fpOut)
Definition: cpl_string.cpp:461
char CPL_DLL ** CSLDuplicate(CSLConstList papszStrList) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:228
char CPL_DLL ** CSLInsertStrings(char **papszStrList, int nInsertAtLineNo, CSLConstList papszNewLines) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:497
void CPL_DLL CPL_STDCALL CSLDestroy(char **papszStrList)
Definition: cpl_string.cpp:200
wchar_t CPL_DLL * CPLRecodeToWChar(const char *pszSource, const char *pszSrcEncoding, const char *pszDstEncoding) CPL_WARN_UNUSED_RESULT
Definition: cpl_recode.cpp:208
int CPL_DLL CSLFindString(CSLConstList papszList, const char *pszTarget)
Definition: cpl_string.cpp:670
int CPL_DLL CSLPartialFindString(CSLConstList papszHaystack, const char *pszNeedle)
Definition: cpl_string.cpp:737
int CPL_DLL CPLBase64DecodeInPlace(GByte *pszBase64) CPL_WARN_UNUSED_RESULT
Definition: cpl_base64.cpp:93
CPL_C_START char CPL_DLL ** CSLAddString(char **papszStrList, const char *pszNewString) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:83
const char CPL_DLL * CPLParseNameValue(const char *pszNameValue, char **ppszKey)
Definition: cpl_string.cpp:1754
int CPL_DLL CPLTestBoolean(const char *pszValue)
Definition: cpl_string.cpp:1575
int CPL_DLL CPLEncodingCharSize(const char *pszEncoding)
Definition: cpl_recode.cpp:318
char CPL_DLL ** CSLTokenizeStringComplex(const char *pszString, const char *pszDelimiter, int bHonourStrings, int bAllowEmptyTokens) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:769
char CPL_DLL * CPLForceToASCII(const char *pabyData, int nLen, char chReplacementChar) CPL_WARN_UNUSED_RESULT
Definition: cpl_recode.cpp:276
char CPL_DLL ** CSLInsertString(char **papszStrList, int nInsertAtLineNo, const char *pszNewLine) CPL_WARN_UNUSED_RESULT
Definition: cpl_string.cpp:562
int CPL_DLL CSLTestBoolean(const char *pszValue)
Definition: cpl_string.cpp:1553