32 #ifndef CPL_CONV_H_INCLUDED 33 #define CPL_CONV_H_INCLUDED 52 void CPL_DLL CPLVerifyConfiguration(
void);
55 const char CPL_DLL * CPL_STDCALL
57 const char CPL_DLL * CPL_STDCALL
61 const char *pszValue );
63 void CPL_DLL CPL_STDCALL CPLFreeConfig(
void);
81 #define CPLFree VSIFree 86 char CPL_DLL *
CPLFGets(
char *,
int, FILE *);
96 double CPL_DLL
CPLAtof(
const char *);
98 double CPL_DLL
CPLStrtod(
const char *,
char **);
100 float CPL_DLL
CPLStrtof(
const char *,
char **);
107 double CPL_DLL
CPLAtofM(
const char *);
115 unsigned long CPL_DLL
CPLScanULong(
const char *,
int );
128 int CPL_DLL CPLPrintDouble(
char *,
const char *,
double,
const char * );
129 int CPL_DLL
CPLPrintTime(
char *,
int ,
const char *,
const struct tm *,
137 void CPL_DLL *
CPLGetSymbol(
const char *,
const char * );
142 int CPL_DLL CPLGetExecPath(
char *pszPathBuf,
int nMaxLength );
154 const char *pszBasename,
157 const char *pszBasename,
166 const char *pszNewFilename,
168 int CPL_DLL
CPLCheckForFile(
char *pszFilename,
char **papszSiblingList );
179 typedef const char *(*CPLFileFinder)(
const char *,
const char *);
181 const char CPL_DLL *
CPLFindFile(
const char *pszClass,
182 const char *pszBasename);
184 const char *pszBasename);
210 FILE CPL_DLL *
CPLOpenShared(
const char *,
const char *,
int );
215 void CPL_DLL CPLCleanupSharedFileMutex(
void );
222 const char CPL_DLL *
CPLDecToDMS(
double dfAngle,
const char * pszAxis,
228 double *pdfReal,
double *pdfImag );
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 );
244 #define CPL_ZIP_API_OFFERED 246 void CPL_DLL *
CPLCreateZip(
const char *pszZipFilename,
char **papszOptions );
248 char **papszOptions );
257 void CPL_DLL *CPLZLibDeflate(
const void* ptr,
size_t nBytes,
int nLevel,
258 void* outptr,
size_t nOutAvailableBytes,
259 size_t* pnOutBytes );
261 void* outptr,
size_t nOutAvailableBytes,
262 size_t* pnOutBytes );
267 int CPL_DLL CPLValidateXML(
const char* pszXMLFilename,
268 const char* pszXSDFilename,
276 void CPLCleanupSetlocaleMutex(
void);
293 #if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS) 297 class CPL_DLL CPLLocaleC
299 CPL_DISALLOW_COPY_ASSIGN(CPLLocaleC)
312 class CPLThreadLocaleCPrivate;
313 class CPL_DLL CPLThreadLocaleC
315 CPL_DISALLOW_COPY_ASSIGN(CPLThreadLocaleC)
322 CPLThreadLocaleCPrivate* m_private;
336 #if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS) 340 class CPL_DLL CPLConfigOptionSetter
342 CPL_DISALLOW_COPY_ASSIGN(CPLConfigOptionSetter)
344 CPLConfigOptionSetter(
const char* pszKey,
const char* pszValue,
345 bool bSetOnlyIfUndefined);
346 ~CPLConfigOptionSetter();
351 bool m_bRestoreOldValue;
358 #if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS) 364 #include <type_traits> 378 template<
typename To,
typename From>
inline To down_cast(From* f)
381 (std::is_base_of<From,
382 typename std::remove_pointer<To>::type>::value),
383 "target type not derived from source type");
384 CPLAssert(f ==
nullptr || dynamic_cast<To>(f) !=
nullptr);
385 return static_cast<To>(f);
double CPL_DLL CPLAtofM(const char *)
Definition: cpl_strtod.cpp:142
void CPL_DLL CPLSetThreadLocalConfigOptions(const char *const *papszConfigOptions)
Definition: cpl_conv.cpp:1952
double CPL_DLL CPLStrtod(const char *, char **)
Definition: cpl_strtod.cpp:321
CPLErr CPL_DLL CPLCreateFileInZip(void *hZip, const char *pszFilename, char **papszOptions)
Definition: cpl_conv.cpp:3099
int CPL_DLL CPLPrintString(char *, const char *, int)
Definition: cpl_conv.cpp:1223
GUIntBig CPL_DLL CPLScanUIntBig(const char *, int)
Definition: cpl_conv.cpp:964
int CPL_DLL CPLCopyFile(const char *pszNewPath, const char *pszOldPath)
Definition: cpl_conv.cpp:2644
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:537
int CPL_DLL CPLIsPowerOfTwo(unsigned int i)
Definition: cpl_conv.cpp:3018
int CPL_DLL CPLPrintInt32(char *, GInt32, int)
Definition: cpl_conv.cpp:1311
const char CPL_DLL * CPLResetExtension(const char *, const char *) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_path.cpp:431
const char CPL_DLL * CPLFindFile(const char *pszClass, const char *pszBasename)
Definition: cpl_findfile.cpp:177
int CPL_DLL CPLPrintTime(char *, int, const char *, const struct tm *, const char *)
Definition: cpl_conv.cpp:1502
void CPL_DLL CPLSetConfigOptions(const char *const *papszConfigOptions)
Definition: cpl_conv.cpp:1765
int CPL_DLL CPLMoveFile(const char *pszNewPath, const char *pszOldPath)
Definition: cpl_conv.cpp:2784
unsigned long CPL_DLL CPLScanULong(const char *, int)
Definition: cpl_conv.cpp:934
const char CPL_DLL * CPLDefaultFindFile(const char *pszClass, const char *pszBasename)
Definition: cpl_findfile.cpp:149
int GInt32
Definition: cpl_port.h:205
GIntBig CPL_DLL CPLAtoGIntBigEx(const char *pszString, int bWarn, int *pbOverflow)
Definition: cpl_conv.cpp:1050
FILE VSILFILE
Definition: cpl_vsi.h:156
char CPL_DLL * CPLStrdup(const char *) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_conv.cpp:293
int CPL_DLL CPLSymlink(const char *pszOldPath, const char *pszNewPath, CSLConstList papszOptions)
Definition: cpl_conv.cpp:2805
CPL_C_START const char CPL_DLL *CPL_STDCALL CPLGetConfigOption(const char *, const char *) CPL_WARN_UNUSED_RESULT
Definition: cpl_conv.cpp:1692
CPLSharedFileInfo CPL_DLL * CPLGetSharedList(int *)
Definition: cpl_conv.cpp:2499
char * CPLsetlocale(int category, const char *locale)
Definition: cpl_conv.cpp:2992
const char CPL_DLL * CPLReadLine(FILE *)
Definition: cpl_conv.cpp:566
double CPL_DLL CPLDecToPackedDMS(double dfDec)
Definition: cpl_conv.cpp:2256
void CPL_DLL * CPLCreateZip(const char *pszZipFilename, char **papszOptions)
Definition: cpl_conv.cpp:3091
double CPL_DLL CPLScanDouble(const char *, int)
Definition: cpl_conv.cpp:1171
const char CPL_DLL * CPLGetFilename(const char *) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_path.cpp:260
int CPL_DLL CPLStat(const char *, VSIStatBuf *) CPL_WARN_UNUSED_RESULT
Definition: cpl_conv.cpp:1997
void CPL_DLL CPL_STDCALL CPLSetThreadLocalConfigOption(const char *pszKey, const char *pszValue)
Definition: cpl_conv.cpp:1885
GIntBig CPL_DLL CPLAtoGIntBig(const char *pszString)
Definition: cpl_conv.cpp:998
int bLarge
Definition: cpl_conv.h:205
double CPL_DLL CPLAtofDelim(const char *, char)
Definition: cpl_strtod.cpp:73
void CPL_DLL CPLPushFinderLocation(const char *)
Definition: cpl_findfile.cpp:246
const char CPL_DLL * CPLReadLineL(VSILFILE *)
Definition: cpl_conv.cpp:630
char CPL_DLL * CPLStrlwr(char *)
Definition: cpl_conv.cpp:319
const char CPL_DLL *CPL_STDCALL CPLGetThreadLocalConfigOption(const char *, const char *) CPL_WARN_UNUSED_RESULT
Definition: cpl_conv.cpp:1780
void CPL_DLL CPLFinderClean(void)
Definition: cpl_findfile.cpp:134
void CPL_DLL CPL_STDCALL CPLSetConfigOption(const char *, const char *)
Definition: cpl_conv.cpp:1832
FILE CPL_DLL * CPLOpenShared(const char *, const char *, int)
Definition: cpl_conv.cpp:2335
char CPL_DLL * CPLScanString(const char *, int, int, int)
Definition: cpl_conv.cpp:846
#define CPLAssert(expr)
Definition: cpl_error.h:186
Definition: cpl_conv.h:202
const char CPL_DLL * CPLGenerateTempFilename(const char *pszStem) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_path.cpp:1105
const char CPL_DLL * CPLExpandTilde(const char *pszFilename) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_path.cpp:1148
char CPL_DLL * CPLFGets(char *, int, FILE *)
Definition: cpl_conv.cpp:364
char CPL_DLL ** CPLCorrespondingPaths(const char *pszOldFilename, const char *pszNewFilename, char **papszFileList) CPL_WARN_UNUSED_RESULT
Definition: cpl_path.cpp:1000
const char CPL_DLL * CPLCleanTrailingSlash(const char *) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_path.cpp:949
char CPL_DLL * CPLGetCurrentDir(void)
Definition: cpl_path.cpp:396
void CPL_DLL * CPLMalloc(size_t) CPL_WARN_UNUSED_RESULT
Definition: cpl_conv.cpp:168
int CPL_DLL CPLPrintUIntBig(char *, GUIntBig, int)
Definition: cpl_conv.cpp:1350
char ** CSLConstList
Definition: cpl_port.h:1194
char * pszAccess
Definition: cpl_conv.h:207
const char CPL_DLL * CPLGetExtension(const char *) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_path.cpp:345
double CPL_DLL CPLAtof(const char *)
Definition: cpl_strtod.cpp:117
int CPL_DLL CPLPrintPointer(char *, void *, int)
Definition: cpl_conv.cpp:1400
FILE * fp
Definition: cpl_conv.h:203
CPLErr CPL_DLL CPLCloseZip(void *hZip)
Definition: cpl_conv.cpp:3105
int CPL_DLL CPLPrintStringFill(char *, const char *, int)
Definition: cpl_conv.cpp:1267
const char CPL_DLL * CPLExtractRelativePath(const char *, const char *, int *) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_path.cpp:857
char CPL_DLL ** CPLGetConfigOptions(void)
Definition: cpl_conv.cpp:1739
void CPL_DLL CPLDumpSharedList(FILE *)
Definition: cpl_conv.cpp:2521
unsigned long long GUIntBig
Definition: cpl_port.h:251
double CPL_DLL CPLDMSToDec(const char *is)
Definition: cpl_conv.cpp:2046
const char *(* CPLFileFinder)(const char *, const char *)
Definition: cpl_conv.h:179
int CPL_DLL CPLCopyTree(const char *pszNewPath, const char *pszOldPath)
Definition: cpl_conv.cpp:2706
int nRefCount
Definition: cpl_conv.h:204
void CPL_DLL CPLPushFileFinder(CPLFileFinder pfnFinder)
Definition: cpl_findfile.cpp:200
const char CPL_DLL * CPLGetDirname(const char *) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_path.cpp:208
const char CPL_DLL * CPLDecToDMS(double dfAngle, const char *pszAxis, int nPrecision)
Definition: cpl_conv.cpp:2129
void CPL_DLL * CPLRealloc(void *, size_t) CPL_WARN_UNUSED_RESULT
Definition: cpl_conv.cpp:225
void CPL_DLL CPLPopFinderLocation(void)
Definition: cpl_findfile.cpp:285
float CPL_DLL CPLStrtofDelim(const char *, char **, char)
Definition: cpl_strtod.cpp:347
const char CPL_DLL * CPLGetBasename(const char *) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_path.cpp:292
const char CPL_DLL * CPLProjectRelativeFilename(const char *pszProjectDir, const char *pszSecondaryFilename) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_path.cpp:750
float CPL_DLL CPLStrtof(const char *, char **)
Definition: cpl_strtod.cpp:397
long CPL_DLL CPLScanLong(const char *, int)
Definition: cpl_conv.cpp:906
double CPL_DLL CPLStrtodDelim(const char *, char **, char)
Definition: cpl_strtod.cpp:231
#define CPL_WARN_UNUSED_RESULT
Definition: cpl_port.h:939
void CPL_DLL CPLStringToComplex(const char *pszString, double *pdfReal, double *pdfImag)
Definition: cpl_conv.cpp:2273
const char CPL_DLL * CPLGetPath(const char *) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_path.cpp:153
int CPL_DLL CPLUnlinkTree(const char *)
Definition: cpl_conv.cpp:2559
#define CPL_RETURNS_NONNULL
Definition: cpl_port.h:972
int CPL_DLL CPLCheckForFile(char *pszFilename, char **papszSiblingList)
Definition: cpl_conv.cpp:3053
long long GIntBig
Definition: cpl_port.h:248
char CPL_DLL ** CPLGetThreadLocalConfigOptions(void)
Definition: cpl_conv.cpp:1922
CPLErr CPL_DLL CPLWriteFileInZip(void *hZip, const void *pBuffer, int nBufferSize)
Definition: cpl_conv.cpp:3101
void CPL_DLL * CPLCalloc(size_t, size_t) CPL_WARN_UNUSED_RESULT
Definition: cpl_conv.cpp:138
void CPL_DLL * CPLScanPointer(const char *, int)
Definition: cpl_conv.cpp:1105
char * pszFilename
Definition: cpl_conv.h:206
CPLFileFinder CPL_DLL CPLPopFileFinder(void)
Definition: cpl_findfile.cpp:235
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:657
void CPL_DLL CPLCloseShared(FILE *)
Definition: cpl_conv.cpp:2408
double CPL_DLL CPLPackedDMSToDec(double)
Definition: cpl_conv.cpp:2222
CPLErr CPL_DLL CPLCloseFileInZip(void *hZip)
Definition: cpl_conv.cpp:3103
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:3116
int CPL_DLL CPLIsFilenameRelative(const char *pszFilename)
Definition: cpl_path.cpp:816
void CPL_DLL * CPLGetSymbol(const char *, const char *)
Definition: cplgetsymbol.cpp:89
const char CPL_DLL * CPLGetHomeDir(void) CPL_WARN_UNUSED_RESULT
Definition: cpl_path.cpp:1176
CPLErr
Definition: cpl_error.h:52