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);
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;
81 #define CPLFree VSIFree
86 char CPL_DLL *
CPLFGets(
char *,
int, FILE *);
90 const char CPL_DLL *CPLReadLine2L(
VSILFILE * ,
int nMaxCols,
91 const char *
const * papszOptions );
93 const char CPL_DLL *CPLReadLine2L(
VSILFILE * ,
int nMaxCols,
94 char** papszOptions );
101 double CPL_DLL
CPLAtof(
const char *);
103 double CPL_DLL
CPLStrtod(
const char *,
char **);
105 float CPL_DLL
CPLStrtof(
const char *,
char **);
112 double CPL_DLL
CPLAtofM(
const char *);
120 unsigned long CPL_DLL
CPLScanULong(
const char *,
int );
133 int CPL_DLL CPLPrintDouble(
char *,
const char *,
double,
const char * );
134 int CPL_DLL
CPLPrintTime(
char *,
int ,
const char *,
const struct tm *,
142 void CPL_DLL *
CPLGetSymbol(
const char *,
const char * );
147 int CPL_DLL CPLGetExecPath(
char *pszPathBuf,
int nMaxLength );
152 const char CPL_DLL *
CPLGetPath(
const char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
153 const
char CPL_DLL *
CPLGetDirname( const
char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
154 const
char CPL_DLL *
CPLGetFilename( const
char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
155 const
char CPL_DLL *
CPLGetBasename( const
char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
156 const
char CPL_DLL *
CPLGetExtension( const
char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
159 const
char *pszBasename,
160 const
char *pszExtension ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
162 const
char *pszBasename,
163 const
char *pszExtension ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
164 const
char CPL_DLL *
CPLResetExtension( const
char *, const
char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
166 const
char *pszSecondaryFilename ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
168 const
char CPL_DLL *
CPLExtractRelativePath(const
char *, const
char *,
int *) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
169 const
char CPL_DLL *
CPLCleanTrailingSlash( const
char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
171 const
char *pszNewFilename,
172 char **papszFileList ) CPL_WARN_UNUSED_RESULT;
173 int CPL_DLL
CPLCheckForFile(
char *pszFilename,
char **papszSiblingList );
176 const
char CPL_DLL *
CPLExpandTilde( const
char *pszFilename ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
185 const
char CPL_DLL *
CPLFindFile(const
char *pszClass,
186 const
char *pszBasename);
188 const
char *pszBasename);
198 int CPL_DLL
CPLStat( const
char *, VSIStatBuf * ) CPL_WARN_UNUSED_RESULT;
214 FILE CPL_DLL *
CPLOpenShared(
const char *,
const char *,
int );
219 void CPL_DLL CPLCleanupSharedFileMutex(
void );
226 const char CPL_DLL *
CPLDecToDMS(
double dfAngle,
const char * pszAxis,
232 double *pdfReal,
double *pdfImag );
238 int CPL_DLL
CPLCopyFile(
const char *pszNewPath,
const char *pszOldPath );
239 int CPL_DLL
CPLCopyTree(
const char *pszNewPath,
const char *pszOldPath );
240 int CPL_DLL
CPLMoveFile(
const char *pszNewPath,
const char *pszOldPath );
241 int CPL_DLL
CPLSymlink(
const char* pszOldPath,
const char* pszNewPath,
char** papszOptions );
248 #define CPL_ZIP_API_OFFERED
250 void CPL_DLL *
CPLCreateZip(
const char *pszZipFilename,
char **papszOptions );
252 char **papszOptions );
261 void CPL_DLL *CPLZLibDeflate(
const void* ptr,
size_t nBytes,
int nLevel,
262 void* outptr,
size_t nOutAvailableBytes,
263 size_t* pnOutBytes );
265 void* outptr,
size_t nOutAvailableBytes,
266 size_t* pnOutBytes );
271 int CPL_DLL CPLValidateXML(
const char* pszXMLFilename,
272 const char* pszXSDFilename,
273 char** papszOptions);
280 void CPLCleanupSetlocaleMutex(
void);
290 #if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
292 class CPL_DLL CPLLocaleC
302 CPLLocaleC(
const CPLLocaleC&);
303 CPLLocaleC& operator=(
const CPLLocaleC&);
310 class CPL_DLL CPLThreadLocaleC
317 #ifdef HAVE_USELOCALE
321 #if defined(_MSC_VER)
322 int nOldValConfigThreadLocale;
328 CPLThreadLocaleC(
const CPLThreadLocaleC&);
329 CPLThreadLocaleC& operator=(
const CPLThreadLocaleC&);
double CPL_DLL CPLAtofM(const char *)
Definition: cpl_strtod.cpp:142
void CPL_DLL CPLSetThreadLocalConfigOptions(const char *const *papszConfigOptions)
Definition: cpl_conv.cpp:1877
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:2955
int CPL_DLL CPLPrintString(char *, const char *, int)
Definition: cpl_conv.cpp:1178
GUIntBig CPL_DLL CPLScanUIntBig(const char *, int)
Definition: cpl_conv.cpp:921
int CPL_DLL CPLCopyFile(const char *pszNewPath, const char *pszOldPath)
Definition: cpl_conv.cpp:2568
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:501
int CPL_DLL CPLPrintInt32(char *, GInt32, int)
Definition: cpl_conv.cpp:1266
const char CPL_DLL * CPLResetExtension(const char *, const char *) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_path.cpp:422
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:1457
void CPL_DLL CPLSetConfigOptions(const char *const *papszConfigOptions)
Definition: cpl_conv.cpp:1698
int CPL_DLL CPLMoveFile(const char *pszNewPath, const char *pszOldPath)
Definition: cpl_conv.cpp:2708
unsigned long CPL_DLL CPLScanULong(const char *, int)
Definition: cpl_conv.cpp:891
const char CPL_DLL * CPLDefaultFindFile(const char *pszClass, const char *pszBasename)
Definition: cpl_findfile.cpp:149
int GInt32
Definition: cpl_port.h:197
GIntBig CPL_DLL CPLAtoGIntBigEx(const char *pszString, int bWarn, int *pbOverflow)
Definition: cpl_conv.cpp:1005
FILE VSILFILE
Definition: cpl_vsi.h:154
char CPL_DLL * CPLStrdup(const char *) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_conv.cpp:284
CPL_C_START const char CPL_DLL *CPL_STDCALL CPLGetConfigOption(const char *, const char *) CPL_WARN_UNUSED_RESULT
Definition: cpl_conv.cpp:1625
CPLSharedFileInfo CPL_DLL * CPLGetSharedList(int *)
Definition: cpl_conv.cpp:2424
char * CPLsetlocale(int category, const char *locale)
Definition: cpl_conv.cpp:2859
const char CPL_DLL * CPLReadLine(FILE *)
Definition: cpl_conv.cpp:559
double CPL_DLL CPLDecToPackedDMS(double dfDec)
Definition: cpl_conv.cpp:2181
void CPL_DLL * CPLCreateZip(const char *pszZipFilename, char **papszOptions)
Definition: cpl_conv.cpp:2947
double CPL_DLL CPLScanDouble(const char *, int)
Definition: cpl_conv.cpp:1126
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:1922
const char *(* CPLFileFinder)(const char *, const char *)
Definition: cpl_conv.h:183
void CPL_DLL CPL_STDCALL CPLSetThreadLocalConfigOption(const char *pszKey, const char *pszValue)
Definition: cpl_conv.cpp:1814
GIntBig CPL_DLL CPLAtoGIntBig(const char *pszString)
Definition: cpl_conv.cpp:953
int bLarge
Definition: cpl_conv.h:209
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:623
char CPL_DLL * CPLStrlwr(char *)
Definition: cpl_conv.cpp:316
const char CPL_DLL *CPL_STDCALL CPLGetThreadLocalConfigOption(const char *, const char *) CPL_WARN_UNUSED_RESULT
Definition: cpl_conv.cpp:1713
void CPL_DLL CPLFinderClean(void)
Definition: cpl_findfile.cpp:134
void CPL_DLL CPL_STDCALL CPLSetConfigOption(const char *, const char *)
Definition: cpl_conv.cpp:1765
FILE CPL_DLL * CPLOpenShared(const char *, const char *, int)
Definition: cpl_conv.cpp:2260
char CPL_DLL * CPLScanString(const char *, int, int, int)
Definition: cpl_conv.cpp:809
Definition: cpl_conv.h:206
const char CPL_DLL * CPLGenerateTempFilename(const char *pszStem) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_path.cpp:1067
const char CPL_DLL * CPLExpandTilde(const char *pszFilename) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_path.cpp:1110
char CPL_DLL * CPLFGets(char *, int, FILE *)
Definition: cpl_conv.cpp:357
char CPL_DLL ** CPLCorrespondingPaths(const char *pszOldFilename, const char *pszNewFilename, char **papszFileList) CPL_WARN_UNUSED_RESULT
Definition: cpl_path.cpp:962
const char CPL_DLL * CPLCleanTrailingSlash(const char *) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_path.cpp:911
char CPL_DLL * CPLGetCurrentDir(void)
Definition: cpl_path.cpp:387
void CPL_DLL * CPLMalloc(size_t) CPL_WARN_UNUSED_RESULT
Definition: cpl_conv.cpp:158
int CPL_DLL CPLPrintUIntBig(char *, GUIntBig, int)
Definition: cpl_conv.cpp:1305
char * pszAccess
Definition: cpl_conv.h:211
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:1355
FILE * fp
Definition: cpl_conv.h:207
CPLErr CPL_DLL CPLCloseZip(void *hZip)
Definition: cpl_conv.cpp:2961
int CPL_DLL CPLPrintStringFill(char *, const char *, int)
Definition: cpl_conv.cpp:1222
const char CPL_DLL * CPLExtractRelativePath(const char *, const char *, int *) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL
Definition: cpl_path.cpp:819
char CPL_DLL ** CPLGetConfigOptions(void)
Definition: cpl_conv.cpp:1672
void CPL_DLL CPLDumpSharedList(FILE *)
Definition: cpl_conv.cpp:2446
unsigned long long GUIntBig
Definition: cpl_port.h:253
double CPL_DLL CPLDMSToDec(const char *is)
Definition: cpl_conv.cpp:1971
int CPL_DLL CPLCopyTree(const char *pszNewPath, const char *pszOldPath)
Definition: cpl_conv.cpp:2630
int nRefCount
Definition: cpl_conv.h:208
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:2054
void CPL_DLL * CPLRealloc(void *, size_t) CPL_WARN_UNUSED_RESULT
Definition: cpl_conv.cpp:215
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:714
float CPL_DLL CPLStrtof(const char *, char **)
Definition: cpl_strtod.cpp:397
long CPL_DLL CPLScanLong(const char *, int)
Definition: cpl_conv.cpp:863
double CPL_DLL CPLStrtodDelim(const char *, char **, char)
Definition: cpl_strtod.cpp:231
#define CPL_WARN_UNUSED_RESULT
Definition: cpl_port.h:999
void CPL_DLL CPLStringToComplex(const char *pszString, double *pdfReal, double *pdfImag)
Definition: cpl_conv.cpp:2198
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:2484
#define CPL_RETURNS_NONNULL
Definition: cpl_port.h:1032
int CPL_DLL CPLCheckForFile(char *pszFilename, char **papszSiblingList)
Definition: cpl_conv.cpp:2909
long long GIntBig
Definition: cpl_port.h:250
char CPL_DLL ** CPLGetThreadLocalConfigOptions(void)
Definition: cpl_conv.cpp:1847
int CPL_DLL CPLSymlink(const char *pszOldPath, const char *pszNewPath, char **papszOptions)
Definition: cpl_conv.cpp:2729
CPLErr CPL_DLL CPLWriteFileInZip(void *hZip, const void *pBuffer, int nBufferSize)
Definition: cpl_conv.cpp:2957
void CPL_DLL * CPLCalloc(size_t, size_t) CPL_WARN_UNUSED_RESULT
Definition: cpl_conv.cpp:128
void CPL_DLL * CPLScanPointer(const char *, int)
Definition: cpl_conv.cpp:1060
char * pszFilename
Definition: cpl_conv.h:210
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:621
void CPL_DLL CPLCloseShared(FILE *)
Definition: cpl_conv.cpp:2333
double CPL_DLL CPLPackedDMSToDec(double)
Definition: cpl_conv.cpp:2147
CPLErr CPL_DLL CPLCloseFileInZip(void *hZip)
Definition: cpl_conv.cpp:2959
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:2972
int CPL_DLL CPLIsFilenameRelative(const char *pszFilename)
Definition: cpl_path.cpp:778
void CPL_DLL * CPLGetSymbol(const char *, const char *)
Definition: cplgetsymbol.cpp:89
CPLErr
Definition: cpl_error.h:52