SDTS_AL
cpl_conv.h
Go to the documentation of this file.
1 /******************************************************************************
2  * $Id: cpl_conv.h dfac92801bd83819cbae2501803e02e06b361a43 2018-04-23 18:07:32 +0200 Martin Landa $
3  *
4  * Project: CPL - Common Portability Library
5  * Purpose: Convenience functions declarations.
6  * This is intended to remain light weight.
7  * Author: Frank Warmerdam, warmerdam@pobox.com
8  *
9  ******************************************************************************
10  * Copyright (c) 1998, Frank Warmerdam
11  * Copyright (c) 2007-2013, 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
24  * OR 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_CONV_H_INCLUDED
33 #define CPL_CONV_H_INCLUDED
34 
35 #include "cpl_port.h"
36 #include "cpl_vsi.h"
37 #include "cpl_error.h"
38 
46 /* -------------------------------------------------------------------- */
47 /* Runtime check of various configuration items. */
48 /* -------------------------------------------------------------------- */
49 CPL_C_START
50 
52 void CPL_DLL CPLVerifyConfiguration(void);
55 const char CPL_DLL * CPL_STDCALL
56 CPLGetConfigOption( const char *, const char * ) CPL_WARN_UNUSED_RESULT;
57 const char CPL_DLL * CPL_STDCALL
58 CPLGetThreadLocalConfigOption( const char *, const char * ) CPL_WARN_UNUSED_RESULT;
59 void CPL_DLL CPL_STDCALL CPLSetConfigOption( const char *, const char * );
60 void CPL_DLL CPL_STDCALL CPLSetThreadLocalConfigOption( const char *pszKey,
61  const char *pszValue );
63 void CPL_DLL CPL_STDCALL CPLFreeConfig(void);
65 char CPL_DLL** CPLGetConfigOptions(void);
66 void CPL_DLL CPLSetConfigOptions(const char* const * papszConfigOptions);
67 char CPL_DLL** CPLGetThreadLocalConfigOptions(void);
68 void CPL_DLL CPLSetThreadLocalConfigOptions(const char* const * papszConfigOptions);
69 
70 /* -------------------------------------------------------------------- */
71 /* Safe malloc() API. Thin cover over VSI functions with fatal */
72 /* error reporting if memory allocation fails. */
73 /* -------------------------------------------------------------------- */
74 void CPL_DLL *CPLMalloc( size_t ) CPL_WARN_UNUSED_RESULT;
75 void CPL_DLL *CPLCalloc( size_t, size_t ) CPL_WARN_UNUSED_RESULT;
76 void CPL_DLL *CPLRealloc( void *, size_t ) CPL_WARN_UNUSED_RESULT;
77 char CPL_DLL *CPLStrdup( const char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
78 char CPL_DLL *CPLStrlwr( char *);
79 
81 #define CPLFree VSIFree
82 
83 /* -------------------------------------------------------------------- */
84 /* Read a line from a text file, and strip of CR/LF. */
85 /* -------------------------------------------------------------------- */
86 char CPL_DLL *CPLFGets( char *, int, FILE *);
87 const char CPL_DLL *CPLReadLine( FILE * );
88 const char CPL_DLL *CPLReadLineL( VSILFILE * );
89 const char CPL_DLL *CPLReadLine2L( VSILFILE *, int, CSLConstList );
90 const char CPL_DLL *CPLReadLine3L( VSILFILE *, int, int *, CSLConstList );
91 
92 /* -------------------------------------------------------------------- */
93 /* Convert ASCII string to floating point number */
94 /* (THESE FUNCTIONS ARE NOT LOCALE AWARE!). */
95 /* -------------------------------------------------------------------- */
96 double CPL_DLL CPLAtof(const char *);
97 double CPL_DLL CPLAtofDelim(const char *, char);
98 double CPL_DLL CPLStrtod(const char *, char **);
99 double CPL_DLL CPLStrtodDelim(const char *, char **, char);
100 float CPL_DLL CPLStrtof(const char *, char **);
101 float CPL_DLL CPLStrtofDelim(const char *, char **, char);
102 
103 /* -------------------------------------------------------------------- */
104 /* Convert number to string. This function is locale agnostic */
105 /* (i.e. it will support "," or "." regardless of current locale) */
106 /* -------------------------------------------------------------------- */
107 double CPL_DLL CPLAtofM(const char *);
108 
109 /* -------------------------------------------------------------------- */
110 /* Read a numeric value from an ASCII character string. */
111 /* -------------------------------------------------------------------- */
112 char CPL_DLL *CPLScanString( const char *, int, int, int );
113 double CPL_DLL CPLScanDouble( const char *, int );
114 long CPL_DLL CPLScanLong( const char *, int );
115 unsigned long CPL_DLL CPLScanULong( const char *, int );
116 GUIntBig CPL_DLL CPLScanUIntBig( const char *, int );
117 GIntBig CPL_DLL CPLAtoGIntBig( const char* pszString );
118 GIntBig CPL_DLL CPLAtoGIntBigEx( const char* pszString, int bWarn, int *pbOverflow );
119 void CPL_DLL *CPLScanPointer( const char *, int );
120 
121 /* -------------------------------------------------------------------- */
122 /* Print a value to an ASCII character string. */
123 /* -------------------------------------------------------------------- */
124 int CPL_DLL CPLPrintString( char *, const char *, int );
125 int CPL_DLL CPLPrintStringFill( char *, const char *, int );
126 int CPL_DLL CPLPrintInt32( char *, GInt32 , int );
127 int CPL_DLL CPLPrintUIntBig( char *, GUIntBig , int );
128 int CPL_DLL CPLPrintDouble( char *, const char *, double, const char * );
129 int CPL_DLL CPLPrintTime( char *, int , const char *, const struct tm *,
130  const char * );
131 int CPL_DLL CPLPrintPointer( char *, void *, int );
132 
133 /* -------------------------------------------------------------------- */
134 /* Fetch a function from DLL / so. */
135 /* -------------------------------------------------------------------- */
136 
137 void CPL_DLL *CPLGetSymbol( const char *, const char * );
138 
139 /* -------------------------------------------------------------------- */
140 /* Fetch executable path. */
141 /* -------------------------------------------------------------------- */
142 int CPL_DLL CPLGetExecPath( char *pszPathBuf, int nMaxLength );
143 
144 /* -------------------------------------------------------------------- */
145 /* Filename handling functions. */
146 /* -------------------------------------------------------------------- */
147 const char CPL_DLL *CPLGetPath( const char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
148 const char CPL_DLL *CPLGetDirname( const char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
149 const char CPL_DLL *CPLGetFilename( const char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
150 const char CPL_DLL *CPLGetBasename( const char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
151 const char CPL_DLL *CPLGetExtension( const char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
152 char CPL_DLL *CPLGetCurrentDir(void);
153 const char CPL_DLL *CPLFormFilename( const char *pszPath,
154  const char *pszBasename,
155  const char *pszExtension ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
156 const char CPL_DLL *CPLFormCIFilename( const char *pszPath,
157  const char *pszBasename,
158  const char *pszExtension ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
159 const char CPL_DLL *CPLResetExtension( const char *, const char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
160 const char CPL_DLL *CPLProjectRelativeFilename( const char *pszProjectDir,
161  const char *pszSecondaryFilename ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
162 int CPL_DLL CPLIsFilenameRelative( const char *pszFilename );
163 const char CPL_DLL *CPLExtractRelativePath(const char *, const char *, int *) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
164 const char CPL_DLL *CPLCleanTrailingSlash( const char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
165 char CPL_DLL **CPLCorrespondingPaths( const char *pszOldFilename,
166  const char *pszNewFilename,
167  char **papszFileList ) CPL_WARN_UNUSED_RESULT;
168 int CPL_DLL CPLCheckForFile( char *pszFilename, char **papszSiblingList );
169 
170 const char CPL_DLL *CPLGenerateTempFilename( const char *pszStem ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
171 const char CPL_DLL *CPLExpandTilde( const char *pszFilename ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
172 const char CPL_DLL *CPLGetHomeDir(void) CPL_WARN_UNUSED_RESULT;
173 
174 /* -------------------------------------------------------------------- */
175 /* Find File Function */
176 /* -------------------------------------------------------------------- */
177 
179 typedef const char *(*CPLFileFinder)(const char *, const char *);
180 
181 const char CPL_DLL *CPLFindFile(const char *pszClass,
182  const char *pszBasename);
183 const char CPL_DLL *CPLDefaultFindFile(const char *pszClass,
184  const char *pszBasename);
185 void CPL_DLL CPLPushFileFinder( CPLFileFinder pfnFinder );
186 CPLFileFinder CPL_DLL CPLPopFileFinder(void);
187 void CPL_DLL CPLPushFinderLocation( const char * );
188 void CPL_DLL CPLPopFinderLocation(void);
189 void CPL_DLL CPLFinderClean(void);
190 
191 /* -------------------------------------------------------------------- */
192 /* Safe version of stat() that works properly on stuff like "C:". */
193 /* -------------------------------------------------------------------- */
194 int CPL_DLL CPLStat( const char *, VSIStatBuf * ) CPL_WARN_UNUSED_RESULT;
195 
196 /* -------------------------------------------------------------------- */
197 /* Reference counted file handle manager. Makes sharing file */
198 /* handles more practical. */
199 /* -------------------------------------------------------------------- */
200 
202 typedef struct {
203  FILE *fp;
204  int nRefCount;
205  int bLarge;
206  char *pszFilename;
207  char *pszAccess;
209 
210 FILE CPL_DLL *CPLOpenShared( const char *, const char *, int );
211 void CPL_DLL CPLCloseShared( FILE * );
212 CPLSharedFileInfo CPL_DLL *CPLGetSharedList( int * );
213 void CPL_DLL CPLDumpSharedList( FILE * );
215 void CPL_DLL CPLCleanupSharedFileMutex( void );
218 /* -------------------------------------------------------------------- */
219 /* DMS to Dec to DMS conversion. */
220 /* -------------------------------------------------------------------- */
221 double CPL_DLL CPLDMSToDec( const char *is );
222 const char CPL_DLL *CPLDecToDMS( double dfAngle, const char * pszAxis,
223  int nPrecision );
224 double CPL_DLL CPLPackedDMSToDec( double );
225 double CPL_DLL CPLDecToPackedDMS( double dfDec );
226 
227 void CPL_DLL CPLStringToComplex( const char *pszString,
228  double *pdfReal, double *pdfImag );
229 
230 /* -------------------------------------------------------------------- */
231 /* Misc other functions. */
232 /* -------------------------------------------------------------------- */
233 int CPL_DLL CPLUnlinkTree( const char * );
234 int CPL_DLL CPLCopyFile( const char *pszNewPath, const char *pszOldPath );
235 int CPL_DLL CPLCopyTree( const char *pszNewPath, const char *pszOldPath );
236 int CPL_DLL CPLMoveFile( const char *pszNewPath, const char *pszOldPath );
237 int CPL_DLL CPLSymlink( const char* pszOldPath, const char* pszNewPath, CSLConstList papszOptions );
238 
239 /* -------------------------------------------------------------------- */
240 /* ZIP Creation. */
241 /* -------------------------------------------------------------------- */
242 
244 #define CPL_ZIP_API_OFFERED
245 
246 void CPL_DLL *CPLCreateZip( const char *pszZipFilename, char **papszOptions );
247 CPLErr CPL_DLL CPLCreateFileInZip( void *hZip, const char *pszFilename,
248  char **papszOptions );
249 CPLErr CPL_DLL CPLWriteFileInZip( void *hZip, const void *pBuffer, int nBufferSize );
250 CPLErr CPL_DLL CPLCloseFileInZip( void *hZip );
251 CPLErr CPL_DLL CPLCloseZip( void *hZip );
252 
253 /* -------------------------------------------------------------------- */
254 /* ZLib compression */
255 /* -------------------------------------------------------------------- */
256 
257 void CPL_DLL *CPLZLibDeflate( const void* ptr, size_t nBytes, int nLevel,
258  void* outptr, size_t nOutAvailableBytes,
259  size_t* pnOutBytes );
260 void CPL_DLL *CPLZLibInflate( const void* ptr, size_t nBytes,
261  void* outptr, size_t nOutAvailableBytes,
262  size_t* pnOutBytes );
263 
264 /* -------------------------------------------------------------------- */
265 /* XML validation. */
266 /* -------------------------------------------------------------------- */
267 int CPL_DLL CPLValidateXML(const char* pszXMLFilename,
268  const char* pszXSDFilename,
269  CSLConstList papszOptions);
270 
271 /* -------------------------------------------------------------------- */
272 /* Locale handling. Prevents parallel executions of setlocale(). */
273 /* -------------------------------------------------------------------- */
274 char* CPLsetlocale (int category, const char* locale);
276 void CPLCleanupSetlocaleMutex(void);
284 int CPL_DLL CPLIsPowerOfTwo( unsigned int i );
285 
286 CPL_C_END
287 
288 /* -------------------------------------------------------------------- */
289 /* C++ object for temporarily forcing a LC_NUMERIC locale to "C". */
290 /* -------------------------------------------------------------------- */
291 
293 #if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
294 
295 extern "C++"
296 {
297 class CPL_DLL CPLLocaleC
298 {
299 public:
300  CPLLocaleC();
301  ~CPLLocaleC();
302 
303  /* Make it non-copyable */
304  CPLLocaleC(const CPLLocaleC&) = delete;
305  CPLLocaleC& operator=(const CPLLocaleC&) = delete;
306 
307 private:
308  char *pszOldLocale;
309 };
310 
311 // Does the same as CPLLocaleC except that, when available, it tries to
312 // only affect the current thread. But code that would be dependent of
313 // setlocale(LC_NUMERIC, NULL) returning "C", such as current proj.4 versions,
314 // will not work depending on the actual implementation
315 class CPLThreadLocaleCPrivate;
316 class CPL_DLL CPLThreadLocaleC
317 {
318 public:
319  CPLThreadLocaleC();
320  ~CPLThreadLocaleC();
321 
322  /* Make it non-copyable */
323  CPLThreadLocaleC(const CPLThreadLocaleC&) = delete;
324  CPLThreadLocaleC& operator=(const CPLThreadLocaleC&) = delete;
325 
326 private:
327  CPLThreadLocaleCPrivate* m_private;
328 };
329 }
330 
331 #endif /* def __cplusplus */
332 
334 
335 
336 /* -------------------------------------------------------------------- */
337 /* C++ object for temporarily forcing a config option */
338 /* -------------------------------------------------------------------- */
339 
341 #if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
342 
343 extern "C++"
344 {
345 class CPL_DLL CPLConfigOptionSetter
346 {
347 public:
348  CPLConfigOptionSetter(const char* pszKey, const char* pszValue,
349  bool bSetOnlyIfUndefined);
350  ~CPLConfigOptionSetter();
351 
352  /* Make it non-copyable */
353  CPLConfigOptionSetter(const CPLConfigOptionSetter&) = delete;
354  CPLConfigOptionSetter& operator=(const CPLConfigOptionSetter&) = delete;
355 
356 private:
357  char* m_pszKey;
358  char *m_pszOldValue;
359  bool m_bRestoreOldValue;
360 };
361 }
362 
363 #endif /* def __cplusplus */
364 
366 #if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
367 
368 extern "C++"
369 {
370 
371 #ifndef DOXYGEN_SKIP
372 #include <type_traits> // for std::is_base_of
373 #endif
374 
375 namespace cpl
376 {
386  template<typename To, typename From> inline To down_cast(From* f)
387  {
388  static_assert(
389  (std::is_base_of<From,
390  typename std::remove_pointer<To>::type>::value),
391  "target type not derived from source type");
392  CPLAssert(f == nullptr || dynamic_cast<To>(f) != nullptr);
393  return static_cast<To>(f);
394  }
395 }
396 } // extern "C++"
397 
398 #endif /* def __cplusplus */
399 
400 #endif /* ndef CPL_CONV_H_INCLUDED */
CPLStrtofDelim
float CPL_DLL CPLStrtofDelim(const char *, char **, char)
Definition: cpl_strtod.cpp:347
CPLPopFinderLocation
void CPL_DLL CPLPopFinderLocation(void)
Definition: cpl_findfile.cpp:285
CPLOpenShared
FILE CPL_DLL * CPLOpenShared(const char *, const char *, int)
Definition: cpl_conv.cpp:2333
cpl_error.h
CPLUnlinkTree
int CPL_DLL CPLUnlinkTree(const char *)
Definition: cpl_conv.cpp:2557
CPLScanString
char CPL_DLL * CPLScanString(const char *, int, int, int)
Definition: cpl_conv.cpp:846
CPLScanUIntBig
GUIntBig CPL_DLL CPLScanUIntBig(const char *, int)
Definition: cpl_conv.cpp:964
CPLSymlink
int CPL_DLL CPLSymlink(const char *pszOldPath, const char *pszNewPath, CSLConstList papszOptions)
Definition: cpl_conv.cpp:2803
CPLPrintPointer
int CPL_DLL CPLPrintPointer(char *, void *, int)
Definition: cpl_conv.cpp:1398
CPLExpandTilde
const char CPL_DLL * CPLExpandTilde(const char *pszFilename) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_path.cpp:1138
CPLFGets
char CPL_DLL * CPLFGets(char *, int, FILE *)
Definition: cpl_conv.cpp:364
CPLFormCIFilename
const char CPL_DLL * CPLFormCIFilename(const char *pszPath, const char *pszBasename, const char *pszExtension) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_path.cpp:651
CPLCalloc
void CPL_DLL * CPLCalloc(size_t, size_t) CPL_WARN_UNUSED_RESULT
Definition: cpl_conv.cpp:138
cpl_vsi.h
CPLDMSToDec
double CPL_DLL CPLDMSToDec(const char *is)
Definition: cpl_conv.cpp:2044
CPLSharedFileInfo::bLarge
int bLarge
Definition: cpl_conv.h:205
CPLAtoGIntBigEx
GIntBig CPL_DLL CPLAtoGIntBigEx(const char *pszString, int bWarn, int *pbOverflow)
Definition: cpl_conv.cpp:1048
CPLCloseFileInZip
CPLErr CPL_DLL CPLCloseFileInZip(void *hZip)
Definition: cpl_conv.cpp:3093
CPLAtoGIntBig
GIntBig CPL_DLL CPLAtoGIntBig(const char *pszString)
Definition: cpl_conv.cpp:996
CPLSharedFileInfo
Definition: cpl_conv.h:202
CPLScanLong
long CPL_DLL CPLScanLong(const char *, int)
Definition: cpl_conv.cpp:906
CPLGetPath
const char CPL_DLL * CPLGetPath(const char *) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_path.cpp:153
CPLStrdup
char CPL_DLL * CPLStrdup(const char *) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_conv.cpp:293
CPLAtof
double CPL_DLL CPLAtof(const char *)
Definition: cpl_strtod.cpp:117
CPLSetConfigOption
void CPL_DLL CPL_STDCALL CPLSetConfigOption(const char *, const char *)
Definition: cpl_conv.cpp:1830
CPLCreateZip
void CPL_DLL * CPLCreateZip(const char *pszZipFilename, char **papszOptions)
Definition: cpl_conv.cpp:3081
CPLGetSharedList
CPLSharedFileInfo CPL_DLL * CPLGetSharedList(int *)
Definition: cpl_conv.cpp:2497
CPLCleanTrailingSlash
const char CPL_DLL * CPLCleanTrailingSlash(const char *) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_path.cpp:939
CPLGetFilename
const char CPL_DLL * CPLGetFilename(const char *) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_path.cpp:260
CPLDumpSharedList
void CPL_DLL CPLDumpSharedList(FILE *)
Definition: cpl_conv.cpp:2519
CPLScanPointer
void CPL_DLL * CPLScanPointer(const char *, int)
Definition: cpl_conv.cpp:1103
CPLGetCurrentDir
char CPL_DLL * CPLGetCurrentDir(void)
Definition: cpl_path.cpp:396
CPLGetThreadLocalConfigOptions
char CPL_DLL ** CPLGetThreadLocalConfigOptions(void)
Definition: cpl_conv.cpp:1920
CPLAssert
#define CPLAssert(expr)
Definition: cpl_error.h:182
CPLPrintInt32
int CPL_DLL CPLPrintInt32(char *, GInt32, int)
Definition: cpl_conv.cpp:1309
CPLPackedDMSToDec
double CPL_DLL CPLPackedDMSToDec(double)
Definition: cpl_conv.cpp:2220
CPLCopyTree
int CPL_DLL CPLCopyTree(const char *pszNewPath, const char *pszOldPath)
Definition: cpl_conv.cpp:2704
CPLPrintTime
int CPL_DLL CPLPrintTime(char *, int, const char *, const struct tm *, const char *)
Definition: cpl_conv.cpp:1500
CPLCorrespondingPaths
char CPL_DLL ** CPLCorrespondingPaths(const char *pszOldFilename, const char *pszNewFilename, char **papszFileList) CPL_WARN_UNUSED_RESULT
Definition: cpl_path.cpp:990
CPLFindFile
const char CPL_DLL * CPLFindFile(const char *pszClass, const char *pszBasename)
Definition: cpl_findfile.cpp:177
CPLScanDouble
double CPL_DLL CPLScanDouble(const char *, int)
Definition: cpl_conv.cpp:1169
CPLStat
int CPL_DLL CPLStat(const char *, VSIStatBuf *) CPL_WARN_UNUSED_RESULT
Definition: cpl_conv.cpp:1995
CPLFileFinder
const typedef char *(* CPLFileFinder)(const char *, const char *)
Definition: cpl_conv.h:179
CPLGetConfigOption
const CPL_C_START char CPL_DLL *CPL_STDCALL CPLGetConfigOption(const char *, const char *) CPL_WARN_UNUSED_RESULT
Definition: cpl_conv.cpp:1690
CPLPrintUIntBig
int CPL_DLL CPLPrintUIntBig(char *, GUIntBig, int)
Definition: cpl_conv.cpp:1348
CSLConstList
char ** CSLConstList
Definition: cpl_port.h:1184
GUIntBig
unsigned long long GUIntBig
Definition: cpl_port.h:249
CPLGetHomeDir
const char CPL_DLL * CPLGetHomeDir(void) CPL_WARN_UNUSED_RESULT
Definition: cpl_path.cpp:1166
CPLSetThreadLocalConfigOptions
void CPL_DLL CPLSetThreadLocalConfigOptions(const char *const *papszConfigOptions)
Definition: cpl_conv.cpp:1950
CPLStrtodDelim
double CPL_DLL CPLStrtodDelim(const char *, char **, char)
Definition: cpl_strtod.cpp:231
CPLCloseZip
CPLErr CPL_DLL CPLCloseZip(void *hZip)
Definition: cpl_conv.cpp:3095
CPLStrlwr
char CPL_DLL * CPLStrlwr(char *)
Definition: cpl_conv.cpp:319
CPLFinderClean
void CPL_DLL CPLFinderClean(void)
Definition: cpl_findfile.cpp:134
CPLStrtod
double CPL_DLL CPLStrtod(const char *, char **)
Definition: cpl_strtod.cpp:321
CPLExtractRelativePath
const char CPL_DLL * CPLExtractRelativePath(const char *, const char *, int *) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_path.cpp:847
CPLGetConfigOptions
char CPL_DLL ** CPLGetConfigOptions(void)
Definition: cpl_conv.cpp:1737
CPLWriteFileInZip
CPLErr CPL_DLL CPLWriteFileInZip(void *hZip, const void *pBuffer, int nBufferSize)
Definition: cpl_conv.cpp:3091
CPLPrintStringFill
int CPL_DLL CPLPrintStringFill(char *, const char *, int)
Definition: cpl_conv.cpp:1265
CPLPushFileFinder
void CPL_DLL CPLPushFileFinder(CPLFileFinder pfnFinder)
Definition: cpl_findfile.cpp:200
CPLMalloc
void CPL_DLL * CPLMalloc(size_t) CPL_WARN_UNUSED_RESULT
Definition: cpl_conv.cpp:168
CPLDecToDMS
const char CPL_DLL * CPLDecToDMS(double dfAngle, const char *pszAxis, int nPrecision)
Definition: cpl_conv.cpp:2127
CPLGetSymbol
void CPL_DLL * CPLGetSymbol(const char *, const char *)
Definition: cplgetsymbol.cpp:89
CPLGetBasename
const char CPL_DLL * CPLGetBasename(const char *) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_path.cpp:292
CPLStrtof
float CPL_DLL CPLStrtof(const char *, char **)
Definition: cpl_strtod.cpp:397
CPLCheckForFile
int CPL_DLL CPLCheckForFile(char *pszFilename, char **papszSiblingList)
Definition: cpl_conv.cpp:3043
CPLSharedFileInfo::pszAccess
char * pszAccess
Definition: cpl_conv.h:207
CPLCopyFile
int CPL_DLL CPLCopyFile(const char *pszNewPath, const char *pszOldPath)
Definition: cpl_conv.cpp:2642
GIntBig
long long GIntBig
Definition: cpl_port.h:246
CPLsetlocale
char * CPLsetlocale(int category, const char *locale)
Definition: cpl_conv.cpp:2982
CPLStringToComplex
void CPL_DLL CPLStringToComplex(const char *pszString, double *pdfReal, double *pdfImag)
Definition: cpl_conv.cpp:2271
CPLDecToPackedDMS
double CPL_DLL CPLDecToPackedDMS(double dfDec)
Definition: cpl_conv.cpp:2254
cpl_port.h
CPLReadLine
const char CPL_DLL * CPLReadLine(FILE *)
Definition: cpl_conv.cpp:566
CPLIsFilenameRelative
int CPL_DLL CPLIsFilenameRelative(const char *pszFilename)
Definition: cpl_path.cpp:806
CPLSharedFileInfo::pszFilename
char * pszFilename
Definition: cpl_conv.h:206
CPLAtofDelim
double CPL_DLL CPLAtofDelim(const char *, char)
Definition: cpl_strtod.cpp:73
CPLRealloc
void CPL_DLL * CPLRealloc(void *, size_t) CPL_WARN_UNUSED_RESULT
Definition: cpl_conv.cpp:225
CPLErr
CPLErr
Definition: cpl_error.h:52
CPL_WARN_UNUSED_RESULT
#define CPL_WARN_UNUSED_RESULT
Definition: cpl_port.h:929
CPLProjectRelativeFilename
const char CPL_DLL * CPLProjectRelativeFilename(const char *pszProjectDir, const char *pszSecondaryFilename) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_path.cpp:744
CPLGetDirname
const char CPL_DLL * CPLGetDirname(const char *) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_path.cpp:208
CPLDefaultFindFile
const char CPL_DLL * CPLDefaultFindFile(const char *pszClass, const char *pszBasename)
Definition: cpl_findfile.cpp:149
CPLPushFinderLocation
void CPL_DLL CPLPushFinderLocation(const char *)
Definition: cpl_findfile.cpp:246
CPLScanULong
unsigned long CPL_DLL CPLScanULong(const char *, int)
Definition: cpl_conv.cpp:934
CPLReadLineL
const char CPL_DLL * CPLReadLineL(VSILFILE *)
Definition: cpl_conv.cpp:630
CPLCreateFileInZip
CPLErr CPL_DLL CPLCreateFileInZip(void *hZip, const char *pszFilename, char **papszOptions)
Definition: cpl_conv.cpp:3089
CPLAtofM
double CPL_DLL CPLAtofM(const char *)
Definition: cpl_strtod.cpp:142
CPLGetThreadLocalConfigOption
const char CPL_DLL *CPL_STDCALL CPLGetThreadLocalConfigOption(const char *, const char *) CPL_WARN_UNUSED_RESULT
Definition: cpl_conv.cpp:1778
CPLGetExtension
const char CPL_DLL * CPLGetExtension(const char *) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_path.cpp:345
CPLIsPowerOfTwo
int CPL_DLL CPLIsPowerOfTwo(unsigned int i)
Definition: cpl_conv.cpp:3008
CPLGenerateTempFilename
const char CPL_DLL * CPLGenerateTempFilename(const char *pszStem) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_path.cpp:1095
CPLPopFileFinder
CPLFileFinder CPL_DLL CPLPopFileFinder(void)
Definition: cpl_findfile.cpp:235
CPLCloseShared
void CPL_DLL CPLCloseShared(FILE *)
Definition: cpl_conv.cpp:2406
CPLPrintString
int CPL_DLL CPLPrintString(char *, const char *, int)
Definition: cpl_conv.cpp:1221
GInt32
int GInt32
Definition: cpl_port.h:203
CPL_RETURNS_NONNULL
#define CPL_RETURNS_NONNULL
Definition: cpl_port.h:962
CPLSharedFileInfo::nRefCount
int nRefCount
Definition: cpl_conv.h:204
CPLFormFilename
const char CPL_DLL * CPLFormFilename(const char *pszPath, const char *pszBasename, const char *pszExtension) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_path.cpp:535
CPLSetConfigOptions
void CPL_DLL CPLSetConfigOptions(const char *const *papszConfigOptions)
Definition: cpl_conv.cpp:1763
CPLSharedFileInfo::fp
FILE * fp
Definition: cpl_conv.h:203
CPLSetThreadLocalConfigOption
void CPL_DLL CPL_STDCALL CPLSetThreadLocalConfigOption(const char *pszKey, const char *pszValue)
Definition: cpl_conv.cpp:1883
VSILFILE
FILE VSILFILE
Definition: cpl_vsi.h:155
CPLMoveFile
int CPL_DLL CPLMoveFile(const char *pszNewPath, const char *pszOldPath)
Definition: cpl_conv.cpp:2782
CPLZLibInflate
void CPL_DLL * CPLZLibInflate(const void *ptr, size_t nBytes, void *outptr, size_t nOutAvailableBytes, size_t *pnOutBytes)
Uncompress a buffer compressed with ZLib DEFLATE compression.
Definition: cpl_conv.cpp:3106
CPLResetExtension
const char CPL_DLL * CPLResetExtension(const char *, const char *) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_path.cpp:431