00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef CPL_CONV_H_INCLUDED
00033 #define CPL_CONV_H_INCLUDED
00034
00035 #include "cpl_port.h"
00036 #include "cpl_vsi.h"
00037 #include "cpl_error.h"
00038
00046
00047
00048
00049 CPL_C_START
00050
00051 void CPL_DLL CPLVerifyConfiguration(void);
00052
00053 const char CPL_DLL * CPL_STDCALL
00054 CPLGetConfigOption( const char *, const char * ) CPL_WARN_UNUSED_RESULT;
00055 void CPL_DLL CPL_STDCALL CPLSetConfigOption( const char *, const char * );
00056 void CPL_DLL CPL_STDCALL CPLSetThreadLocalConfigOption( const char *pszKey,
00057 const char *pszValue );
00058 void CPL_DLL CPL_STDCALL CPLFreeConfig(void);
00059
00060
00061
00062
00063
00064 void CPL_DLL *CPLMalloc( size_t ) CPL_WARN_UNUSED_RESULT;
00065 void CPL_DLL *CPLCalloc( size_t, size_t ) CPL_WARN_UNUSED_RESULT;
00066 void CPL_DLL *CPLRealloc( void *, size_t ) CPL_WARN_UNUSED_RESULT;
00067 char CPL_DLL *CPLStrdup( const char * ) CPL_WARN_UNUSED_RESULT;
00068 char CPL_DLL *CPLStrlwr( char *);
00069
00070 #define CPLFree VSIFree
00071
00072
00073
00074
00075 char CPL_DLL *CPLFGets( char *, int, FILE *);
00076 const char CPL_DLL *CPLReadLine( FILE * );
00077 const char CPL_DLL *CPLReadLineL( VSILFILE * );
00078 const char CPL_DLL *CPLReadLine2L( VSILFILE * , int nMaxCols, char** papszOptions);
00079
00080
00081
00082
00083
00084 double CPL_DLL CPLAtof(const char *);
00085 double CPL_DLL CPLAtofDelim(const char *, char);
00086 double CPL_DLL CPLStrtod(const char *, char **);
00087 double CPL_DLL CPLStrtodDelim(const char *, char **, char);
00088 float CPL_DLL CPLStrtof(const char *, char **);
00089 float CPL_DLL CPLStrtofDelim(const char *, char **, char);
00090
00091
00092
00093
00094
00095 double CPL_DLL CPLAtofM(const char *);
00096
00097
00098
00099
00100 char CPL_DLL *CPLScanString( const char *, int, int, int );
00101 double CPL_DLL CPLScanDouble( const char *, int );
00102 long CPL_DLL CPLScanLong( const char *, int );
00103 unsigned long CPL_DLL CPLScanULong( const char *, int );
00104 GUIntBig CPL_DLL CPLScanUIntBig( const char *, int );
00105 GIntBig CPL_DLL CPLAtoGIntBig( const char* pszString );
00106 GIntBig CPL_DLL CPLAtoGIntBigEx( const char* pszString, int bWarn, int *pbOverflow );
00107 void CPL_DLL *CPLScanPointer( const char *, int );
00108
00109
00110
00111
00112 int CPL_DLL CPLPrintString( char *, const char *, int );
00113 int CPL_DLL CPLPrintStringFill( char *, const char *, int );
00114 int CPL_DLL CPLPrintInt32( char *, GInt32 , int );
00115 int CPL_DLL CPLPrintUIntBig( char *, GUIntBig , int );
00116 int CPL_DLL CPLPrintDouble( char *, const char *, double, const char * );
00117 int CPL_DLL CPLPrintTime( char *, int , const char *, const struct tm *,
00118 const char * );
00119 int CPL_DLL CPLPrintPointer( char *, void *, int );
00120
00121
00122
00123
00124
00125 void CPL_DLL *CPLGetSymbol( const char *, const char * );
00126
00127
00128
00129
00130 int CPL_DLL CPLGetExecPath( char *pszPathBuf, int nMaxLength );
00131
00132
00133
00134
00135 const char CPL_DLL *CPLGetPath( const char * );
00136 const char CPL_DLL *CPLGetDirname( const char * );
00137 const char CPL_DLL *CPLGetFilename( const char * );
00138 const char CPL_DLL *CPLGetBasename( const char * );
00139 const char CPL_DLL *CPLGetExtension( const char * );
00140 char CPL_DLL *CPLGetCurrentDir(void);
00141 const char CPL_DLL *CPLFormFilename( const char *pszPath,
00142 const char *pszBasename,
00143 const char *pszExtension );
00144 const char CPL_DLL *CPLFormCIFilename( const char *pszPath,
00145 const char *pszBasename,
00146 const char *pszExtension );
00147 const char CPL_DLL *CPLResetExtension( const char *, const char * );
00148 const char CPL_DLL *CPLProjectRelativeFilename( const char *pszProjectDir,
00149 const char *pszSecondaryFilename );
00150 int CPL_DLL CPLIsFilenameRelative( const char *pszFilename );
00151 const char CPL_DLL *CPLExtractRelativePath(const char *, const char *, int *);
00152 const char CPL_DLL *CPLCleanTrailingSlash( const char * );
00153 char CPL_DLL **CPLCorrespondingPaths( const char *pszOldFilename,
00154 const char *pszNewFilename,
00155 char **papszFileList );
00156 int CPL_DLL CPLCheckForFile( char *pszFilename, char **papszSiblingList );
00157
00158 const char CPL_DLL *CPLGenerateTempFilename( const char *pszStem );
00159
00160
00161
00162
00163 typedef const char *(*CPLFileFinder)(const char *, const char *);
00164
00165 const char CPL_DLL *CPLFindFile(const char *pszClass,
00166 const char *pszBasename);
00167 const char CPL_DLL *CPLDefaultFindFile(const char *pszClass,
00168 const char *pszBasename);
00169 void CPL_DLL CPLPushFileFinder( CPLFileFinder pfnFinder );
00170 CPLFileFinder CPL_DLL CPLPopFileFinder(void);
00171 void CPL_DLL CPLPushFinderLocation( const char * );
00172 void CPL_DLL CPLPopFinderLocation(void);
00173 void CPL_DLL CPLFinderClean(void);
00174
00175
00176
00177
00178 int CPL_DLL CPLStat( const char *, VSIStatBuf * );
00179
00180
00181
00182
00183
00184 typedef struct {
00185 FILE *fp;
00186 int nRefCount;
00187 int bLarge;
00188 char *pszFilename;
00189 char *pszAccess;
00190 } CPLSharedFileInfo;
00191
00192 FILE CPL_DLL *CPLOpenShared( const char *, const char *, int );
00193 void CPL_DLL CPLCloseShared( FILE * );
00194 CPLSharedFileInfo CPL_DLL *CPLGetSharedList( int * );
00195 void CPL_DLL CPLDumpSharedList( FILE * );
00196 void CPL_DLL CPLCleanupSharedFileMutex( void );
00197
00198
00199
00200
00201 double CPL_DLL CPLDMSToDec( const char *is );
00202 const char CPL_DLL *CPLDecToDMS( double dfAngle, const char * pszAxis,
00203 int nPrecision );
00204 double CPL_DLL CPLPackedDMSToDec( double );
00205 double CPL_DLL CPLDecToPackedDMS( double dfDec );
00206
00207 void CPL_DLL CPLStringToComplex( const char *pszString,
00208 double *pdfReal, double *pdfImag );
00209
00210
00211
00212
00213 int CPL_DLL CPLUnlinkTree( const char * );
00214 int CPL_DLL CPLCopyFile( const char *pszNewPath, const char *pszOldPath );
00215 int CPL_DLL CPLCopyTree( const char *pszNewPath, const char *pszOldPath );
00216 int CPL_DLL CPLMoveFile( const char *pszNewPath, const char *pszOldPath );
00217
00218
00219
00220
00221 #define CPL_ZIP_API_OFFERED
00222 void CPL_DLL *CPLCreateZip( const char *pszZipFilename, char **papszOptions );
00223 CPLErr CPL_DLL CPLCreateFileInZip( void *hZip, const char *pszFilename,
00224 char **papszOptions );
00225 CPLErr CPL_DLL CPLWriteFileInZip( void *hZip, const void *pBuffer, int nBufferSize );
00226 CPLErr CPL_DLL CPLCloseFileInZip( void *hZip );
00227 CPLErr CPL_DLL CPLCloseZip( void *hZip );
00228
00229
00230
00231
00232
00233 void CPL_DLL *CPLZLibDeflate( const void* ptr, size_t nBytes, int nLevel,
00234 void* outptr, size_t nOutAvailableBytes,
00235 size_t* pnOutBytes );
00236 void CPL_DLL *CPLZLibInflate( const void* ptr, size_t nBytes,
00237 void* outptr, size_t nOutAvailableBytes,
00238 size_t* pnOutBytes );
00239
00240
00241
00242
00243 int CPL_DLL CPLValidateXML(const char* pszXMLFilename,
00244 const char* pszXSDFilename,
00245 char** papszOptions);
00246
00247
00248
00249
00250 char* CPLsetlocale (int category, const char* locale);
00251 void CPLCleanupSetlocaleMutex(void);
00252
00253 CPL_C_END
00254
00255
00256
00257
00258
00259 #if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
00260
00261 class CPL_DLL CPLLocaleC
00262 {
00263 public:
00264 CPLLocaleC();
00265 ~CPLLocaleC();
00266
00267 private:
00268 char *pszOldLocale;
00269
00270
00271 CPLLocaleC(CPLLocaleC&);
00272 CPLLocaleC& operator=(CPLLocaleC&);
00273 };
00274
00275 #endif
00276
00277
00278 #endif