GDAL

cpl_vsi.h
Go to the documentation of this file.
1 /******************************************************************************
2 * $Id$
3 *
4 * Project: CPL - Common Portability Library
5 * Author: Frank Warmerdam, warmerdam@pobox.com
6 * Purpose: Include file defining Virtual File System (VSI) functions, a
7 * layer over POSIX file and other system services.
8 *
9 ******************************************************************************
10 * Copyright (c) 1998, Frank Warmerdam
11 * Copyright (c) 2008-2014, Even Rouault <even dot rouault at spatialys.com>
12 *
13 * Permission is hereby granted, free of charge, to any person obtaining a
14 * copy of this software and associated documentation files (the "Software"),
15 * to deal in the Software without restriction, including without limitation
16 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 * and/or sell copies of the Software, and to permit persons to whom the
18 * Software is furnished to do so, subject to the following conditions:
19 *
20 * The above copyright notice and this permission notice shall be included
21 * in all copies or substantial portions of the Software.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 * DEALINGS IN THE SOFTWARE.
30 ****************************************************************************/
31
32 #ifndef CPL_VSI_H_INCLUDED
33 #define CPL_VSI_H_INCLUDED
34
35 #include "cpl_port.h"
36 #include "cpl_progress.h"
37
56 /* -------------------------------------------------------------------- */
57 /* We need access to ``struct stat''. */
58 /* -------------------------------------------------------------------- */
59
60 /* Unix */
61 #if !defined(_WIN32)
62 # include <unistd.h>
63 #endif
64
65 /* Windows */
66 #include <sys/stat.h>
67
68 CPL_C_START
69
71 #ifdef ENABLE_EXPERIMENTAL_CPL_WARN_UNUSED_RESULT
72 #define EXPERIMENTAL_CPL_WARN_UNUSED_RESULT CPL_WARN_UNUSED_RESULT
73 #else
74 #define EXPERIMENTAL_CPL_WARN_UNUSED_RESULT
75 #endif
78 /* ==================================================================== */
79 /* stdio file access functions. These do not support large */
80 /* files, and do not go through the virtualization API. */
81 /* ==================================================================== */
82
85 FILE CPL_DLL * VSIFOpen( const char *, const char * ) CPL_WARN_UNUSED_RESULT;
86 int CPL_DLL VSIFClose( FILE * );
87 int CPL_DLL VSIFSeek( FILE *, long, int ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
88 long CPL_DLL VSIFTell( FILE * ) CPL_WARN_UNUSED_RESULT;
89 void CPL_DLL VSIRewind( FILE * );
90 void CPL_DLL VSIFFlush( FILE * );
91
92 size_t CPL_DLL VSIFRead( void *, size_t, size_t, FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
93 size_t CPL_DLL VSIFWrite( const void *, size_t, size_t, FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
94 char CPL_DLL *VSIFGets( char *, int, FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
95 int CPL_DLL VSIFPuts( const char *, FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
96 int CPL_DLL VSIFPrintf( FILE *, CPL_FORMAT_STRING(const char *), ... ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT CPL_PRINT_FUNC_FORMAT(2, 3);
97
98 int CPL_DLL VSIFGetc( FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
99 int CPL_DLL VSIFPutc( int, FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
100 int CPL_DLL VSIUngetc( int, FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
101 int CPL_DLL VSIFEof( FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
102
105 /* ==================================================================== */
106 /* VSIStat() related. */
107 /* ==================================================================== */
108
110 typedef struct stat VSIStatBuf;
111 int CPL_DLL VSIStat( const char *, VSIStatBuf * ) CPL_WARN_UNUSED_RESULT;
114 #ifdef _WIN32
115 # define VSI_ISLNK(x) ( 0 ) /* N/A on Windows */
116 # define VSI_ISREG(x) ((x) & S_IFREG)
117 # define VSI_ISDIR(x) ((x) & S_IFDIR)
118 # define VSI_ISCHR(x) ((x) & S_IFCHR)
119 # define VSI_ISBLK(x) ( 0 ) /* N/A on Windows */
120 #else
122 # define VSI_ISLNK(x) S_ISLNK(x)
124 # define VSI_ISREG(x) S_ISREG(x)
126 # define VSI_ISDIR(x) S_ISDIR(x)
128 # define VSI_ISCHR(x) S_ISCHR(x)
129 # define VSI_ISBLK(x) S_ISBLK(x)
131 #endif
132
133 /* ==================================================================== */
134 /* 64bit stdio file access functions. If we have a big size */
135 /* defined, then provide prototypes for the large file API, */
136 /* otherwise redefine to use the regular api. */
137 /* ==================================================================== */
138
140 typedef GUIntBig vsi_l_offset;
142 #define VSI_L_OFFSET_MAX GUINTBIG_MAX
143
145 /* Make VSIL_STRICT_ENFORCE active in DEBUG builds */
146 #ifdef DEBUG
147 #define VSIL_STRICT_ENFORCE
148 #endif
151 #ifdef VSIL_STRICT_ENFORCE
153 typedef struct _VSILFILE VSILFILE;
154 #else
156 typedef FILE VSILFILE;
157 #endif
158
159 VSILFILE CPL_DLL * VSIFOpenL( const char *, const char * ) CPL_WARN_UNUSED_RESULT;
160 VSILFILE CPL_DLL * VSIFOpenExL( const char *, const char *, int ) CPL_WARN_UNUSED_RESULT;
161 VSILFILE CPL_DLL * VSIFOpenEx2L( const char *, const char *, int, CSLConstList ) CPL_WARN_UNUSED_RESULT;
162 int CPL_DLL VSIFCloseL( VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
163 int CPL_DLL VSIFSeekL( VSILFILE *, vsi_l_offset, int ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
164 vsi_l_offset CPL_DLL VSIFTellL( VSILFILE * ) CPL_WARN_UNUSED_RESULT;
165 void CPL_DLL VSIRewindL( VSILFILE * );
166 size_t CPL_DLL VSIFReadL( void *, size_t, size_t, VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
167 int CPL_DLL VSIFReadMultiRangeL( int nRanges, void ** ppData, const vsi_l_offset* panOffsets, const size_t* panSizes, VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
168 size_t CPL_DLL VSIFWriteL( const void *, size_t, size_t, VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
169 int CPL_DLL VSIFEofL( VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
170 int CPL_DLL VSIFTruncateL( VSILFILE *, vsi_l_offset ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
171 int CPL_DLL VSIFFlushL( VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
172 int CPL_DLL VSIFPrintfL( VSILFILE *, CPL_FORMAT_STRING(const char *), ... ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT CPL_PRINT_FUNC_FORMAT(2, 3);
173 int CPL_DLL VSIFPutcL( int, VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
174
176 typedef enum
177 {
178 VSI_RANGE_STATUS_UNKNOWN,
179 VSI_RANGE_STATUS_DATA,
180 VSI_RANGE_STATUS_HOLE
181 } VSIRangeStatus;
182
183 VSIRangeStatus CPL_DLL VSIFGetRangeStatusL( VSILFILE * fp, vsi_l_offset nStart, vsi_l_offset nLength );
184
185 int CPL_DLL VSIIngestFile( VSILFILE* fp,
186 const char* pszFilename,
187 GByte** ppabyRet,
188 vsi_l_offset* pnSize,
189 GIntBig nMaxSize ) CPL_WARN_UNUSED_RESULT;
190
191 int CPL_DLL VSIOverwriteFile( VSILFILE* fpTarget, const char* pszSourceFilename ) CPL_WARN_UNUSED_RESULT;
192
193 #if defined(VSI_STAT64_T)
195 typedef struct VSI_STAT64_T VSIStatBufL;
196 #else
198 #define VSIStatBufL VSIStatBuf
199 #endif
200
201 int CPL_DLL VSIStatL( const char *, VSIStatBufL * ) CPL_WARN_UNUSED_RESULT;
202
204 #define VSI_STAT_EXISTS_FLAG 0x1
206 #define VSI_STAT_NATURE_FLAG 0x2
208 #define VSI_STAT_SIZE_FLAG 0x4
210 #define VSI_STAT_SET_ERROR_FLAG 0x8
211
212 int CPL_DLL VSIStatExL( const char * pszFilename, VSIStatBufL * psStatBuf, int nFlags ) CPL_WARN_UNUSED_RESULT;
213
214 int CPL_DLL VSIIsCaseSensitiveFS( const char * pszFilename );
215
216 int CPL_DLL VSISupportsSparseFiles( const char* pszPath );
217
218 int CPL_DLL VSIHasOptimizedReadMultiRange( const char* pszPath );
219
220 const char CPL_DLL *VSIGetActualURL( const char* pszFilename );
221
222 char CPL_DLL *VSIGetSignedURL( const char* pszFilename, CSLConstList papszOptions );
223
224 const char CPL_DLL *VSIGetFileSystemOptions( const char* pszFilename );
225
226 char CPL_DLL **VSIGetFileSystemsPrefixes( void );
227
228 void CPL_DLL *VSIFGetNativeFileDescriptorL( VSILFILE* );
229
230 char CPL_DLL **VSIGetFileMetadata( const char * pszFilename, const char* pszDomain,
231 CSLConstList papszOptions ) CPL_WARN_UNUSED_RESULT;
232
233 int CPL_DLL VSISetFileMetadata( const char * pszFilename,
234 CSLConstList papszMetadata,
235 const char* pszDomain,
236 CSLConstList papszOptions );
237
238 /* ==================================================================== */
239 /* Memory allocation */
240 /* ==================================================================== */
241
242 void CPL_DLL *VSICalloc( size_t, size_t ) CPL_WARN_UNUSED_RESULT;
243 void CPL_DLL *VSIMalloc( size_t ) CPL_WARN_UNUSED_RESULT;
244 void CPL_DLL VSIFree( void * );
245 void CPL_DLL *VSIRealloc( void *, size_t ) CPL_WARN_UNUSED_RESULT;
246 char CPL_DLL *VSIStrdup( const char * ) CPL_WARN_UNUSED_RESULT;
247
248 void CPL_DLL *VSIMallocAligned( size_t nAlignment, size_t nSize ) CPL_WARN_UNUSED_RESULT;
249 void CPL_DLL *VSIMallocAlignedAuto( size_t nSize ) CPL_WARN_UNUSED_RESULT;
250 void CPL_DLL VSIFreeAligned( void* ptr );
251
252 void CPL_DLL *VSIMallocAlignedAutoVerbose( size_t nSize, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
254 #define VSI_MALLOC_ALIGNED_AUTO_VERBOSE( size ) VSIMallocAlignedAutoVerbose(size,__FILE__,__LINE__)
255
263 void CPL_DLL *VSIMalloc2( size_t nSize1, size_t nSize2 ) CPL_WARN_UNUSED_RESULT;
264
272 void CPL_DLL *VSIMalloc3( size_t nSize1, size_t nSize2, size_t nSize3 ) CPL_WARN_UNUSED_RESULT;
273
275 void CPL_DLL *VSIMallocVerbose( size_t nSize, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
277 #define VSI_MALLOC_VERBOSE( size ) VSIMallocVerbose(size,__FILE__,__LINE__)
278
280 void CPL_DLL *VSIMalloc2Verbose( size_t nSize1, size_t nSize2, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
282 #define VSI_MALLOC2_VERBOSE( nSize1, nSize2 ) VSIMalloc2Verbose(nSize1,nSize2,__FILE__,__LINE__)
283
285 void CPL_DLL *VSIMalloc3Verbose( size_t nSize1, size_t nSize2, size_t nSize3, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
287 #define VSI_MALLOC3_VERBOSE( nSize1, nSize2, nSize3 ) VSIMalloc3Verbose(nSize1,nSize2,nSize3,__FILE__,__LINE__)
288
290 void CPL_DLL *VSICallocVerbose( size_t nCount, size_t nSize, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
292 #define VSI_CALLOC_VERBOSE( nCount, nSize ) VSICallocVerbose(nCount,nSize,__FILE__,__LINE__)
293
295 void CPL_DLL *VSIReallocVerbose( void* pOldPtr, size_t nNewSize, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
297 #define VSI_REALLOC_VERBOSE( pOldPtr, nNewSize ) VSIReallocVerbose(pOldPtr,nNewSize,__FILE__,__LINE__)
298
300 char CPL_DLL *VSIStrdupVerbose( const char* pszStr, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
302 #define VSI_STRDUP_VERBOSE( pszStr ) VSIStrdupVerbose(pszStr,__FILE__,__LINE__)
303
304 GIntBig CPL_DLL CPLGetPhysicalRAM(void);
305 GIntBig CPL_DLL CPLGetUsablePhysicalRAM(void);
306
307 /* ==================================================================== */
308 /* Other... */
309 /* ==================================================================== */
310
312 #define CPLReadDir VSIReadDir
313 char CPL_DLL **VSIReadDir( const char * );
314 char CPL_DLL **VSIReadDirRecursive( const char *pszPath );
315 char CPL_DLL **VSIReadDirEx( const char *pszPath, int nMaxFiles );
316 char CPL_DLL **VSISiblingFiles( const char *pszPath );
317
319 typedef struct VSIDIR VSIDIR;
320
321 VSIDIR CPL_DLL *VSIOpenDir( const char *pszPath,
322 int nRecurseDepth,
323 const char* const *papszOptions);
324
326 typedef struct VSIDIREntry VSIDIREntry;
330 struct VSIDIREntry
331 {
333 char* pszName;
335 int nMode;
337 vsi_l_offset nSize;
339 GIntBig nMTime;
341 char bModeKnown;
343 char bSizeKnown;
345 char bMTimeKnown;
347 char** papszExtra;
348
349 #if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
351 VSIDIREntry();
352 ~VSIDIREntry();
353 VSIDIREntry(const VSIDIREntry&);
354 VSIDIREntry& operator=(VSIDIREntry&) = delete;
356 #endif
357 };
358
359 const VSIDIREntry CPL_DLL *VSIGetNextDirEntry(VSIDIR* dir);
360 void CPL_DLL VSICloseDir(VSIDIR* dir);
361
362 int CPL_DLL VSIMkdir( const char * pszPathname, long mode );
363 int CPL_DLL VSIMkdirRecursive( const char * pszPathname, long mode );
364 int CPL_DLL VSIRmdir( const char * pszDirname );
365 int CPL_DLL VSIRmdirRecursive( const char * pszDirname );
366 int CPL_DLL VSIUnlink( const char * pszFilename );
367 int CPL_DLL *VSIUnlinkBatch( CSLConstList papszFiles );
368 int CPL_DLL VSIRename( const char * oldpath, const char * newpath );
369 int CPL_DLL VSISync( const char* pszSource, const char* pszTarget,
370 const char* const * papszOptions,
371 GDALProgressFunc pProgressFunc,
372 void *pProgressData,
373 char*** ppapszOutputs );
374
375 char CPL_DLL *VSIStrerror( int );
376 GIntBig CPL_DLL VSIGetDiskFreeSpace(const char *pszDirname);
377
378 void CPL_DLL VSINetworkStatsReset( void );
379 char CPL_DLL *VSINetworkStatsGetAsSerializedJSON( char** papszOptions );
380
381 /* ==================================================================== */
382 /* Install special file access handlers. */
383 /* ==================================================================== */
384 void CPL_DLL VSIInstallMemFileHandler(void);
386 void CPL_DLL VSIInstallLargeFileHandler(void);
388 void CPL_DLL VSIInstallSubFileHandler(void);
389 void VSIInstallCurlFileHandler(void);
390 void CPL_DLL VSICurlClearCache(void);
391 void CPL_DLL VSICurlPartialClearCache(const char* pszFilenamePrefix);
392 void VSIInstallCurlStreamingFileHandler(void);
393 void VSIInstallS3FileHandler(void);
394 void VSIInstallS3StreamingFileHandler(void);
395 void VSIInstallGSFileHandler(void);
396 void VSIInstallGSStreamingFileHandler(void);
397 void VSIInstallAzureFileHandler(void);
398 void VSIInstallAzureStreamingFileHandler(void);
399 void VSIInstallADLSFileHandler(void);
400 void VSIInstallOSSFileHandler(void);
401 void VSIInstallOSSStreamingFileHandler(void);
402 void VSIInstallSwiftFileHandler(void);
403 void VSIInstallSwiftStreamingFileHandler(void);
404 void VSIInstallGZipFileHandler(void); /* No reason to export that */
405 void VSIInstallZipFileHandler(void); /* No reason to export that */
406 void VSIInstallStdinHandler(void); /* No reason to export that */
407 void VSIInstallHdfsHandler(void); /* No reason to export that */
408 void VSIInstallWebHdfsHandler(void); /* No reason to export that */
409 void VSIInstallStdoutHandler(void); /* No reason to export that */
410 void CPL_DLL VSIInstallSparseFileHandler(void);
411 void VSIInstallTarFileHandler(void); /* No reason to export that */
412 void CPL_DLL VSIInstallCryptFileHandler(void);
413 void CPL_DLL VSISetCryptKey(const GByte* pabyKey, int nKeySize);
415 void CPL_DLL VSICleanupFileManager(void);
418 VSILFILE CPL_DLL *VSIFileFromMemBuffer( const char *pszFilename,
419 GByte *pabyData,
420 vsi_l_offset nDataLength,
421 int bTakeOwnership ) CPL_WARN_UNUSED_RESULT;
422 GByte CPL_DLL *VSIGetMemFileBuffer( const char *pszFilename,
423 vsi_l_offset *pnDataLength,
424 int bUnlinkAndSeize );
425
427 typedef size_t (*VSIWriteFunction)(const void* ptr, size_t size, size_t nmemb, FILE* stream);
428 void CPL_DLL VSIStdoutSetRedirection( VSIWriteFunction pFct, FILE* stream );
429
434 typedef int (*VSIFilesystemPluginStatCallback) ( void *pUserData, const char *pszFilename, VSIStatBufL *pStatBuf, int nFlags );
439 typedef int (*VSIFilesystemPluginUnlinkCallback) ( void *pUserData, const char *pszFilename );
444 typedef int (*VSIFilesystemPluginRenameCallback) ( void *pUserData, const char *oldpath, const char *newpath );
449 typedef int (*VSIFilesystemPluginMkdirCallback) ( void *pUserData, const char *pszDirname, long nMode );
454 typedef int (*VSIFilesystemPluginRmdirCallback) ( void *pUserData, const char *pszDirname );
459 typedef char** (*VSIFilesystemPluginReadDirCallback) ( void *pUserData, const char *pszDirname, int nMaxFiles );
468 typedef char** (*VSIFilesystemPluginSiblingFilesCallback) ( void *pUserData, const char *pszDirname );
474 typedef void* (*VSIFilesystemPluginOpenCallback) ( void *pUserData, const char *pszFilename, const char *pszAccess );
479 typedef vsi_l_offset (*VSIFilesystemPluginTellCallback) ( void *pFile );
484 typedef int (*VSIFilesystemPluginSeekCallback) ( void *pFile, vsi_l_offset nOffset, int nWhence );
490 typedef size_t (*VSIFilesystemPluginReadCallback) ( void *pFile, void *pBuffer, size_t nSize, size_t nCount );
495 typedef int (*VSIFilesystemPluginReadMultiRangeCallback)( void *pFile, int nRanges, void ** ppData,
496 const vsi_l_offset* panOffsets, const size_t* panSizes );
501 typedef VSIRangeStatus (*VSIFilesystemPluginGetRangeStatusCallback)( void *pFile, vsi_l_offset nOffset, vsi_l_offset nLength );
506 typedef int (*VSIFilesystemPluginEofCallback) ( void *pFile );
511 typedef size_t (*VSIFilesystemPluginWriteCallback) ( void *pFile, const void *pBuffer, size_t nSize,size_t nCount);
516 typedef int (*VSIFilesystemPluginFlushCallback) ( void *pFile );
520 typedef int (*VSIFilesystemPluginTruncateCallback) ( void *pFile, vsi_l_offset nNewSize );
525 typedef int (*VSIFilesystemPluginCloseCallback) ( void *pFile );
526
534 typedef struct {
538 void *pUserData;
539 VSIFilesystemPluginStatCallback stat;
540 VSIFilesystemPluginUnlinkCallback unlink;
541 VSIFilesystemPluginRenameCallback rename;
542 VSIFilesystemPluginMkdirCallback mkdir;
543 VSIFilesystemPluginRmdirCallback rmdir;
544 VSIFilesystemPluginReadDirCallback read_dir;
545 VSIFilesystemPluginOpenCallback open;
546 VSIFilesystemPluginTellCallback tell;
547 VSIFilesystemPluginSeekCallback seek;
548 VSIFilesystemPluginReadCallback read;
549 VSIFilesystemPluginReadMultiRangeCallback read_multi_range;
550 VSIFilesystemPluginGetRangeStatusCallback get_range_status;
551 VSIFilesystemPluginEofCallback eof;
552 VSIFilesystemPluginWriteCallback write;
553 VSIFilesystemPluginFlushCallback flush;
554 VSIFilesystemPluginTruncateCallback truncate;
555 VSIFilesystemPluginCloseCallback close;
556 size_t nBufferSize;
557 size_t nCacheSize;
558 VSIFilesystemPluginSiblingFilesCallback sibling_files;
559 /*
560 Callbacks are defined as a struct allocated by a call to VSIAllocFilesystemPluginCallbacksStruct
561 in order to try to maintain ABI stability when eventually adding a new member.
562 Any callbacks added to this struct SHOULD be added to the END of this struct
563 */
564 } VSIFilesystemPluginCallbacksStruct;
565
570 VSIFilesystemPluginCallbacksStruct CPL_DLL *VSIAllocFilesystemPluginCallbacksStruct( void );
571
576 void CPL_DLL VSIFreeFilesystemPluginCallbacksStruct(VSIFilesystemPluginCallbacksStruct* poCb);
577
584 int CPL_DLL VSIInstallPluginHandler( const char* pszPrefix, const VSIFilesystemPluginCallbacksStruct* poCb);
585
586 /* ==================================================================== */
587 /* Time querying. */
588 /* ==================================================================== */
589
591 unsigned long CPL_DLL VSITime( unsigned long * );
592 const char CPL_DLL *VSICTime( unsigned long );
593 struct tm CPL_DLL *VSIGMTime( const time_t *pnTime,
594 struct tm *poBrokenTime );
595 struct tm CPL_DLL *VSILocalTime( const time_t *pnTime,
596 struct tm *poBrokenTime );
600 /* -------------------------------------------------------------------- */
601 /* the following can be turned on for detailed logging of */
602 /* almost all IO calls. */
603 /* -------------------------------------------------------------------- */
604 #ifdef VSI_DEBUG
605
606 #ifndef DEBUG
607 # define DEBUG
608 #endif
609
610 #include "cpl_error.h"
611
612 #define VSIDebug4(f,a1,a2,a3,a4) CPLDebug( "VSI", f, a1, a2, a3, a4 );
613 #define VSIDebug3( f, a1, a2, a3 ) CPLDebug( "VSI", f, a1, a2, a3 );
614 #define VSIDebug2( f, a1, a2 ) CPLDebug( "VSI", f, a1, a2 );
615 #define VSIDebug1( f, a1 ) CPLDebug( "VSI", f, a1 );
616 #else
617 #define VSIDebug4( f, a1, a2, a3, a4 ) {}
618 #define VSIDebug3( f, a1, a2, a3 ) {}
619 #define VSIDebug2( f, a1, a2 ) {}
620 #define VSIDebug1( f, a1 ) {}
621 #endif
624 CPL_C_END
625
626 #endif /* ndef CPL_VSI_H_INCLUDED */
cpl_error.h
CPL error handling services.
cpl_port.h
Core portability definitions for CPL.
GUIntBig
unsigned long long GUIntBig
Large unsigned integer type (generally 64-bit unsigned integer type).
Definition: cpl_port.h:251
CPL_C_END
#define CPL_C_END
Macro to end a block of C symbols.
Definition: cpl_port.h:339
CPL_C_START
#define CPL_C_START
Macro to start a block of C symbols.
Definition: cpl_port.h:337
CPL_FORMAT_STRING
#define CPL_FORMAT_STRING(arg)
Macro into which to wrap the format argument of a printf-like function.
Definition: cpl_port.h:936
CPL_PRINT_FUNC_FORMAT
#define CPL_PRINT_FUNC_FORMAT(format_idx, arg_idx)
Tag a function to have printf() formatting.
Definition: cpl_port.h:921
CSLConstList
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition: cpl_port.h:1216
CPL_WARN_UNUSED_RESULT
#define CPL_WARN_UNUSED_RESULT
Qualifier to warn when the return value of a function is not used.
Definition: cpl_port.h:946
GByte
unsigned char GByte
Unsigned byte type.
Definition: cpl_port.h:215
GIntBig
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition: cpl_port.h:248
VSIReadDirRecursive
char ** VSIReadDirRecursive(const char *pszPath)
Read names in a directory recursively.
Definition: cpl_vsil.cpp:189
VSIAllocFilesystemPluginCallbacksStruct
VSIFilesystemPluginCallbacksStruct * VSIAllocFilesystemPluginCallbacksStruct(void)
return a VSIFilesystemPluginCallbacksStruct to be populated at runtime with handler callbacks
Definition: cpl_vsil_plugin.cpp:367
VSISetFileMetadata
int VSISetFileMetadata(const char *pszFilename, CSLConstList papszMetadata, const char *pszDomain, CSLConstList papszOptions)
Set metadata on files.
Definition: cpl_vsil.cpp:947
VSIGetActualURL
const char * VSIGetActualURL(const char *pszFilename)
Returns the actual URL of a supplied filename.
Definition: cpl_vsil.cpp:1069
VSIGetNextDirEntry
const VSIDIREntry * VSIGetNextDirEntry(VSIDIR *dir)
Return the next entry of the directory.
Definition: cpl_vsil.cpp:408
VSIFGetRangeStatusL
VSIRangeStatus VSIFGetRangeStatusL(VSILFILE *fp, vsi_l_offset nStart, vsi_l_offset nLength)
Return if a given file range contains data or holes filled with zeroes.
Definition: cpl_vsil.cpp:2308
VSINetworkStatsReset
void VSINetworkStatsReset(void)
Clear network related statistics.
Definition: cpl_vsil_curl.cpp:5081
VSIWriteFunction
size_t(* VSIWriteFunction)(const void *ptr, size_t size, size_t nmemb, FILE *stream)
Callback used by VSIStdoutSetRedirection()
Definition: cpl_vsi.h:427
VSIInstallS3StreamingFileHandler
void VSIInstallS3StreamingFileHandler(void)
Install /vsis3_streaming/ Amazon S3 file system handler (requires libcurl).
Definition: cpl_vsil_curl_streaming.cpp:2057
VSIOpenDir
VSIDIR * VSIOpenDir(const char *pszPath, int nRecurseDepth, const char *const *papszOptions)
Open a directory to read its entries.
Definition: cpl_vsil.cpp:371
VSIReallocVerbose
void * VSIReallocVerbose(void *pOldPtr, size_t nNewSize, const char *pszFile, int nLine)
VSIReallocVerbose.
Definition: cpl_vsisimple.cpp:1224
VSIFFlushL
int VSIFFlushL(VSILFILE *)
Flush pending writes to disk.
Definition: cpl_vsil.cpp:1939
VSIFilesystemPluginReadMultiRangeCallback
int(* VSIFilesystemPluginReadMultiRangeCallback)(void *pFile, int nRanges, void **ppData, const vsi_l_offset *panOffsets, const size_t *panSizes)
Read from multiple offsets.
Definition: cpl_vsi.h:495
VSIFTellL
vsi_l_offset VSIFTellL(VSILFILE *)
Tell current file offset.
Definition: cpl_vsil.cpp:1876
VSIRename
int VSIRename(const char *oldpath, const char *newpath)
Rename a file.
Definition: cpl_vsil.cpp:600
VSIFWriteL
size_t VSIFWriteL(const void *, size_t, size_t, VSILFILE *)
Write bytes to file.
Definition: cpl_vsil.cpp:2105
VSIRangeStatus
VSIRangeStatus
Range status.
Definition: cpl_vsi.h:177
VSI_RANGE_STATUS_DATA
@ VSI_RANGE_STATUS_DATA
Data present.
Definition: cpl_vsi.h:179
VSI_RANGE_STATUS_HOLE
@ VSI_RANGE_STATUS_HOLE
Hole.
Definition: cpl_vsi.h:180
VSI_RANGE_STATUS_UNKNOWN
@ VSI_RANGE_STATUS_UNKNOWN
Unknown.
Definition: cpl_vsi.h:178
VSIFilesystemPluginReadCallback
size_t(* VSIFilesystemPluginReadCallback)(void *pFile, void *pBuffer, size_t nSize, size_t nCount)
Read data from current position, returns the number of blocks correctly read.
Definition: cpl_vsi.h:490
VSIInstallStdinHandler
void VSIInstallStdinHandler(void)
Install /vsistdin/ file system handler.
Definition: cpl_vsil_stdin.cpp:423
CPLGetPhysicalRAM
GIntBig CPLGetPhysicalRAM(void)
Return the total physical RAM in bytes.
Definition: cpl_vsisimple.cpp:1369
VSIMalloc2Verbose
void * VSIMalloc2Verbose(size_t nSize1, size_t nSize2, const char *pszFile, int nLine)
VSIMalloc2Verbose.
Definition: cpl_vsisimple.cpp:1155
VSIStrerror
char * VSIStrerror(int)
Return the error string corresponding to the error number.
Definition: cpl_vsisimple.cpp:1347
VSIFTruncateL
int VSIFTruncateL(VSILFILE *, vsi_l_offset)
Truncate/expand the file to the specified size.
Definition: cpl_vsil.cpp:2193
VSIFilesystemPluginTellCallback
vsi_l_offset(* VSIFilesystemPluginTellCallback)(void *pFile)
Return current position in handle.
Definition: cpl_vsi.h:479
VSICalloc
void * VSICalloc(size_t, size_t)
Analog of calloc().
Definition: cpl_vsisimple.cpp:444
VSIIsCaseSensitiveFS
int VSIIsCaseSensitiveFS(const char *pszFilename)
Returns if the filenames of the filesystem are case sensitive.
Definition: cpl_vsil.cpp:983
VSIInstallGZipFileHandler
void VSIInstallGZipFileHandler(void)
Install GZip file system handler.
Definition: cpl_vsil_gzip.cpp:2451
VSIHasOptimizedReadMultiRange
int VSIHasOptimizedReadMultiRange(const char *pszPath)
Returns if the filesystem supports efficient multi-range reading.
Definition: cpl_vsil.cpp:1039
VSIFGetNativeFileDescriptorL
void * VSIFGetNativeFileDescriptorL(VSILFILE *)
Returns the "native" file descriptor for the virtual handle.
Definition: cpl_vsil.cpp:2600
VSIFreeFilesystemPluginCallbacksStruct
void VSIFreeFilesystemPluginCallbacksStruct(VSIFilesystemPluginCallbacksStruct *poCb)
free resources allocated by VSIAllocFilesystemPluginCallbacksStruct
Definition: cpl_vsil_plugin.cpp:370
VSIFilesystemPluginRenameCallback
int(* VSIFilesystemPluginRenameCallback)(void *pUserData, const char *oldpath, const char *newpath)
Rename handle.
Definition: cpl_vsi.h:444
VSIInstallCurlFileHandler
void VSIInstallCurlFileHandler(void)
Install /vsicurl/ HTTP/FTP file system handler (requires libcurl)
Definition: cpl_vsil_curl.cpp:4996
VSIInstallWebHdfsHandler
void VSIInstallWebHdfsHandler(void)
Install /vsiwebhdfs/ WebHDFS (Hadoop File System) REST API file system handler (requires libcurl)
Definition: cpl_vsil_webhdfs.cpp:1221
VSIFilesystemPluginReadDirCallback
char **(* VSIFilesystemPluginReadDirCallback)(void *pUserData, const char *pszDirname, int nMaxFiles)
List directory content.
Definition: cpl_vsi.h:459
VSIMallocVerbose
void * VSIMallocVerbose(size_t nSize, const char *pszFile, int nLine)
VSIMallocVerbose.
Definition: cpl_vsisimple.cpp:1138
VSIStrdup
char * VSIStrdup(const char *)
Analog of strdup().
Definition: cpl_vsisimple.cpp:995
VSIInstallS3FileHandler
void VSIInstallS3FileHandler(void)
Install /vsis3/ Amazon S3 file system handler (requires libcurl)
Definition: cpl_vsil_s3.cpp:4407
VSIInstallHdfsHandler
void VSIInstallHdfsHandler(void)
Install /vsihdfs/ file system handler (requires JVM and HDFS support)
Definition: cpl_vsil_hdfs.cpp:415
VSIInstallCryptFileHandler
void VSIInstallCryptFileHandler(void)
Install /vsicrypt/ encrypted file system handler (requires libcrypto++)
Definition: cpl_vsil_crypt.cpp:2044
VSIFilesystemPluginOpenCallback
void *(* VSIFilesystemPluginOpenCallback)(void *pUserData, const char *pszFilename, const char *pszAccess)
Open a handle.
Definition: cpl_vsi.h:474
VSIMalloc
void * VSIMalloc(size_t)
Analog of malloc().
Definition: cpl_vsisimple.cpp:558
VSIOverwriteFile
int VSIOverwriteFile(VSILFILE *fpTarget, const char *pszSourceFilename)
Overwrite an existing file with content from another one.
Definition: cpl_vsil.cpp:2528
VSIInstallSwiftStreamingFileHandler
void VSIInstallSwiftStreamingFileHandler(void)
Install /vsiswift_streamin/ OpenStack Swif Object Storage (Swift) file system handler (requires libcu...
Definition: cpl_vsil_curl_streaming.cpp:2132
VSIReadDir
char ** VSIReadDir(const char *)
Read names in a directory.
Definition: cpl_vsil.cpp:84
VSISetCryptKey
void VSISetCryptKey(const GByte *pabyKey, int nKeySize)
Installs the encryption/decryption key.
Definition: cpl_vsil_crypt.cpp:205
VSIInstallStdoutHandler
void VSIInstallStdoutHandler(void)
Install /vsistdout/ file system handler.
Definition: cpl_vsil_stdout.cpp:448
VSIMkdirRecursive
int VSIMkdirRecursive(const char *pszPathname, long mode)
Create a directory and all its ancestors.
Definition: cpl_vsil.cpp:475
VSIMalloc3
void * VSIMalloc3(size_t nSize1, size_t nSize2, size_t nSize3)
VSIMalloc3 allocates (nSize1 * nSize2 * nSize3) bytes.
Definition: cpl_vsisimple.cpp:1129
VSIInstallMemFileHandler
void VSIInstallMemFileHandler(void)
Install "memory" file system handler.
Definition: cpl_vsi_mem.cpp:904
VSIFPutcL
int VSIFPutcL(int, VSILFILE *)
Write a single byte to the file.
Definition: cpl_vsil.cpp:2256
VSISync
int VSISync(const char *pszSource, const char *pszTarget, const char *const *papszOptions, GDALProgressFunc pProgressFunc, void *pProgressData, char ***ppapszOutputs)
Synchronize a source file/directory with a target file/directory.
Definition: cpl_vsil.cpp:683
VSIFilesystemPluginCloseCallback
int(* VSIFilesystemPluginCloseCallback)(void *pFile)
Close file handle.
Definition: cpl_vsi.h:525
VSIDIR
struct VSIDIR VSIDIR
Opaque type for a directory iterator.
Definition: cpl_vsi.h:319
VSICurlClearCache
void VSICurlClearCache(void)
Clean local cache associated with /vsicurl/ (and related file systems)
Definition: cpl_vsil_curl.cpp:5019
VSICurlPartialClearCache
void VSICurlPartialClearCache(const char *pszFilenamePrefix)
Clean local cache associated with /vsicurl/ (and related file systems) for a given filename (and its ...
Definition: cpl_vsil_curl.cpp:5057
VSIIngestFile
int VSIIngestFile(VSILFILE *fp, const char *pszFilename, GByte **ppabyRet, vsi_l_offset *pnSize, GIntBig nMaxSize)
Ingest a file into memory.
Definition: cpl_vsil.cpp:2345
VSISupportsSparseFiles
int VSISupportsSparseFiles(const char *pszPath)
Returns if the filesystem supports sparse files.
Definition: cpl_vsil.cpp:1013
VSIFilesystemPluginMkdirCallback
int(* VSIFilesystemPluginMkdirCallback)(void *pUserData, const char *pszDirname, long nMode)
Create Directory.
Definition: cpl_vsi.h:449
VSIFilesystemPluginTruncateCallback
int(* VSIFilesystemPluginTruncateCallback)(void *pFile, vsi_l_offset nNewSize)
Truncate handle.
Definition: cpl_vsi.h:520
VSIFilesystemPluginWriteCallback
size_t(* VSIFilesystemPluginWriteCallback)(void *pFile, const void *pBuffer, size_t nSize, size_t nCount)
Write bytes at current offset.
Definition: cpl_vsi.h:511
VSIMallocAlignedAuto
void * VSIMallocAlignedAuto(size_t nSize)
Allocates a buffer with an alignment constraint such that it can be used by the most demanding vector...
Definition: cpl_vsisimple.cpp:938
VSICloseDir
void VSICloseDir(VSIDIR *dir)
Close a directory.
Definition: cpl_vsil.cpp:427
VSIUnlink
int VSIUnlink(const char *pszFilename)
Delete a file.
Definition: cpl_vsil.cpp:527
VSIFCloseL
int VSIFCloseL(VSILFILE *)
Close file.
Definition: cpl_vsil.cpp:1773
VSIGetFileSystemOptions
const char * VSIGetFileSystemOptions(const char *pszFilename)
Return the list of options associated with a virtual file system handler as a serialized XML string.
Definition: cpl_vsil.cpp:2663
VSIMallocAlignedAutoVerbose
void * VSIMallocAlignedAutoVerbose(size_t nSize, const char *pszFile, int nLine)
See VSIMallocAlignedAuto()
Definition: cpl_vsisimple.cpp:951
VSIInstallSwiftFileHandler
void VSIInstallSwiftFileHandler(void)
Install /vsiswift/ OpenStack Swif Object Storage (Swift) file system handler (requires libcurl)
Definition: cpl_vsil_swift.cpp:730
VSIInstallZipFileHandler
void VSIInstallZipFileHandler(void)
Install ZIP file system handler.
Definition: cpl_vsil_gzip.cpp:3324
VSIFilesystemPluginGetRangeStatusCallback
VSIRangeStatus(* VSIFilesystemPluginGetRangeStatusCallback)(void *pFile, vsi_l_offset nOffset, vsi_l_offset nLength)
Get empty ranges.
Definition: cpl_vsi.h:501
VSIFilesystemPluginSeekCallback
int(* VSIFilesystemPluginSeekCallback)(void *pFile, vsi_l_offset nOffset, int nWhence)
Seek to position in handle.
Definition: cpl_vsi.h:484
VSIFilesystemPluginStatCallback
int(* VSIFilesystemPluginStatCallback)(void *pUserData, const char *pszFilename, VSIStatBufL *pStatBuf, int nFlags)
Return information about a handle.
Definition: cpl_vsi.h:434
VSIInstallOSSStreamingFileHandler
void VSIInstallOSSStreamingFileHandler(void)
Install /vsioss_streaming/ Alibaba Cloud Object Storage Service (OSS) file system handler (requires l...
Definition: cpl_vsil_curl_streaming.cpp:2113
VSIGetSignedURL
char * VSIGetSignedURL(const char *pszFilename, CSLConstList papszOptions)
Returns a signed URL of a supplied filename.
Definition: cpl_vsil.cpp:1116
VSIMalloc2
void * VSIMalloc2(size_t nSize1, size_t nSize2)
VSIMalloc2 allocates (nSize1 * nSize2) bytes.
Definition: cpl_vsisimple.cpp:1116
VSIInstallPluginHandler
int VSIInstallPluginHandler(const char *pszPrefix, const VSIFilesystemPluginCallbacksStruct *poCb)
register a handler on the given prefix.
Definition: cpl_vsil_plugin.cpp:360
VSIRmdirRecursive
int VSIRmdirRecursive(const char *pszDirname)
Delete a directory recursively.
Definition: cpl_vsil.cpp:760
VSIMkdir
int VSIMkdir(const char *pszPathname, long mode)
Create a directory.
Definition: cpl_vsil.cpp:452
VSIReadDirEx
char ** VSIReadDirEx(const char *pszPath, int nMaxFiles)
Read names in a directory.
Definition: cpl_vsil.cpp:118
VSIFReadL
size_t VSIFReadL(void *, size_t, size_t, VSILFILE *)
Read bytes from file.
Definition: cpl_vsil.cpp:1991
VSIFReadMultiRangeL
int VSIFReadMultiRangeL(int nRanges, void **ppData, const vsi_l_offset *panOffsets, const size_t *panSizes, VSILFILE *)
Read several ranges of bytes from file.
Definition: cpl_vsil.cpp:2051
VSICallocVerbose
void * VSICallocVerbose(size_t nCount, size_t nSize, const char *pszFile, int nLine)
VSICallocVerbose.
Definition: cpl_vsisimple.cpp:1205
VSIInstallCurlStreamingFileHandler
void VSIInstallCurlStreamingFileHandler(void)
Install /vsicurl_streaming/ HTTP/FTP file system handler (requires libcurl).
Definition: cpl_vsil_curl_streaming.cpp:2039
VSIFEofL
int VSIFEofL(VSILFILE *)
Test for end of file.
Definition: cpl_vsil.cpp:2151
VSIInstallSparseFileHandler
void VSIInstallSparseFileHandler(void)
Install /vsisparse/ virtual file handler.
Definition: cpl_vsil_sparsefile.cpp:549
VSIInstallSubFileHandler
void VSIInstallSubFileHandler(void)
Install /vsisubfile/ virtual file handler.
Definition: cpl_vsil_subfile.cpp:508
VSIRewindL
void VSIRewindL(VSILFILE *)
Rewind the file pointer to the beginning of the file.
Definition: cpl_vsil.cpp:1898
VSIFilesystemPluginUnlinkCallback
int(* VSIFilesystemPluginUnlinkCallback)(void *pUserData, const char *pszFilename)
Remove handle by name.
Definition: cpl_vsi.h:439
VSINetworkStatsGetAsSerializedJSON
char * VSINetworkStatsGetAsSerializedJSON(char **papszOptions)
Return network related statistics, as a JSON serialized object.
Definition: cpl_vsil_curl.cpp:5179
VSIInstallADLSFileHandler
void VSIInstallADLSFileHandler(void)
Install /vsiadls/ Microsoft Azure Data Lake Storage Gen2 file system handler (requires libcurl)
Definition: cpl_vsil_adls.cpp:2152
CPLGetUsablePhysicalRAM
GIntBig CPLGetUsablePhysicalRAM(void)
Return the total physical RAM, usable by a process, in bytes.
Definition: cpl_vsisimple.cpp:1460
VSIMallocAligned
void * VSIMallocAligned(size_t nAlignment, size_t nSize)
Allocates a buffer with an alignment constraint.
Definition: cpl_vsisimple.cpp:892
VSIStatL
int VSIStatL(const char *, VSIStatBufL *)
Get filesystem object info.
Definition: cpl_vsil.cpp:797
VSIInstallGSStreamingFileHandler
void VSIInstallGSStreamingFileHandler(void)
Install /vsigs_streaming/ Google Cloud Storage file system handler (requires libcurl)
Definition: cpl_vsil_curl_streaming.cpp:2076
VSIGetFileMetadata
char ** VSIGetFileMetadata(const char *pszFilename, const char *pszDomain, CSLConstList papszOptions)
Get metadata on files.
Definition: cpl_vsil.cpp:897
VSIStatBufL
struct VSI_STAT64_T VSIStatBufL
Type for VSIStatL()
Definition: cpl_vsi.h:195
VSIFilesystemPluginEofCallback
int(* VSIFilesystemPluginEofCallback)(void *pFile)
Has end of file been reached.
Definition: cpl_vsi.h:506
VSIFPrintfL
int VSIFPrintfL(VSILFILE *, const char *,...)
Formatted write to file.
Definition: cpl_vsil.cpp:2219
VSIStatExL
int VSIStatExL(const char *pszFilename, VSIStatBufL *psStatBuf, int nFlags)
Get filesystem object info.
Definition: cpl_vsil.cpp:836
VSIInstallOSSFileHandler
void VSIInstallOSSFileHandler(void)
Install /vsioss/ Alibaba Cloud Object Storage Service (OSS) file system handler (requires libcurl)
Definition: cpl_vsil_oss.cpp:394
VSIFOpenL
VSILFILE * VSIFOpenL(const char *, const char *)
Open file.
Definition: cpl_vsil.cpp:1154
VSIGetDiskFreeSpace
GIntBig VSIGetDiskFreeSpace(const char *pszDirname)
Return free disk space available on the filesystem.
Definition: cpl_vsil.cpp:2621
VSIFilesystemPluginSiblingFilesCallback
char **(* VSIFilesystemPluginSiblingFilesCallback)(void *pUserData, const char *pszDirname)
List related files.
Definition: cpl_vsi.h:468
VSIMalloc3Verbose
void * VSIMalloc3Verbose(size_t nSize1, size_t nSize2, size_t nSize3, const char *pszFile, int nLine)
VSIMalloc3Verbose.
Definition: cpl_vsisimple.cpp:1180
VSIInstallTarFileHandler
void VSIInstallTarFileHandler(void)
Install /vsitar/ file system handler.
Definition: cpl_vsil_tar.cpp:643
VSIUnlinkBatch
int * VSIUnlinkBatch(CSLConstList papszFiles)
Delete several files, possibly in a batch.
Definition: cpl_vsil.cpp:556
VSIFreeAligned
void VSIFreeAligned(void *ptr)
Free a buffer allocated with VSIMallocAligned().
Definition: cpl_vsisimple.cpp:975
VSIStdoutSetRedirection
void VSIStdoutSetRedirection(VSIWriteFunction pFct, FILE *stream)
Set an alternative write function and output file handle instead of fwrite() / stdout.
Definition: cpl_vsil_stdout.cpp:64
VSIRealloc
void * VSIRealloc(void *, size_t)
Analog of realloc().
Definition: cpl_vsisimple.cpp:681
VSIGetFileSystemsPrefixes
char ** VSIGetFileSystemsPrefixes(void)
Return the list of prefixes for virtual file system handlers currently registered.
Definition: cpl_vsil.cpp:2643
VSIFOpenEx2L
VSILFILE * VSIFOpenEx2L(const char *, const char *, int, CSLConstList)
Open file.
Definition: cpl_vsil.cpp:1717
VSIFOpenExL
VSILFILE * VSIFOpenExL(const char *, const char *, int)
Open file.
Definition: cpl_vsil.cpp:1672
VSIFSeekL
int VSIFSeekL(VSILFILE *, vsi_l_offset, int)
Seek to requested offset.
Definition: cpl_vsil.cpp:1833
VSIGetMemFileBuffer
GByte * VSIGetMemFileBuffer(const char *pszFilename, vsi_l_offset *pnDataLength, int bUnlinkAndSeize)
Fetch buffer underlying memory file.
Definition: cpl_vsi_mem.cpp:999
VSISiblingFiles
char ** VSISiblingFiles(const char *pszPath)
Return related filenames.
Definition: cpl_vsil.cpp:146
VSIFilesystemPluginFlushCallback
int(* VSIFilesystemPluginFlushCallback)(void *pFile)
Sync written bytes.
Definition: cpl_vsi.h:516
VSIRmdir
int VSIRmdir(const char *pszDirname)
Delete a directory.
Definition: cpl_vsil.cpp:735
VSILFILE
FILE VSILFILE
Opaque type for a FILE that implements the VSIVirtualHandle API.
Definition: cpl_vsi.h:156
VSIInstallAzureFileHandler
void VSIInstallAzureFileHandler(void)
Install /vsiaz/ Microsoft Azure Blob file system handler (requires libcurl)
Definition: cpl_vsil_az.cpp:1974
VSIFree
void VSIFree(void *)
Analog of free() for data allocated with VSIMalloc(), VSICalloc(), VSIRealloc()
Definition: cpl_vsisimple.cpp:827
vsi_l_offset
GUIntBig vsi_l_offset
Type for a file offset.
Definition: cpl_vsi.h:140
VSIStrdupVerbose
char * VSIStrdupVerbose(const char *pszStr, const char *pszFile, int nLine)
VSIStrdupVerbose.
Definition: cpl_vsisimple.cpp:1242
VSIInstallGSFileHandler
void VSIInstallGSFileHandler(void)
Install /vsigs/ Google Cloud Storage file system handler (requires libcurl)
Definition: cpl_vsil_gs.cpp:347
VSIInstallAzureStreamingFileHandler
void VSIInstallAzureStreamingFileHandler(void)
Install /vsiaz_streaming/ Microsoft Azure Blob file system handler (requires libcurl)
Definition: cpl_vsil_curl_streaming.cpp:2094
VSIFileFromMemBuffer
VSILFILE * VSIFileFromMemBuffer(const char *pszFilename, GByte *pabyData, vsi_l_offset nDataLength, int bTakeOwnership)
Create memory "file" from a buffer.
Definition: cpl_vsi_mem.cpp:934
VSIFilesystemPluginRmdirCallback
int(* VSIFilesystemPluginRmdirCallback)(void *pUserData, const char *pszDirname)
Delete Directory.
Definition: cpl_vsi.h:454
VSIDIREntry
Directory entry.
Definition: cpl_vsi.h:331
VSIDIREntry::pszName
char * pszName
Filename.
Definition: cpl_vsi.h:333
VSIDIREntry::nMTime
GIntBig nMTime
Last modification time (seconds since 1970/01/01)
Definition: cpl_vsi.h:339
VSIDIREntry::bMTimeKnown
char bMTimeKnown
Whether nMTime is known: 0 = unknown, 1 = known.
Definition: cpl_vsi.h:345
VSIDIREntry::bSizeKnown
char bSizeKnown
Whether nSize is known: 0 = unknown, 1 = known.
Definition: cpl_vsi.h:343
VSIDIREntry::bModeKnown
char bModeKnown
Whether nMode is known: 0 = unknown, 1 = known.
Definition: cpl_vsi.h:341
VSIDIREntry::papszExtra
char ** papszExtra
NULL-terminated list of extra properties.
Definition: cpl_vsi.h:347
VSIDIREntry::nSize
vsi_l_offset nSize
File size.
Definition: cpl_vsi.h:337
VSIDIREntry::nMode
int nMode
File mode.
Definition: cpl_vsi.h:335
VSIFilesystemPluginCallbacksStruct
struct containing callbacks to used by the handler.
Definition: cpl_vsi.h:534
VSIFilesystemPluginCallbacksStruct::write
VSIFilesystemPluginWriteCallback write
write bytes to current position (w)
Definition: cpl_vsi.h:552
VSIFilesystemPluginCallbacksStruct::nBufferSize
size_t nBufferSize
buffer small reads (makes handler read only)
Definition: cpl_vsi.h:556
VSIFilesystemPluginCallbacksStruct::rename
VSIFilesystemPluginRenameCallback rename
rename handle ()
Definition: cpl_vsi.h:541
VSIFilesystemPluginCallbacksStruct::read_multi_range
VSIFilesystemPluginReadMultiRangeCallback read_multi_range
read multiple blocks ()
Definition: cpl_vsi.h:549
VSIFilesystemPluginCallbacksStruct::unlink
VSIFilesystemPluginUnlinkCallback unlink
unlink handle by name ()
Definition: cpl_vsi.h:540
VSIFilesystemPluginCallbacksStruct::rmdir
VSIFilesystemPluginRmdirCallback rmdir
remove directory ()
Definition: cpl_vsi.h:543
VSIFilesystemPluginCallbacksStruct::nCacheSize
size_t nCacheSize
max mem to use per file when buffering
Definition: cpl_vsi.h:557
VSIFilesystemPluginCallbacksStruct::eof
VSIFilesystemPluginEofCallback eof
has end of file been reached (r?)
Definition: cpl_vsi.h:551
VSIFilesystemPluginCallbacksStruct::sibling_files
VSIFilesystemPluginSiblingFilesCallback sibling_files
list related files
Definition: cpl_vsi.h:558
VSIFilesystemPluginCallbacksStruct::open
VSIFilesystemPluginOpenCallback open
open handle by name (rw)
Definition: cpl_vsi.h:545
VSIFilesystemPluginCallbacksStruct::seek
VSIFilesystemPluginSeekCallback seek
set current position of handle (rw)
Definition: cpl_vsi.h:547
VSIFilesystemPluginCallbacksStruct::get_range_status
VSIFilesystemPluginGetRangeStatusCallback get_range_status
get range status ()
Definition: cpl_vsi.h:550
VSIFilesystemPluginCallbacksStruct::close
VSIFilesystemPluginCloseCallback close
close handle (rw)
Definition: cpl_vsi.h:555
VSIFilesystemPluginCallbacksStruct::read
VSIFilesystemPluginReadCallback read
read from current position (r)
Definition: cpl_vsi.h:548
VSIFilesystemPluginCallbacksStruct::flush
VSIFilesystemPluginFlushCallback flush
sync bytes (w)
Definition: cpl_vsi.h:553
VSIFilesystemPluginCallbacksStruct::read_dir
VSIFilesystemPluginReadDirCallback read_dir
list directory content (r?)
Definition: cpl_vsi.h:544
VSIFilesystemPluginCallbacksStruct::pUserData
void * pUserData
Optional opaque pointer passed back to filemanager callbacks (e.g.
Definition: cpl_vsi.h:538
VSIFilesystemPluginCallbacksStruct::truncate
VSIFilesystemPluginTruncateCallback truncate
truncate handle (w?)
Definition: cpl_vsi.h:554
VSIFilesystemPluginCallbacksStruct::mkdir
VSIFilesystemPluginMkdirCallback mkdir
make directory ()
Definition: cpl_vsi.h:542
VSIFilesystemPluginCallbacksStruct::stat
VSIFilesystemPluginStatCallback stat
stat handle by name (rw)
Definition: cpl_vsi.h:539
VSIFilesystemPluginCallbacksStruct::tell
VSIFilesystemPluginTellCallback tell
get current position of handle (rw)
Definition: cpl_vsi.h:546