32 #ifndef CPL_CONV_H_INCLUDED 33 #define CPL_CONV_H_INCLUDED 51 void CPL_DLL CPLVerifyConfiguration(
void);
53 const char CPL_DLL * CPL_STDCALL
57 const
char *pszValue );
58 void CPL_DLL CPL_STDCALL CPLFreeConfig(
void);
64 void CPL_DLL *
CPLMalloc(
size_t ) CPL_WARN_UNUSED_RESULT;
65 void CPL_DLL *
CPLCalloc(
size_t,
size_t ) CPL_WARN_UNUSED_RESULT;
66 void CPL_DLL *
CPLRealloc(
void *,
size_t ) CPL_WARN_UNUSED_RESULT;
67 char CPL_DLL *
CPLStrdup( const
char * ) CPL_WARN_UNUSED_RESULT;
70 #define CPLFree VSIFree 75 char CPL_DLL *
CPLFGets(
char *,
int, FILE *);
78 const char CPL_DLL *
CPLReadLine2L( VSILFILE * ,
int nMaxCols,
char** papszOptions);
84 double CPL_DLL
CPLAtof(
const char *);
86 double CPL_DLL
CPLStrtod(
const char *,
char **);
88 float CPL_DLL
CPLStrtof(
const char *,
char **);
95 double CPL_DLL
CPLAtofM(
const char *);
103 unsigned long CPL_DLL
CPLScanULong(
const char *,
int );
114 int CPL_DLL
CPLPrintDouble(
char *,
const char *,
double,
const char * );
115 int CPL_DLL
CPLPrintTime(
char *,
int ,
const char *,
const struct tm *,
123 void CPL_DLL *
CPLGetSymbol(
const char *,
const char * );
128 int CPL_DLL CPLGetExecPath(
char *pszPathBuf,
int nMaxLength );
133 const char CPL_DLL *
CPLGetPath(
const char * );
140 const char *pszBasename,
141 const char *pszExtension );
143 const char *pszBasename,
144 const char *pszExtension );
147 const char *pszSecondaryFilename );
152 const char *pszNewFilename,
153 char **papszFileList );
154 int CPL_DLL
CPLCheckForFile(
char *pszFilename,
char **papszSiblingList );
161 typedef const char *(*CPLFileFinder)(
const char *,
const char *);
163 const char CPL_DLL *CPLFindFile(
const char *pszClass,
164 const char *pszBasename);
165 const char CPL_DLL *CPLDefaultFindFile(
const char *pszClass,
166 const char *pszBasename);
167 void CPL_DLL CPLPushFileFinder( CPLFileFinder pfnFinder );
168 CPLFileFinder CPL_DLL CPLPopFileFinder(
void);
169 void CPL_DLL CPLPushFinderLocation(
const char * );
170 void CPL_DLL CPLPopFinderLocation(
void);
171 void CPL_DLL CPLFinderClean(
void);
176 int CPL_DLL CPLStat(
const char *, VSIStatBuf * );
190 FILE CPL_DLL *
CPLOpenShared(
const char *,
const char *,
int );
194 void CPL_DLL CPLCleanupSharedFileMutex(
void );
199 double CPL_DLL CPLDMSToDec(
const char *is );
200 const char CPL_DLL *CPLDecToDMS(
double dfAngle,
const char * pszAxis,
205 void CPL_DLL CPLStringToComplex(
const char *pszString,
206 double *pdfReal,
double *pdfImag );
212 int CPL_DLL CPLCopyFile(
const char *pszNewPath,
const char *pszOldPath );
213 int CPL_DLL CPLMoveFile(
const char *pszNewPath,
const char *pszOldPath );
218 #define CPL_ZIP_API_OFFERED 219 void CPL_DLL *CPLCreateZip(
const char *pszZipFilename,
char **papszOptions );
220 CPLErr CPL_DLL CPLCreateFileInZip(
void *hZip,
const char *pszFilename,
221 char **papszOptions );
222 CPLErr CPL_DLL CPLWriteFileInZip(
void *hZip,
const void *pBuffer,
int nBufferSize );
223 CPLErr CPL_DLL CPLCloseFileInZip(
void *hZip );
224 CPLErr CPL_DLL CPLCloseZip(
void *hZip );
230 void CPL_DLL *CPLZLibDeflate(
const void* ptr,
size_t nBytes,
int nLevel,
231 void* outptr,
size_t nOutAvailableBytes,
232 size_t* pnOutBytes );
234 void* outptr,
size_t nOutAvailableBytes,
235 size_t* pnOutBytes );
240 int CPL_DLL CPLValidateXML(
const char* pszXMLFilename,
241 const char* pszXSDFilename,
242 char** papszOptions);
248 void CPLCleanupSetlocaleMutex(
void);
256 #if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS) int CPLIsFilenameRelative(const char *pszFilename)
Is filename relative or absolute?
Definition: cpl_path.cpp:686
const char * CPLProjectRelativeFilename(const char *pszProjectDir, const char *pszSecondaryFilename)
Find a file relative to a project file.
Definition: cpl_path.cpp:629
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:1065
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:460
void * CPLRealloc(void *, size_t) CPL_WARN_UNUSED_RESULT
Safe version of realloc().
Definition: cpl_conv.cpp:181
double CPLDecToPackedDMS(double dfDec)
Convert decimal degrees into packed DMS value (DDDMMMSSS.SS).
Definition: cpl_conv.cpp:1949
const char * CPLExtractRelativePath(const char *, const char *, int *)
Get relative path from directory to target file.
Definition: cpl_path.cpp:726
char * CPLStrdup(const char *) CPL_WARN_UNUSED_RESULT
Safe version of strdup() function.
Definition: cpl_conv.cpp:247
int CPLPrintDouble(char *, const char *, double, const char *)
Print double value into specified string buffer.
Definition: cpl_conv.cpp:1284
const char * CPLGetConfigOption(const char *, const char *) CPL_WARN_UNUSED_RESULT
Get the value of a configuration option.
Definition: cpl_conv.cpp:1547
const char * CPLFormCIFilename(const char *pszPath, const char *pszBasename, const char *pszExtension)
Case insensitive file searching, returing full path.
Definition: cpl_path.cpp:534
Core portability definitions for CPL.
const char * CPLResetExtension(const char *, const char *)
Replace the extension with the provided one.
Definition: cpl_path.cpp:388
void * CPLMalloc(size_t) CPL_WARN_UNUSED_RESULT
Safe version of malloc().
Definition: cpl_conv.cpp:118
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:1109
int CPLPrintPointer(char *, void *, int)
Print pointer value into specified string buffer.
Definition: cpl_conv.cpp:1235
double CPLAtof(const char *)
Converts ASCII string to floating point number.
Definition: cpl_strtod.cpp:137
void * CPLGetSymbol(const char *, const char *)
Fetch a function pointer from a shared library / DLL.
Definition: cplgetsymbol.cpp:84
char * CPLsetlocale(int category, const char *locale)
Prevents parallel executions of setlocale().
Definition: cpl_conv.cpp:2468
const char * CPLReadLine(FILE *)
Simplified line reading from text file.
Definition: cpl_conv.cpp:518
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:2594
float CPLStrtof(const char *, char **)
Converts ASCII string to floating point number.
Definition: cpl_strtod.cpp:400
char * CPLStrlwr(char *)
Convert each characters of the string to lower case.
Definition: cpl_conv.cpp:282
void CPLSetThreadLocalConfigOption(const char *pszKey, const char *pszValue)
Set a configuration option for GDAL/OGR use.
Definition: cpl_conv.cpp:1654
double CPLStrtodDelim(const char *, char **, char)
Converts ASCII string to floating point number using specified delimiter.
Definition: cpl_strtod.cpp:247
int CPLUnlinkTree(const char *)
Definition: cpl_conv.cpp:2243
const char * CPLReadLineL(VSILFILE *)
Simplified line reading from text file.
Definition: cpl_conv.cpp:583
CPLSharedFileInfo * CPLGetSharedList(int *)
Fetch list of open shared files.
Definition: cpl_conv.cpp:2182
const char * CPLGetDirname(const char *)
Extract directory path portion of filename.
Definition: cpl_path.cpp:182
float CPLStrtofDelim(const char *, char **, char)
Converts ASCII string to floating point number using specified delimiter.
Definition: cpl_strtod.cpp:345
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:1374
Definition: cpl_conv.h:182
FILE * CPLOpenShared(const char *, const char *, int)
Open a shared file handle.
Definition: cpl_conv.cpp:2027
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:323
int CPLCheckForFile(char *pszFilename, char **papszSiblingList)
Check for file existence.
Definition: cpl_conv.cpp:2513
CPL error handling services.
void CPLDumpSharedList(FILE *)
Report open shared files.
Definition: cpl_conv.cpp:2204
Definition: cpl_conv.h:258
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:864
const char * CPLReadLine2L(VSILFILE *, int nMaxCols, char **papszOptions)
Simplified line reading from text file.
Definition: cpl_conv.cpp:608
const char * CPLGetPath(const char *)
Extract directory path portion of filename.
Definition: cpl_path.cpp:129
void * CPLScanPointer(const char *, int)
Extract pointer from string.
Definition: cpl_conv.cpp:950
double CPLStrtod(const char *, char **)
Converts ASCII string to floating point number.
Definition: cpl_strtod.cpp:319
const char * CPLGenerateTempFilename(const char *pszStem)
Generate temporary file name.
Definition: cpl_path.cpp:979
GUIntBig CPLScanUIntBig(const char *, int)
Extract big integer from string.
Definition: cpl_conv.cpp:904
char * CPLGetCurrentDir(void)
Get the current working directory name.
Definition: cpl_path.cpp:348
int CPLPrintInt32(char *, GInt32, int)
Print GInt32 value into specified string buffer.
Definition: cpl_conv.cpp:1154
void CPLSetConfigOption(const char *, const char *)
Set a configuration option for GDAL/OGR use.
Definition: cpl_conv.cpp:1609
double CPLScanDouble(const char *, int)
Extract double from string.
Definition: cpl_conv.cpp:1018
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:825
const char * CPLGetBasename(const char *)
Extract basename (non-directory, non-extension) portion of filename.
Definition: cpl_path.cpp:263
void * CPLCalloc(size_t, size_t) CPL_WARN_UNUSED_RESULT
Safe version of calloc().
Definition: cpl_conv.cpp:86
double CPLAtofM(const char *)
Converts ASCII string to floating point number using any numeric locale.
Definition: cpl_strtod.cpp:162
double CPLAtofDelim(const char *, char)
Converts ASCII string to floating point number.
Definition: cpl_strtod.cpp:95
const char * CPLGetExtension(const char *)
Extract filename extension from full filename.
Definition: cpl_path.cpp:313
const char * CPLGetFilename(const char *)
Extract non-directory portion of filename.
Definition: cpl_path.cpp:231
int CPLPrintUIntBig(char *, GUIntBig, int)
Print GUIntBig value into specified string buffer.
Definition: cpl_conv.cpp:1193
double CPLPackedDMSToDec(double)
Convert a packed DMS value (DDDMMMSSS.SS) into decimal degrees.
Definition: cpl_conv.cpp:1913
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:769
char ** CPLCorrespondingPaths(const char *pszOldFilename, const char *pszNewFilename, char **papszFileList)
Identify corresponding paths.
Definition: cpl_path.cpp:869
void CPLCloseShared(FILE *)
Close shared file.
Definition: cpl_conv.cpp:2102
const char * CPLCleanTrailingSlash(const char *)
Remove trailing forward/backward slash from the path for unix/windows resp.
Definition: cpl_path.cpp:820