31 #ifndef CPL_CONV_H_INCLUDED
32 #define CPL_CONV_H_INCLUDED
50 void CPL_DLL CPLVerifyConfiguration(
void);
52 const char CPL_DLL * CPL_STDCALL
56 const
char *pszValue );
57 void CPL_DLL CPL_STDCALL CPLFreeConfig(
void);
63 void CPL_DLL *
CPLMalloc(
size_t ) CPL_WARN_UNUSED_RESULT;
64 void CPL_DLL *
CPLCalloc(
size_t,
size_t ) CPL_WARN_UNUSED_RESULT;
65 void CPL_DLL *
CPLRealloc(
void *,
size_t ) CPL_WARN_UNUSED_RESULT;
66 char CPL_DLL *
CPLStrdup( const
char * ) CPL_WARN_UNUSED_RESULT;
69 #define CPLFree VSIFree
74 char CPL_DLL *
CPLFGets(
char *,
int, FILE *);
77 const char CPL_DLL *
CPLReadLine2L( VSILFILE * ,
int nMaxCols,
char** papszOptions);
83 double CPL_DLL
CPLAtof(
const char *);
85 double CPL_DLL
CPLStrtod(
const char *,
char **);
87 float CPL_DLL
CPLStrtof(
const char *,
char **);
94 double CPL_DLL
CPLAtofM(
const char *);
102 unsigned long CPL_DLL
CPLScanULong(
const char *,
int );
113 int CPL_DLL
CPLPrintDouble(
char *,
const char *,
double,
const char * );
114 int CPL_DLL
CPLPrintTime(
char *,
int ,
const char *,
const struct tm *,
122 void CPL_DLL *
CPLGetSymbol(
const char *,
const char * );
132 const char CPL_DLL *
CPLGetPath(
const char * );
139 const char *pszBasename,
140 const char *pszExtension );
142 const char *pszBasename,
143 const char *pszExtension );
146 const char *pszSecondaryFilename );
151 const char *pszNewFilename,
152 char **papszFileList );
153 int CPL_DLL
CPLCheckForFile(
char *pszFilename,
char **papszSiblingList );
160 typedef const char *(*CPLFileFinder)(
const char *,
const char *);
162 const char CPL_DLL *CPLFindFile(
const char *pszClass,
163 const char *pszBasename);
164 const char CPL_DLL *CPLDefaultFindFile(
const char *pszClass,
165 const char *pszBasename);
166 void CPL_DLL CPLPushFileFinder( CPLFileFinder pfnFinder );
167 CPLFileFinder CPL_DLL CPLPopFileFinder(
void);
168 void CPL_DLL CPLPushFinderLocation(
const char * );
169 void CPL_DLL CPLPopFinderLocation(
void);
170 void CPL_DLL CPLFinderClean(
void);
175 int CPL_DLL CPLStat(
const char *, VSIStatBuf * );
189 FILE CPL_DLL *
CPLOpenShared(
const char *,
const char *,
int );
193 void CPL_DLL CPLCleanupSharedFileMutex();
198 double CPL_DLL CPLDMSToDec(
const char *is );
199 const char CPL_DLL *CPLDecToDMS(
double dfAngle,
const char * pszAxis,
204 void CPL_DLL CPLStringToComplex(
const char *pszString,
205 double *pdfReal,
double *pdfImag );
211 int CPL_DLL CPLCopyFile(
const char *pszNewPath,
const char *pszOldPath );
212 int CPL_DLL CPLMoveFile(
const char *pszNewPath,
const char *pszOldPath );
217 #define CPL_ZIP_API_OFFERED
218 void CPL_DLL *CPLCreateZip(
const char *pszZipFilename,
char **papszOptions );
219 CPLErr CPL_DLL CPLCreateFileInZip(
void *hZip,
const char *pszFilename,
220 char **papszOptions );
221 CPLErr CPL_DLL CPLWriteFileInZip(
void *hZip,
const void *pBuffer,
int nBufferSize );
222 CPLErr CPL_DLL CPLCloseFileInZip(
void *hZip );
223 CPLErr CPL_DLL CPLCloseZip(
void *hZip );
229 void CPL_DLL *
CPLZLibDeflate(
const void* ptr,
size_t nBytes,
int nLevel,
230 void* outptr,
size_t nOutAvailableBytes,
231 size_t* pnOutBytes );
233 void* outptr,
size_t nOutAvailableBytes,
234 size_t* pnOutBytes );
239 int CPL_DLL CPLValidateXML(
const char* pszXMLFilename,
240 const char* pszXSDFilename,
241 char** papszOptions);
249 #if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
int CPLIsFilenameRelative(const char *pszFilename)
Is filename relative or absolute?
Definition: cpl_path.cpp:683
const char * CPLProjectRelativeFilename(const char *pszProjectDir, const char *pszSecondaryFilename)
Find a file relative to a project file.
Definition: cpl_path.cpp:626
int CPLPrintString(char *, const char *, int)
Copy the string pointed to by pszSrc, NOT including the terminating `\0' character, to the array pointed to by pszDest.
Definition: cpl_conv.cpp:1061
const char * CPLFormFilename(const char *pszPath, const char *pszBasename, const char *pszExtension)
Build a full file path from a passed path, file basename and extension.
Definition: cpl_path.cpp:459
void * CPLRealloc(void *, size_t) CPL_WARN_UNUSED_RESULT
Safe version of realloc().
Definition: cpl_conv.cpp:177
double CPLDecToPackedDMS(double dfDec)
Convert decimal degrees into packed DMS value (DDDMMMSSS.SS).
Definition: cpl_conv.cpp:1934
const char * CPLExtractRelativePath(const char *, const char *, int *)
Get relative path from directory to target file.
Definition: cpl_path.cpp:723
char * CPLStrdup(const char *) CPL_WARN_UNUSED_RESULT
Safe version of strdup() function.
Definition: cpl_conv.cpp:243
int CPLPrintDouble(char *, const char *, double, const char *)
Print double value into specified string buffer.
Definition: cpl_conv.cpp:1280
const char * CPLGetConfigOption(const char *, const char *) CPL_WARN_UNUSED_RESULT
Get the value of a configuration option.
Definition: cpl_conv.cpp:1543
const char * CPLFormCIFilename(const char *pszPath, const char *pszBasename, const char *pszExtension)
Case insensitive file searching, returing full path.
Definition: cpl_path.cpp:531
Core portability definitions for CPL.
const char * CPLResetExtension(const char *, const char *)
Replace the extension with the provided one.
Definition: cpl_path.cpp:387
void * CPLMalloc(size_t) CPL_WARN_UNUSED_RESULT
Safe version of malloc().
Definition: cpl_conv.cpp:114
int CPLPrintStringFill(char *, const char *, int)
Copy the string pointed to by pszSrc, NOT including the terminating `\0' character, to the array pointed to by pszDest.
Definition: cpl_conv.cpp:1105
int CPLPrintPointer(char *, void *, int)
Print pointer value into specified string buffer.
Definition: cpl_conv.cpp:1231
double CPLAtof(const char *)
Converts ASCII string to floating point number.
Definition: cpl_strtod.cpp:136
void * CPLGetSymbol(const char *, const char *)
Fetch a function pointer from a shared library / DLL.
Definition: cplgetsymbol.cpp:83
int CPLGetExecPath(char *pszPathBuf, int nMaxLength)
Fetch path of executable.
Definition: cpl_getexecpath.cpp:138
const char * CPLReadLine(FILE *)
Simplified line reading from text file.
Definition: cpl_conv.cpp:514
void * 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:2537
float CPLStrtof(const char *, char **)
Converts ASCII string to floating point number.
Definition: cpl_strtod.cpp:399
char * CPLStrlwr(char *)
Convert each characters of the string to lower case.
Definition: cpl_conv.cpp:278
void CPLSetThreadLocalConfigOption(const char *pszKey, const char *pszValue)
Set a configuration option for GDAL/OGR use.
Definition: cpl_conv.cpp:1640
double CPLStrtodDelim(const char *, char **, char)
Converts ASCII string to floating point number using specified delimiter.
Definition: cpl_strtod.cpp:246
int CPLUnlinkTree(const char *)
Definition: cpl_conv.cpp:2228
const char * CPLReadLineL(VSILFILE *)
Simplified line reading from text file.
Definition: cpl_conv.cpp:579
CPLSharedFileInfo * CPLGetSharedList(int *)
Fetch list of open shared files.
Definition: cpl_conv.cpp:2167
const char * CPLGetDirname(const char *)
Extract directory path portion of filename.
Definition: cpl_path.cpp:181
float CPLStrtofDelim(const char *, char **, char)
Converts ASCII string to floating point number using specified delimiter.
Definition: cpl_strtod.cpp:344
int CPLPrintTime(char *, int, const char *, const struct tm *, const char *)
Print specified time value accordingly to the format options and specified locale name...
Definition: cpl_conv.cpp:1370
Definition: cpl_conv.h:181
FILE * CPLOpenShared(const char *, const char *, int)
Open a shared file handle.
Definition: cpl_conv.cpp:2012
char * CPLFGets(char *, int, FILE *)
Reads in at most one less than nBufferSize characters from the fp stream and stores them into the buf...
Definition: cpl_conv.cpp:319
int CPLCheckForFile(char *pszFilename, char **papszSiblingList)
Check for file existance.
Definition: cpl_conv.cpp:2456
CPL error handling services.
void CPLDumpSharedList(FILE *)
Report open shared files.
Definition: cpl_conv.cpp:2189
Definition: cpl_conv.h:251
unsigned long CPLScanULong(const char *, int)
Scan up to a maximum number of characters from a string and convert the result to a unsigned long...
Definition: cpl_conv.cpp:860
const char * CPLReadLine2L(VSILFILE *, int nMaxCols, char **papszOptions)
Simplified line reading from text file.
Definition: cpl_conv.cpp:604
const char * CPLGetPath(const char *)
Extract directory path portion of filename.
Definition: cpl_path.cpp:128
void * CPLScanPointer(const char *, int)
Extract pointer from string.
Definition: cpl_conv.cpp:946
double CPLStrtod(const char *, char **)
Converts ASCII string to floating point number.
Definition: cpl_strtod.cpp:318
const char * CPLGenerateTempFilename(const char *pszStem)
Generate temporary file name.
Definition: cpl_path.cpp:976
GUIntBig CPLScanUIntBig(const char *, int)
Extract big integer from string.
Definition: cpl_conv.cpp:900
char * CPLGetCurrentDir(void)
Get the current working directory name.
Definition: cpl_path.cpp:347
int CPLPrintInt32(char *, GInt32, int)
Print GInt32 value into specified string buffer.
Definition: cpl_conv.cpp:1150
void CPLSetConfigOption(const char *, const char *)
Set a configuration option for GDAL/OGR use.
Definition: cpl_conv.cpp:1605
double CPLScanDouble(const char *, int)
Extract double from string.
Definition: cpl_conv.cpp:1014
long CPLScanLong(const char *, int)
Scan up to a maximum number of characters from a string and convert the result to a long...
Definition: cpl_conv.cpp:821
const char * CPLGetBasename(const char *)
Extract basename (non-directory, non-extension) portion of filename.
Definition: cpl_path.cpp:262
void * CPLCalloc(size_t, size_t) CPL_WARN_UNUSED_RESULT
Safe version of calloc().
Definition: cpl_conv.cpp:82
double CPLAtofM(const char *)
Converts ASCII string to floating point number using any numeric locale.
Definition: cpl_strtod.cpp:161
double CPLAtofDelim(const char *, char)
Converts ASCII string to floating point number.
Definition: cpl_strtod.cpp:94
const char * CPLGetExtension(const char *)
Extract filename extension from full filename.
Definition: cpl_path.cpp:312
const char * CPLGetFilename(const char *)
Extract non-directory portion of filename.
Definition: cpl_path.cpp:230
int CPLPrintUIntBig(char *, GUIntBig, int)
Print GUIntBig value into specified string buffer.
Definition: cpl_conv.cpp:1189
double CPLPackedDMSToDec(double)
Convert a packed DMS value (DDDMMMSSS.SS) into decimal degrees.
Definition: cpl_conv.cpp:1898
void * CPLZLibDeflate(const void *ptr, size_t nBytes, int nLevel, void *outptr, size_t nOutAvailableBytes, size_t *pnOutBytes)
Compress a buffer with ZLib DEFLATE compression.
Definition: cpl_conv.cpp:2528
char * CPLScanString(const char *, int, int, int)
Scan up to a maximum number of characters from a given string, allocate a buffer for a new string and...
Definition: cpl_conv.cpp:765
char ** CPLCorrespondingPaths(const char *pszOldFilename, const char *pszNewFilename, char **papszFileList)
Identify corresponding paths.
Definition: cpl_path.cpp:866
void CPLCloseShared(FILE *)
Close shared file.
Definition: cpl_conv.cpp:2087
const char * CPLCleanTrailingSlash(const char *)
Remove trailing forward/backward slash from the path for unix/windows resp.
Definition: cpl_path.cpp:817