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
38 #include <stdbool.h>
39
58 /* -------------------------------------------------------------------- */
59 /* We need access to ``struct stat''. */
60 /* -------------------------------------------------------------------- */
61
62 /* Unix */
63 #if !defined(_WIN32)
64 # include <unistd.h>
65 #endif
66
67 /* Windows */
68 #include <sys/stat.h>
69
70 CPL_C_START
71
73 #ifdef ENABLE_EXPERIMENTAL_CPL_WARN_UNUSED_RESULT
74 #define EXPERIMENTAL_CPL_WARN_UNUSED_RESULT CPL_WARN_UNUSED_RESULT
75 #else
76 #define EXPERIMENTAL_CPL_WARN_UNUSED_RESULT
77 #endif
78
80 /* ==================================================================== */
81 /* stdio file access functions. These do not support large */
82 /* files, and do not go through the virtualization API. */
83 /* ==================================================================== */
84
87 FILE CPL_DLL * VSIFOpen( const char *, const char * ) CPL_WARN_UNUSED_RESULT;
88 int CPL_DLL VSIFClose( FILE * );
89 int CPL_DLL VSIFSeek( FILE *, long, int ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
90 long CPL_DLL VSIFTell( FILE * ) CPL_WARN_UNUSED_RESULT;
91 void CPL_DLL VSIRewind( FILE * );
92 void CPL_DLL VSIFFlush( FILE * );
93
94 size_t CPL_DLL VSIFRead( void *, size_t, size_t, FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
95 size_t CPL_DLL VSIFWrite( const void *, size_t, size_t, FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
96 char CPL_DLL *VSIFGets( char *, int, FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
97 int CPL_DLL VSIFPuts( const char *, FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
98 int CPL_DLL VSIFPrintf( FILE *, CPL_FORMAT_STRING(const char *), ... ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT CPL_PRINT_FUNC_FORMAT(2, 3);
99
100 int CPL_DLL VSIFGetc( FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
101 int CPL_DLL VSIFPutc( int, FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
102 int CPL_DLL VSIUngetc( int, FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
103 int CPL_DLL VSIFEof( FILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
104
107 /* ==================================================================== */
108 /* VSIStat() related. */
109 /* ==================================================================== */
110
112 typedef struct stat VSIStatBuf;
113 int CPL_DLL VSIStat( const char *, VSIStatBuf * ) CPL_WARN_UNUSED_RESULT;
116 #ifdef _WIN32
117 # define VSI_ISLNK(x) ( 0 ) /* N/A on Windows */
118 # define VSI_ISREG(x) ((x) & S_IFREG)
119 # define VSI_ISDIR(x) ((x) & S_IFDIR)
120 # define VSI_ISCHR(x) ((x) & S_IFCHR)
121 # define VSI_ISBLK(x) ( 0 ) /* N/A on Windows */
122 #else
123
124 # define VSI_ISLNK(x) S_ISLNK(x)
125
126 # define VSI_ISREG(x) S_ISREG(x)
127
128 # define VSI_ISDIR(x) S_ISDIR(x)
129
130 # define VSI_ISCHR(x) S_ISCHR(x)
131 # define VSI_ISBLK(x) S_ISBLK(x)
132
133 #endif
134
135 /* ==================================================================== */
136 /* 64bit stdio file access functions. If we have a big size */
137 /* defined, then provide prototypes for the large file API, */
138 /* otherwise redefine to use the regular api. */
139 /* ==================================================================== */
140
142 typedef GUIntBig vsi_l_offset;
144 #define VSI_L_OFFSET_MAX GUINTBIG_MAX
145
147 /* Make VSIL_STRICT_ENFORCE active in DEBUG builds */
148 #ifdef DEBUG
149 #define VSIL_STRICT_ENFORCE
150 #endif
151
153 #ifdef VSIL_STRICT_ENFORCE
154
155 typedef struct _VSILFILE VSILFILE;
156 #else
157
158 typedef FILE VSILFILE;
159 #endif
160
161 VSILFILE CPL_DLL * VSIFOpenL( const char *, const char * ) CPL_WARN_UNUSED_RESULT;
162 VSILFILE CPL_DLL * VSIFOpenExL( const char *, const char *, int ) CPL_WARN_UNUSED_RESULT;
163 VSILFILE CPL_DLL * VSIFOpenEx2L( const char *, const char *, int, CSLConstList ) CPL_WARN_UNUSED_RESULT;
164 int CPL_DLL VSIFCloseL( VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
165 int CPL_DLL VSIFSeekL( VSILFILE *, vsi_l_offset, int ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
166 vsi_l_offset CPL_DLL VSIFTellL( VSILFILE * ) CPL_WARN_UNUSED_RESULT;
167 void CPL_DLL VSIRewindL( VSILFILE * );
168 size_t CPL_DLL VSIFReadL( void *, size_t, size_t, VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
169 int CPL_DLL VSIFReadMultiRangeL( int nRanges, void ** ppData, const vsi_l_offset* panOffsets, const size_t* panSizes, VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
170 size_t CPL_DLL VSIFWriteL( const void *, size_t, size_t, VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
171 int CPL_DLL VSIFEofL( VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
172 int CPL_DLL VSIFTruncateL( VSILFILE *, vsi_l_offset ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
173 int CPL_DLL VSIFFlushL( VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
174 int CPL_DLL VSIFPrintfL( VSILFILE *, CPL_FORMAT_STRING(const char *), ... ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT CPL_PRINT_FUNC_FORMAT(2, 3);
175 int CPL_DLL VSIFPutcL( int, VSILFILE * ) EXPERIMENTAL_CPL_WARN_UNUSED_RESULT;
176
178 typedef enum
179 {
180 VSI_RANGE_STATUS_UNKNOWN,
181 VSI_RANGE_STATUS_DATA,
182 VSI_RANGE_STATUS_HOLE
183 } VSIRangeStatus;
184
185 VSIRangeStatus CPL_DLL VSIFGetRangeStatusL( VSILFILE * fp, vsi_l_offset nStart, vsi_l_offset nLength );
186
187 int CPL_DLL VSIIngestFile( VSILFILE* fp,
188 const char* pszFilename,
189 GByte** ppabyRet,
190 vsi_l_offset* pnSize,
191 GIntBig nMaxSize ) CPL_WARN_UNUSED_RESULT;
192
193 int CPL_DLL VSIOverwriteFile( VSILFILE* fpTarget, const char* pszSourceFilename ) CPL_WARN_UNUSED_RESULT;
194
195 #if defined(VSI_STAT64_T)
196
197 typedef struct VSI_STAT64_T VSIStatBufL;
198 #else
199
200 #define VSIStatBufL VSIStatBuf
201 #endif
202
203 int CPL_DLL VSIStatL( const char *, VSIStatBufL * ) CPL_WARN_UNUSED_RESULT;
204
206 #define VSI_STAT_EXISTS_FLAG 0x1
207
208 #define VSI_STAT_NATURE_FLAG 0x2
209
210 #define VSI_STAT_SIZE_FLAG 0x4
211
212 #define VSI_STAT_SET_ERROR_FLAG 0x8
213
216 #define VSI_STAT_CACHE_ONLY 0x10
217
218 int CPL_DLL VSIStatExL( const char * pszFilename, VSIStatBufL * psStatBuf, int nFlags ) CPL_WARN_UNUSED_RESULT;
219
220 int CPL_DLL VSIIsCaseSensitiveFS( const char * pszFilename );
221
222 int CPL_DLL VSISupportsSparseFiles( const char* pszPath );
223
224 bool CPL_DLL VSIIsLocal( const char* pszPath );
225
226 bool CPL_DLL VSISupportsSequentialWrite( const char* pszPath, bool bAllowLocalTempFile );
227
228 bool CPL_DLL VSISupportsRandomWrite( const char* pszPath, bool bAllowLocalTempFile );
229
230 int CPL_DLL VSIHasOptimizedReadMultiRange( const char* pszPath );
231
232 const char CPL_DLL *VSIGetActualURL( const char* pszFilename );
233
234 char CPL_DLL *VSIGetSignedURL( const char* pszFilename, CSLConstList papszOptions );
235
236 const char CPL_DLL *VSIGetFileSystemOptions( const char* pszFilename );
237
238 char CPL_DLL **VSIGetFileSystemsPrefixes( void );
239
240 void CPL_DLL *VSIFGetNativeFileDescriptorL( VSILFILE* );
241
242 char CPL_DLL **VSIGetFileMetadata( const char * pszFilename, const char* pszDomain,
243 CSLConstList papszOptions ) CPL_WARN_UNUSED_RESULT;
244
245 int CPL_DLL VSISetFileMetadata( const char * pszFilename,
246 CSLConstList papszMetadata,
247 const char* pszDomain,
248 CSLConstList papszOptions );
249
250 void CPL_DLL VSISetPathSpecificOption( const char* pszPathPrefix, const char* pszKey,
251 const char* pszValue );
252 void CPL_DLL VSIClearPathSpecificOptions(const char* pszPathPrefix );
253 const char CPL_DLL* VSIGetPathSpecificOption( const char* pszPath, const char* pszKey,
254 const char* pszDefault );
255
256 void CPL_DLL VSISetCredential( const char* pszPathPrefix, const char* pszKey,
257 const char* pszValue )
259 CPL_WARN_DEPRECATED("Use VSISetPathSpecificOption instead")
261 ;
262 void CPL_DLL VSIClearCredentials(const char* pszPathPrefix )
264 CPL_WARN_DEPRECATED("Use VSIClearPathSpecificOptions instead")
266 ;
267 const char CPL_DLL* VSIGetCredential( const char* pszPath, const char* pszKey,
268 const char* pszDefault )
270 CPL_WARN_DEPRECATED("Use VSIGetPathSpecificOption instead")
272 ;
273
274 /* ==================================================================== */
275 /* Memory allocation */
276 /* ==================================================================== */
277
278 void CPL_DLL *VSICalloc( size_t, size_t ) CPL_WARN_UNUSED_RESULT;
279 void CPL_DLL *VSIMalloc( size_t ) CPL_WARN_UNUSED_RESULT;
280 void CPL_DLL VSIFree( void * );
281 void CPL_DLL *VSIRealloc( void *, size_t ) CPL_WARN_UNUSED_RESULT;
282 char CPL_DLL *VSIStrdup( const char * ) CPL_WARN_UNUSED_RESULT;
283
284 void CPL_DLL *VSIMallocAligned( size_t nAlignment, size_t nSize ) CPL_WARN_UNUSED_RESULT;
285 void CPL_DLL *VSIMallocAlignedAuto( size_t nSize ) CPL_WARN_UNUSED_RESULT;
286 void CPL_DLL VSIFreeAligned( void* ptr );
287
288 void CPL_DLL *VSIMallocAlignedAutoVerbose( size_t nSize, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
290 #define VSI_MALLOC_ALIGNED_AUTO_VERBOSE( size ) VSIMallocAlignedAutoVerbose(size,__FILE__,__LINE__)
291
299 void CPL_DLL *VSIMalloc2( size_t nSize1, size_t nSize2 ) CPL_WARN_UNUSED_RESULT;
300
308 void CPL_DLL *VSIMalloc3( size_t nSize1, size_t nSize2, size_t nSize3 ) CPL_WARN_UNUSED_RESULT;
309
311 void CPL_DLL *VSIMallocVerbose( size_t nSize, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
313 #define VSI_MALLOC_VERBOSE( size ) VSIMallocVerbose(size,__FILE__,__LINE__)
314
316 void CPL_DLL *VSIMalloc2Verbose( size_t nSize1, size_t nSize2, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
318 #define VSI_MALLOC2_VERBOSE( nSize1, nSize2 ) VSIMalloc2Verbose(nSize1,nSize2,__FILE__,__LINE__)
319
321 void CPL_DLL *VSIMalloc3Verbose( size_t nSize1, size_t nSize2, size_t nSize3, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
323 #define VSI_MALLOC3_VERBOSE( nSize1, nSize2, nSize3 ) VSIMalloc3Verbose(nSize1,nSize2,nSize3,__FILE__,__LINE__)
324
326 void CPL_DLL *VSICallocVerbose( size_t nCount, size_t nSize, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
328 #define VSI_CALLOC_VERBOSE( nCount, nSize ) VSICallocVerbose(nCount,nSize,__FILE__,__LINE__)
329
331 void CPL_DLL *VSIReallocVerbose( void* pOldPtr, size_t nNewSize, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
333 #define VSI_REALLOC_VERBOSE( pOldPtr, nNewSize ) VSIReallocVerbose(pOldPtr,nNewSize,__FILE__,__LINE__)
334
336 char CPL_DLL *VSIStrdupVerbose( const char* pszStr, const char* pszFile, int nLine ) CPL_WARN_UNUSED_RESULT;
338 #define VSI_STRDUP_VERBOSE( pszStr ) VSIStrdupVerbose(pszStr,__FILE__,__LINE__)
339
340 GIntBig CPL_DLL CPLGetPhysicalRAM(void);
341 GIntBig CPL_DLL CPLGetUsablePhysicalRAM(void);
342
343 /* ==================================================================== */
344 /* Other... */
345 /* ==================================================================== */
346
348 #define CPLReadDir VSIReadDir
349 char CPL_DLL **VSIReadDir( const char * );
350 char CPL_DLL **VSIReadDirRecursive( const char *pszPath );
351 char CPL_DLL **VSIReadDirEx( const char *pszPath, int nMaxFiles );
352 char CPL_DLL **VSISiblingFiles( const char *pszPath );
353
355 typedef struct VSIDIR VSIDIR;
356
357 VSIDIR CPL_DLL *VSIOpenDir( const char *pszPath,
358 int nRecurseDepth,
359 const char* const *papszOptions);
360
362 typedef struct VSIDIREntry VSIDIREntry;
366 struct VSIDIREntry
367 {
369 char* pszName;
371 int nMode;
373 vsi_l_offset nSize;
375 GIntBig nMTime;
377 char bModeKnown;
379 char bSizeKnown;
381 char bMTimeKnown;
383 char** papszExtra;
384
385 #if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
386
387 VSIDIREntry();
388 ~VSIDIREntry();
389 VSIDIREntry(const VSIDIREntry&);
390 VSIDIREntry& operator=(VSIDIREntry&) = delete;
392 #endif
393 };
394
395 const VSIDIREntry CPL_DLL *VSIGetNextDirEntry(VSIDIR* dir);
396 void CPL_DLL VSICloseDir(VSIDIR* dir);
397
398 int CPL_DLL VSIMkdir( const char * pszPathname, long mode );
399 int CPL_DLL VSIMkdirRecursive( const char * pszPathname, long mode );
400 int CPL_DLL VSIRmdir( const char * pszDirname );
401 int CPL_DLL VSIRmdirRecursive( const char * pszDirname );
402 int CPL_DLL VSIUnlink( const char * pszFilename );
403 int CPL_DLL *VSIUnlinkBatch( CSLConstList papszFiles );
404 int CPL_DLL VSIRename( const char * oldpath, const char * newpath );
405 int CPL_DLL VSISync( const char* pszSource, const char* pszTarget,
406 const char* const * papszOptions,
407 GDALProgressFunc pProgressFunc,
408 void *pProgressData,
409 char*** ppapszOutputs );
410 int CPL_DLL VSIAbortPendingUploads( const char* pszFilename );
411
412 char CPL_DLL *VSIStrerror( int );
413 GIntBig CPL_DLL VSIGetDiskFreeSpace(const char *pszDirname);
414
415 void CPL_DLL VSINetworkStatsReset( void );
416 char CPL_DLL *VSINetworkStatsGetAsSerializedJSON( char** papszOptions );
417
418 /* ==================================================================== */
419 /* Install special file access handlers. */
420 /* ==================================================================== */
421 void CPL_DLL VSIInstallMemFileHandler(void);
423 void CPL_DLL VSIInstallLargeFileHandler(void);
425 void CPL_DLL VSIInstallSubFileHandler(void);
426 void VSIInstallCurlFileHandler(void);
427 void CPL_DLL VSICurlClearCache(void);
428 void CPL_DLL VSICurlPartialClearCache(const char* pszFilenamePrefix);
429 void VSIInstallCurlStreamingFileHandler(void);
430 void VSIInstallS3FileHandler(void);
431 void VSIInstallS3StreamingFileHandler(void);
432 void VSIInstallGSFileHandler(void);
433 void VSIInstallGSStreamingFileHandler(void);
434 void VSIInstallAzureFileHandler(void);
435 void VSIInstallAzureStreamingFileHandler(void);
436 void VSIInstallADLSFileHandler(void);
437 void VSIInstallOSSFileHandler(void);
438 void VSIInstallOSSStreamingFileHandler(void);
439 void VSIInstallSwiftFileHandler(void);
440 void VSIInstallSwiftStreamingFileHandler(void);
441 void VSIInstallGZipFileHandler(void); /* No reason to export that */
442 void VSIInstallZipFileHandler(void); /* No reason to export that */
443 void VSIInstallStdinHandler(void); /* No reason to export that */
444 void VSIInstallHdfsHandler(void); /* No reason to export that */
445 void VSIInstallWebHdfsHandler(void); /* No reason to export that */
446 void VSIInstallStdoutHandler(void); /* No reason to export that */
447 void CPL_DLL VSIInstallSparseFileHandler(void);
448 void VSIInstallTarFileHandler(void); /* No reason to export that */
449 void CPL_DLL VSIInstallCryptFileHandler(void);
450 void CPL_DLL VSISetCryptKey(const GByte* pabyKey, int nKeySize);
452 void CPL_DLL VSICleanupFileManager(void);
455 VSILFILE CPL_DLL *VSIFileFromMemBuffer( const char *pszFilename,
456 GByte *pabyData,
457 vsi_l_offset nDataLength,
458 int bTakeOwnership ) CPL_WARN_UNUSED_RESULT;
459 GByte CPL_DLL *VSIGetMemFileBuffer( const char *pszFilename,
460 vsi_l_offset *pnDataLength,
461 int bUnlinkAndSeize );
462
464 typedef size_t (*VSIWriteFunction)(const void* ptr, size_t size, size_t nmemb, FILE* stream);
465 void CPL_DLL VSIStdoutSetRedirection( VSIWriteFunction pFct, FILE* stream );
466
471 typedef int (*VSIFilesystemPluginStatCallback) ( void *pUserData, const char *pszFilename, VSIStatBufL *pStatBuf, int nFlags );
476 typedef int (*VSIFilesystemPluginUnlinkCallback) ( void *pUserData, const char *pszFilename );
481 typedef int (*VSIFilesystemPluginRenameCallback) ( void *pUserData, const char *oldpath, const char *newpath );
486 typedef int (*VSIFilesystemPluginMkdirCallback) ( void *pUserData, const char *pszDirname, long nMode );
491 typedef int (*VSIFilesystemPluginRmdirCallback) ( void *pUserData, const char *pszDirname );
496 typedef char** (*VSIFilesystemPluginReadDirCallback) ( void *pUserData, const char *pszDirname, int nMaxFiles );
505 typedef char** (*VSIFilesystemPluginSiblingFilesCallback) ( void *pUserData, const char *pszDirname );
511 typedef void* (*VSIFilesystemPluginOpenCallback) ( void *pUserData, const char *pszFilename, const char *pszAccess );
516 typedef vsi_l_offset (*VSIFilesystemPluginTellCallback) ( void *pFile );
521 typedef int (*VSIFilesystemPluginSeekCallback) ( void *pFile, vsi_l_offset nOffset, int nWhence );
527 typedef size_t (*VSIFilesystemPluginReadCallback) ( void *pFile, void *pBuffer, size_t nSize, size_t nCount );
532 typedef int (*VSIFilesystemPluginReadMultiRangeCallback)( void *pFile, int nRanges, void ** ppData,
533 const vsi_l_offset* panOffsets, const size_t* panSizes );
538 typedef VSIRangeStatus (*VSIFilesystemPluginGetRangeStatusCallback)( void *pFile, vsi_l_offset nOffset, vsi_l_offset nLength );
543 typedef int (*VSIFilesystemPluginEofCallback) ( void *pFile );
548 typedef size_t (*VSIFilesystemPluginWriteCallback) ( void *pFile, const void *pBuffer, size_t nSize,size_t nCount);
553 typedef int (*VSIFilesystemPluginFlushCallback) ( void *pFile );
557 typedef int (*VSIFilesystemPluginTruncateCallback) ( void *pFile, vsi_l_offset nNewSize );
562 typedef int (*VSIFilesystemPluginCloseCallback) ( void *pFile );
563
571 typedef struct {
575 void *pUserData;
576 VSIFilesystemPluginStatCallback stat;
577 VSIFilesystemPluginUnlinkCallback unlink;
578 VSIFilesystemPluginRenameCallback rename;
579 VSIFilesystemPluginMkdirCallback mkdir;
580 VSIFilesystemPluginRmdirCallback rmdir;
581 VSIFilesystemPluginReadDirCallback read_dir;
582 VSIFilesystemPluginOpenCallback open;
583 VSIFilesystemPluginTellCallback tell;
584 VSIFilesystemPluginSeekCallback seek;
585 VSIFilesystemPluginReadCallback read;
586 VSIFilesystemPluginReadMultiRangeCallback read_multi_range;
587 VSIFilesystemPluginGetRangeStatusCallback get_range_status;
588 VSIFilesystemPluginEofCallback eof;
589 VSIFilesystemPluginWriteCallback write;
590 VSIFilesystemPluginFlushCallback flush;
591 VSIFilesystemPluginTruncateCallback truncate;
592 VSIFilesystemPluginCloseCallback close;
593 size_t nBufferSize;
594 size_t nCacheSize;
595 VSIFilesystemPluginSiblingFilesCallback sibling_files;
596 /*
597 Callbacks are defined as a struct allocated by a call to VSIAllocFilesystemPluginCallbacksStruct
598 in order to try to maintain ABI stability when eventually adding a new member.
599 Any callbacks added to this struct SHOULD be added to the END of this struct
600 */
601 } VSIFilesystemPluginCallbacksStruct;
602
607 VSIFilesystemPluginCallbacksStruct CPL_DLL *VSIAllocFilesystemPluginCallbacksStruct( void );
608
613 void CPL_DLL VSIFreeFilesystemPluginCallbacksStruct(VSIFilesystemPluginCallbacksStruct* poCb);
614
621 int CPL_DLL VSIInstallPluginHandler( const char* pszPrefix, const VSIFilesystemPluginCallbacksStruct* poCb);
622
623 /* ==================================================================== */
624 /* Time querying. */
625 /* ==================================================================== */
626
628 unsigned long CPL_DLL VSITime( unsigned long * );
629 const char CPL_DLL *VSICTime( unsigned long );
630 struct tm CPL_DLL *VSIGMTime( const time_t *pnTime,
631 struct tm *poBrokenTime );
632 struct tm CPL_DLL *VSILocalTime( const time_t *pnTime,
633 struct tm *poBrokenTime );
637 /* -------------------------------------------------------------------- */
638 /* the following can be turned on for detailed logging of */
639 /* almost all IO calls. */
640 /* -------------------------------------------------------------------- */
641 #ifdef VSI_DEBUG
642
643 #ifndef DEBUG
644 # define DEBUG
645 #endif
646
647 #include "cpl_error.h"
648
649 #define VSIDebug4(f,a1,a2,a3,a4) CPLDebug( "VSI", f, a1, a2, a3, a4 );
650 #define VSIDebug3( f, a1, a2, a3 ) CPLDebug( "VSI", f, a1, a2, a3 );
651 #define VSIDebug2( f, a1, a2 ) CPLDebug( "VSI", f, a1, a2 );
652 #define VSIDebug1( f, a1 ) CPLDebug( "VSI", f, a1 );
653 #else
654 #define VSIDebug4( f, a1, a2, a3, a4 ) {}
655 #define VSIDebug3( f, a1, a2, a3 ) {}
656 #define VSIDebug2( f, a1, a2 ) {}
657 #define VSIDebug1( f, a1 ) {}
658 #endif
659
661 CPL_C_END
662
663 #endif /* ndef CPL_VSI_H_INCLUDED */
VSIDIREntry::bMTimeKnown
char bMTimeKnown
Whether nMTime is known: 0 = unknown, 1 = known.
Definition: cpl_vsi.h:381
VSIGetNextDirEntry
const VSIDIREntry * VSIGetNextDirEntry(VSIDIR *dir)
Return the next entry of the directory.
Definition: cpl_vsil.cpp:303
VSIFilesystemPluginCallbacksStruct::nBufferSize
size_t nBufferSize
buffer small reads (makes handler read only)
Definition: cpl_vsi.h:593
VSIOpenDir
VSIDIR * VSIOpenDir(const char *pszPath, int nRecurseDepth, const char *const *papszOptions)
Open a directory to read its entries.
Definition: cpl_vsil.cpp:266
VSIOverwriteFile
int VSIOverwriteFile(VSILFILE *fpTarget, const char *pszSourceFilename)
Overwrite an existing file with content from another one.
Definition: cpl_vsil.cpp:2583
VSIInstallSwiftFileHandler
void VSIInstallSwiftFileHandler(void)
Install /vsiswift/ OpenStack Swif Object Storage (Swift) file system handler (requires libcurl)
Definition: cpl_vsil_swift.cpp:788
CPL_PRINT_FUNC_FORMAT
#define CPL_PRINT_FUNC_FORMAT(format_idx, arg_idx)
Tag a function to have printf() formatting.
Definition: cpl_port.h:844
VSI_RANGE_STATUS_HOLE
@ VSI_RANGE_STATUS_HOLE
Hole.
Definition: cpl_vsi.h:182
VSIFilesystemPluginCallbacksStruct::close
VSIFilesystemPluginCloseCallback close
close handle (rw)
Definition: cpl_vsi.h:592
VSIRmdirRecursive
int VSIRmdirRecursive(const char *pszDirname)
Delete a directory recursively.
Definition: cpl_vsil.cpp:690
VSIInstallAzureFileHandler
void VSIInstallAzureFileHandler(void)
Install /vsiaz/ Microsoft Azure Blob file system handler (requires libcurl)
Definition: cpl_vsil_az.cpp:2277
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:63
VSIClearCredentials
void VSIClearCredentials(const char *pszPathPrefix)
Clear path specific options set with VSISetPathSpecificOption()
Definition: cpl_vsil.cpp:2802
CPLGetUsablePhysicalRAM
GIntBig CPLGetUsablePhysicalRAM(void)
Return the total physical RAM, usable by a process, in bytes.
Definition: cpl_vsisimple.cpp:1459
VSIFilesystemPluginRenameCallback
int(* VSIFilesystemPluginRenameCallback)(void *pUserData, const char *oldpath, const char *newpath)
Rename handle.
Definition: cpl_vsi.h:481
VSIFreeAligned
void VSIFreeAligned(void *ptr)
Free a buffer allocated with VSIMallocAligned().
Definition: cpl_vsisimple.cpp:974
GByte
unsigned char GByte
Unsigned byte type.
Definition: cpl_port.h:203
VSISiblingFiles
char ** VSISiblingFiles(const char *pszPath)
Return related filenames.
Definition: cpl_vsil.cpp:151
VSIMallocVerbose
void * VSIMallocVerbose(size_t nSize, const char *pszFile, int nLine)
VSIMallocVerbose.
Definition: cpl_vsisimple.cpp:1137
VSIGetMemFileBuffer
GByte * VSIGetMemFileBuffer(const char *pszFilename, vsi_l_offset *pnDataLength, int bUnlinkAndSeize)
Fetch buffer underlying memory file.
Definition: cpl_vsi_mem.cpp:1010
VSIFilesystemPluginEofCallback
int(* VSIFilesystemPluginEofCallback)(void *pFile)
Has end of file been reached.
Definition: cpl_vsi.h:543
VSIRmdir
int VSIRmdir(const char *pszDirname)
Delete a directory.
Definition: cpl_vsil.cpp:663
VSISupportsRandomWrite
bool VSISupportsRandomWrite(const char *pszPath, bool bAllowLocalTempFile)
Returns if the filesystem supports random write.
Definition: cpl_vsil.cpp:1031
cpl_error.h
VSIReallocVerbose
void * VSIReallocVerbose(void *pOldPtr, size_t nNewSize, const char *pszFile, int nLine)
VSIReallocVerbose.
Definition: cpl_vsisimple.cpp:1223
VSIInstallWebHdfsHandler
void VSIInstallWebHdfsHandler(void)
Install /vsiwebhdfs/ WebHDFS (Hadoop File System) REST API file system handler (requires libcurl)
Definition: cpl_vsil_webhdfs.cpp:1239
VSIFreeFilesystemPluginCallbacksStruct
void VSIFreeFilesystemPluginCallbacksStruct(VSIFilesystemPluginCallbacksStruct *poCb)
free resources allocated by VSIAllocFilesystemPluginCallbacksStruct
Definition: cpl_vsil_plugin.cpp:370
VSIFilesystemPluginCallbacksStruct::seek
VSIFilesystemPluginSeekCallback seek
set current position of handle (rw)
Definition: cpl_vsi.h:584
VSIInstallStdoutHandler
void VSIInstallStdoutHandler(void)
Install /vsistdout/ file system handler.
Definition: cpl_vsil_stdout.cpp:455
VSIFilesystemPluginStatCallback
int(* VSIFilesystemPluginStatCallback)(void *pUserData, const char *pszFilename, VSIStatBufL *pStatBuf, int nFlags)
Return information about a handle.
Definition: cpl_vsi.h:471
VSIDIREntry::nMode
int nMode
File mode.
Definition: cpl_vsi.h:371
VSIGetSignedURL
char * VSIGetSignedURL(const char *pszFilename, CSLConstList papszOptions)
Returns a signed URL of a supplied filename.
Definition: cpl_vsil.cpp:1134
VSIFTruncateL
int VSIFTruncateL(VSILFILE *, vsi_l_offset)
Truncate/expand the file to the specified size.
Definition: cpl_vsil.cpp:2248
VSICloseDir
void VSICloseDir(VSIDIR *dir)
Close a directory.
Definition: cpl_vsil.cpp:322
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:942
VSIInstallAzureStreamingFileHandler
void VSIInstallAzureStreamingFileHandler(void)
Install /vsiaz_streaming/ Microsoft Azure Blob file system handler (requires libcurl)
Definition: cpl_vsil_curl_streaming.cpp:2081
VSIRealloc
void * VSIRealloc(void *, size_t)
Analog of realloc().
Definition: cpl_vsisimple.cpp:680
VSIInstallSubFileHandler
void VSIInstallSubFileHandler(void)
Install /vsisubfile/ virtual file handler.
Definition: cpl_vsil_subfile.cpp:509
VSIFilesystemPluginFlushCallback
int(* VSIFilesystemPluginFlushCallback)(void *pFile)
Sync written bytes.
Definition: cpl_vsi.h:553
VSIDIREntry::pszName
char * pszName
Filename.
Definition: cpl_vsi.h:369
VSIInstallPluginHandler
int VSIInstallPluginHandler(const char *pszPrefix, const VSIFilesystemPluginCallbacksStruct *poCb)
register a handler on the given prefix.
Definition: cpl_vsil_plugin.cpp:360
VSIRangeStatus
VSIRangeStatus
Range status.
Definition: cpl_vsi.h:178
CPLGetPhysicalRAM
GIntBig CPLGetPhysicalRAM(void)
Return the total physical RAM in bytes.
Definition: cpl_vsisimple.cpp:1368
VSIFilesystemPluginTellCallback
vsi_l_offset(* VSIFilesystemPluginTellCallback)(void *pFile)
Return current position in handle.
Definition: cpl_vsi.h:516
VSIMkdir
int VSIMkdir(const char *pszPathname, long mode)
Create a directory.
Definition: cpl_vsil.cpp:347
VSIFilesystemPluginCallbacksStruct::flush
VSIFilesystemPluginFlushCallback flush
sync bytes (w)
Definition: cpl_vsi.h:590
VSIGetFileMetadata
char ** VSIGetFileMetadata(const char *pszFilename, const char *pszDomain, CSLConstList papszOptions)
Get metadata on files.
Definition: cpl_vsil.cpp:829
VSIRename
int VSIRename(const char *oldpath, const char *newpath)
Rename a file.
Definition: cpl_vsil.cpp:498
VSIMkdirRecursive
int VSIMkdirRecursive(const char *pszPathname, long mode)
Create a directory and all its ancestors.
Definition: cpl_vsil.cpp:370
VSIFOpenExL
VSILFILE * VSIFOpenExL(const char *, const char *, int)
Open file.
Definition: cpl_vsil.cpp:1722
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:584
VSIRewindL
void VSIRewindL(VSILFILE *)
Rewind the file pointer to the beginning of the file.
Definition: cpl_vsil.cpp:1953
VSIFilesystemPluginCallbacksStruct::read
VSIFilesystemPluginReadCallback read
read from current position (r)
Definition: cpl_vsi.h:585
VSIIsCaseSensitiveFS
int VSIIsCaseSensitiveFS(const char *pszFilename)
Returns if the filenames of the filesystem are case sensitive.
Definition: cpl_vsil.cpp:922
VSIFilesystemPluginReadDirCallback
char **(* VSIFilesystemPluginReadDirCallback)(void *pUserData, const char *pszDirname, int nMaxFiles)
List directory content.
Definition: cpl_vsi.h:496
VSIWriteFunction
size_t(* VSIWriteFunction)(const void *ptr, size_t size, size_t nmemb, FILE *stream)
Callback used by VSIStdoutSetRedirection()
Definition: cpl_vsi.h:464
VSIHasOptimizedReadMultiRange
int VSIHasOptimizedReadMultiRange(const char *pszPath)
Returns if the filesystem supports efficient multi-range reading.
Definition: cpl_vsil.cpp:1057
VSIFilesystemPluginCallbacksStruct::tell
VSIFilesystemPluginTellCallback tell
get current position of handle (rw)
Definition: cpl_vsi.h:583
VSIFilesystemPluginCallbacksStruct::nCacheSize
size_t nCacheSize
max mem to use per file when buffering
Definition: cpl_vsi.h:594
VSIGetPathSpecificOption
const char * VSIGetPathSpecificOption(const char *pszPath, const char *pszKey, const char *pszDefault)
Get the value a path specific option.
Definition: cpl_vsil.cpp:2859
VSIFilesystemPluginCallbacksStruct
struct containing callbacks to used by the handler.
Definition: cpl_vsi.h:571
VSIFPrintfL
int VSIFPrintfL(VSILFILE *, const char *,...)
Formatted write to file.
Definition: cpl_vsil.cpp:2274
VSIFOpenEx2L
VSILFILE * VSIFOpenEx2L(const char *, const char *, int, CSLConstList)
Open file.
Definition: cpl_vsil.cpp:1772
VSIInstallSparseFileHandler
void VSIInstallSparseFileHandler(void)
Install /vsisparse/ virtual file handler.
Definition: cpl_vsil_sparsefile.cpp:550
VSIFilesystemPluginSeekCallback
int(* VSIFilesystemPluginSeekCallback)(void *pFile, vsi_l_offset nOffset, int nWhence)
Seek to position in handle.
Definition: cpl_vsi.h:521
VSIInstallADLSFileHandler
void VSIInstallADLSFileHandler(void)
Install /vsiaz/ Microsoft Azure Data Lake Storage Gen2 file system handler (requires libcurl)
Definition: cpl_vsil_adls.cpp:2185
VSIDIREntry::nSize
vsi_l_offset nSize
File size.
Definition: cpl_vsi.h:373
VSIFilesystemPluginGetRangeStatusCallback
VSIRangeStatus(* VSIFilesystemPluginGetRangeStatusCallback)(void *pFile, vsi_l_offset nOffset, vsi_l_offset nLength)
Get empty ranges.
Definition: cpl_vsi.h:538
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:2718
CPL_C_START
#define CPL_C_START
Macro to start a block of C symbols.
Definition: cpl_port.h:304
VSI_RANGE_STATUS_UNKNOWN
@ VSI_RANGE_STATUS_UNKNOWN
Unknown.
Definition: cpl_vsi.h:180
VSIUnlinkBatch
int * VSIUnlinkBatch(CSLConstList papszFiles)
Delete several files, possibly in a batch.
Definition: cpl_vsil.cpp:454
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:2363
VSIDIREntry::papszExtra
char ** papszExtra
NULL-terminated list of extra properties.
Definition: cpl_vsi.h:383
VSIInstallS3FileHandler
void VSIInstallS3FileHandler(void)
Install /vsis3/ Amazon S3 file system handler (requires libcurl)
Definition: cpl_vsil_s3.cpp:4759
VSIAllocFilesystemPluginCallbacksStruct
VSIFilesystemPluginCallbacksStruct * VSIAllocFilesystemPluginCallbacksStruct(void)
return a VSIFilesystemPluginCallbacksStruct to be populated at runtime with handler callbacks
Definition: cpl_vsil_plugin.cpp:367
VSIClearPathSpecificOptions
void VSIClearPathSpecificOptions(const char *pszPathPrefix)
Clear path specific options set with VSISetPathSpecificOption()
Definition: cpl_vsil.cpp:2818
VSIInstallGZipFileHandler
void VSIInstallGZipFileHandler(void)
Install GZip file system handler.
Definition: cpl_vsil_gzip.cpp:2477
VSIReadDirEx
char ** VSIReadDirEx(const char *pszPath, int nMaxFiles)
Read names in a directory.
Definition: cpl_vsil.cpp:123
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:527
VSIFilesystemPluginCallbacksStruct::unlink
VSIFilesystemPluginUnlinkCallback unlink
unlink handle by name ()
Definition: cpl_vsi.h:577
CSLConstList
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition: cpl_port.h:1056
VSIFTellL
vsi_l_offset VSIFTellL(VSILFILE *)
Tell current file offset.
Definition: cpl_vsil.cpp:1931
GUIntBig
unsigned long long GUIntBig
Large unsigned integer type (generally 64-bit unsigned integer type).
Definition: cpl_port.h:233
VSIFilesystemPluginCallbacksStruct::get_range_status
VSIFilesystemPluginGetRangeStatusCallback get_range_status
get range status ()
Definition: cpl_vsi.h:587
VSIFilesystemPluginCallbacksStruct::rename
VSIFilesystemPluginRenameCallback rename
rename handle ()
Definition: cpl_vsi.h:578
VSIFSeekL
int VSIFSeekL(VSILFILE *, vsi_l_offset, int)
Seek to requested offset.
Definition: cpl_vsil.cpp:1888
VSIFilesystemPluginUnlinkCallback
int(* VSIFilesystemPluginUnlinkCallback)(void *pUserData, const char *pszFilename)
Remove handle by name.
Definition: cpl_vsi.h:476
VSIInstallGSFileHandler
void VSIInstallGSFileHandler(void)
Install /vsigs/ Google Cloud Storage file system handler (requires libcurl)
Definition: cpl_vsil_gs.cpp:824
CPL_C_END
#define CPL_C_END
Macro to end a block of C symbols.
Definition: cpl_port.h:306
VSIInstallStdinHandler
void VSIInstallStdinHandler(void)
Install /vsistdin/ file system handler.
Definition: cpl_vsil_stdin.cpp:653
VSIInstallHdfsHandler
void VSIInstallHdfsHandler(void)
Install /vsihdfs/ file system handler (requires JVM and HDFS support)
Definition: cpl_vsil_hdfs.cpp:414
VSIFilesystemPluginMkdirCallback
int(* VSIFilesystemPluginMkdirCallback)(void *pUserData, const char *pszDirname, long nMode)
Create Directory.
Definition: cpl_vsi.h:486
VSIMalloc3Verbose
void * VSIMalloc3Verbose(size_t nSize1, size_t nSize2, size_t nSize3, const char *pszFile, int nLine)
VSIMalloc3Verbose.
Definition: cpl_vsisimple.cpp:1179
VSIDIREntry
Directory entry.
Definition: cpl_vsi.h:366
VSIStatL
int VSIStatL(const char *, VSIStatBufL *)
Get filesystem object info.
Definition: cpl_vsil.cpp:727
VSIUnlink
int VSIUnlink(const char *pszFilename)
Delete a file.
Definition: cpl_vsil.cpp:422
VSIInstallCryptFileHandler
void VSIInstallCryptFileHandler(void)
Install /vsicrypt/ encrypted file system handler (requires libcrypto++)
Definition: cpl_vsil_crypt.cpp:2046
VSIInstallGSStreamingFileHandler
void VSIInstallGSStreamingFileHandler(void)
Install /vsigs_streaming/ Google Cloud Storage file system handler (requires libcurl)
Definition: cpl_vsil_curl_streaming.cpp:2061
VSIFilesystemPluginRmdirCallback
int(* VSIFilesystemPluginRmdirCallback)(void *pUserData, const char *pszDirname)
Delete Directory.
Definition: cpl_vsi.h:491
VSISupportsSparseFiles
int VSISupportsSparseFiles(const char *pszPath)
Returns if the filesystem supports sparse files.
Definition: cpl_vsil.cpp:952
VSIMalloc2Verbose
void * VSIMalloc2Verbose(size_t nSize1, size_t nSize2, const char *pszFile, int nLine)
VSIMalloc2Verbose.
Definition: cpl_vsisimple.cpp:1154
VSIGetFileSystemsPrefixes
char ** VSIGetFileSystemsPrefixes(void)
Return the list of prefixes for virtual file system handlers currently registered.
Definition: cpl_vsil.cpp:2698
VSIInstallCurlStreamingFileHandler
void VSIInstallCurlStreamingFileHandler(void)
Install /vsicurl_streaming/ HTTP/FTP file system handler (requires libcurl).
Definition: cpl_vsil_curl_streaming.cpp:2020
VSIFilesystemPluginTruncateCallback
int(* VSIFilesystemPluginTruncateCallback)(void *pFile, vsi_l_offset nNewSize)
Truncate handle.
Definition: cpl_vsi.h:557
VSIInstallCurlFileHandler
void VSIInstallCurlFileHandler(void)
Install /vsicurl/ HTTP/FTP file system handler (requires libcurl)
Definition: cpl_vsil_curl.cpp:5530
VSIStrerror
char * VSIStrerror(int)
Return the error string corresponding to the error number.
Definition: cpl_vsisimple.cpp:1346
VSISetCredential
void VSISetCredential(const char *pszPathPrefix, const char *pszKey, const char *pszValue)
Set a credential (or more generally an option related to a virtual file system) for a given path pref...
Definition: cpl_vsil.cpp:2742
VSIInstallTarFileHandler
void VSIInstallTarFileHandler(void)
Install /vsitar/ file system handler.
Definition: cpl_vsil_tar.cpp:640
VSIFFlushL
int VSIFFlushL(VSILFILE *)
Flush pending writes to disk.
Definition: cpl_vsil.cpp:1994
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:532
VSIFilesystemPluginSiblingFilesCallback
char **(* VSIFilesystemPluginSiblingFilesCallback)(void *pUserData, const char *pszDirname)
List related files.
Definition: cpl_vsi.h:505
VSINetworkStatsGetAsSerializedJSON
char * VSINetworkStatsGetAsSerializedJSON(char **papszOptions)
Return network related statistics, as a JSON serialized object.
Definition: cpl_vsil_curl.cpp:5714
VSIInstallMemFileHandler
void VSIInstallMemFileHandler(void)
Install "memory" file system handler.
Definition: cpl_vsi_mem.cpp:910
VSIInstallZipFileHandler
void VSIInstallZipFileHandler(void)
Install ZIP file system handler.
Definition: cpl_vsil_gzip.cpp:3332
vsi_l_offset
GUIntBig vsi_l_offset
Type for a file offset.
Definition: cpl_vsi.h:142
VSIFree
void VSIFree(void *)
Analog of free() for data allocated with VSIMalloc(), VSICalloc(), VSIRealloc()
Definition: cpl_vsisimple.cpp:826
VSIFilesystemPluginCallbacksStruct::stat
VSIFilesystemPluginStatCallback stat
stat handle by name (rw)
Definition: cpl_vsi.h:576
VSIInstallOSSFileHandler
void VSIInstallOSSFileHandler(void)
Install /vsioss/ Alibaba Cloud Object Storage Service (OSS) file system handler (requires libcurl)
Definition: cpl_vsil_oss.cpp:409
VSIMalloc2
void * VSIMalloc2(size_t nSize1, size_t nSize2)
VSIMalloc2 allocates (nSize1 * nSize2) bytes.
Definition: cpl_vsisimple.cpp:1115
VSIStrdup
char * VSIStrdup(const char *)
Analog of strdup().
Definition: cpl_vsisimple.cpp:994
VSICalloc
void * VSICalloc(size_t, size_t)
Analog of calloc().
Definition: cpl_vsisimple.cpp:443
VSIStrdupVerbose
char * VSIStrdupVerbose(const char *pszStr, const char *pszFile, int nLine)
VSIStrdupVerbose.
Definition: cpl_vsisimple.cpp:1241
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:937
VSIFCloseL
int VSIFCloseL(VSILFILE *)
Close file.
Definition: cpl_vsil.cpp:1828
VSIFilesystemPluginCallbacksStruct::mkdir
VSIFilesystemPluginMkdirCallback mkdir
make directory ()
Definition: cpl_vsi.h:579
VSIFilesystemPluginCallbacksStruct::rmdir
VSIFilesystemPluginRmdirCallback rmdir
remove directory ()
Definition: cpl_vsi.h:580
VSISetPathSpecificOption
void VSISetPathSpecificOption(const char *pszPathPrefix, const char *pszKey, const char *pszValue)
Set a path specific option for a given path prefix.
Definition: cpl_vsil.cpp:2776
VSIGetCredential
const char * VSIGetCredential(const char *pszPath, const char *pszKey, const char *pszDefault)
Get the value of a credential (or more generally an option related to a virtual file system) for a gi...
Definition: cpl_vsil.cpp:2841
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:2106
VSIMalloc
void * VSIMalloc(size_t)
Analog of malloc().
Definition: cpl_vsisimple.cpp:557
VSIReadDirRecursive
char ** VSIReadDirRecursive(const char *pszPath)
Read names in a directory recursively.
Definition: cpl_vsil.cpp:185
GIntBig
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition: cpl_port.h:230
VSIFilesystemPluginOpenCallback
void *(* VSIFilesystemPluginOpenCallback)(void *pUserData, const char *pszFilename, const char *pszAccess)
Open a handle.
Definition: cpl_vsi.h:511
VSIStatExL
int VSIStatExL(const char *pszFilename, VSIStatBufL *psStatBuf, int nFlags)
Get filesystem object info.
Definition: cpl_vsil.cpp:766
VSIDIREntry::nMTime
GIntBig nMTime
Last modification time (seconds since 1970/01/01)
Definition: cpl_vsi.h:375
VSIFilesystemPluginCallbacksStruct::sibling_files
VSIFilesystemPluginSiblingFilesCallback sibling_files
list related files
Definition: cpl_vsi.h:595
VSIDIREntry::bModeKnown
char bModeKnown
Whether nMode is known: 0 = unknown, 1 = known.
Definition: cpl_vsi.h:377
VSIDIR
struct VSIDIR VSIDIR
Opaque type for a directory iterator.
Definition: cpl_vsi.h:355
VSIFilesystemPluginCallbacksStruct::read_dir
VSIFilesystemPluginReadDirCallback read_dir
list directory content (r?)
Definition: cpl_vsi.h:581
VSISupportsSequentialWrite
bool VSISupportsSequentialWrite(const char *pszPath, bool bAllowLocalTempFile)
Returns if the filesystem supports sequential write.
Definition: cpl_vsil.cpp:1006
VSISetCryptKey
void VSISetCryptKey(const GByte *pabyKey, int nKeySize)
Installs the encryption/decryption key.
Definition: cpl_vsil_crypt.cpp:207
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:869
VSIStatBufL
#define VSIStatBufL
Type for VSIStatL()
Definition: cpl_vsi.h:200
VSIFWriteL
size_t VSIFWriteL(const void *, size_t, size_t, VSILFILE *)
Write bytes to file.
Definition: cpl_vsil.cpp:2160
VSIGetDiskFreeSpace
GIntBig VSIGetDiskFreeSpace(const char *pszDirname)
Return free disk space available on the filesystem.
Definition: cpl_vsil.cpp:2676
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:859
cpl_port.h
VSIInstallOSSStreamingFileHandler
void VSIInstallOSSStreamingFileHandler(void)
Install /vsiaz_streaming/ Alibaba Cloud Object Storage Service (OSS) (requires libcurl)
Definition: cpl_vsil_curl_streaming.cpp:2102
VSIInstallSwiftStreamingFileHandler
void VSIInstallSwiftStreamingFileHandler(void)
Install /vsiswift_streaming/ OpenStack Swif Object Storage (Swift) file system handler (requires libc...
Definition: cpl_vsil_curl_streaming.cpp:2123
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:5592
VSIInstallS3StreamingFileHandler
void VSIInstallS3StreamingFileHandler(void)
Install /vsis3_streaming/ Amazon S3 file system handler (requires libcurl).
Definition: cpl_vsil_curl_streaming.cpp:2040
VSIMallocAlignedAutoVerbose
void * VSIMallocAlignedAutoVerbose(size_t nSize, const char *pszFile, int nLine)
See VSIMallocAlignedAuto()
Definition: cpl_vsisimple.cpp:950
VSIFEofL
int VSIFEofL(VSILFILE *)
Test for end of file.
Definition: cpl_vsil.cpp:2206
VSIFOpenL
VSILFILE * VSIFOpenL(const char *, const char *)
Open file.
Definition: cpl_vsil.cpp:1172
VSIIsLocal
bool VSIIsLocal(const char *pszPath)
Returns if the file/filesystem is "local".
Definition: cpl_vsil.cpp:981
VSIMallocAligned
void * VSIMallocAligned(size_t nAlignment, size_t nSize)
Allocates a buffer with an alignment constraint.
Definition: cpl_vsisimple.cpp:891
VSIReadDir
char ** VSIReadDir(const char *)
Read names in a directory.
Definition: cpl_vsil.cpp:89
VSINetworkStatsReset
void VSINetworkStatsReset(void)
Clear network related statistics.
Definition: cpl_vsil_curl.cpp:5616
VSIFilesystemPluginCallbacksStruct::eof
VSIFilesystemPluginEofCallback eof
has end of file been reached (r?)
Definition: cpl_vsi.h:588
VSIFilesystemPluginCallbacksStruct::read_multi_range
VSIFilesystemPluginReadMultiRangeCallback read_multi_range
read multiple blocks ()
Definition: cpl_vsi.h:586
VSIFilesystemPluginCallbacksStruct::truncate
VSIFilesystemPluginTruncateCallback truncate
truncate handle (w?)
Definition: cpl_vsi.h:591
VSIFilesystemPluginCallbacksStruct::open
VSIFilesystemPluginOpenCallback open
open handle by name (rw)
Definition: cpl_vsi.h:582
VSICurlClearCache
void VSICurlClearCache(void)
Clean local cache associated with /vsicurl/ (and related file systems)
Definition: cpl_vsil_curl.cpp:5553
VSISetFileMetadata
int VSISetFileMetadata(const char *pszFilename, CSLConstList papszMetadata, const char *pszDomain, CSLConstList papszOptions)
Set metadata on files.
Definition: cpl_vsil.cpp:886
VSIDIREntry::bSizeKnown
char bSizeKnown
Whether nSize is known: 0 = unknown, 1 = known.
Definition: cpl_vsi.h:379
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:2400
VSIFPutcL
int VSIFPutcL(int, VSILFILE *)
Write a single byte to the file.
Definition: cpl_vsil.cpp:2311
VSIFilesystemPluginCallbacksStruct::pUserData
void * pUserData
Optional opaque pointer passed back to filemanager callbacks (e.g.
Definition: cpl_vsi.h:575
VSIFilesystemPluginWriteCallback
size_t(* VSIFilesystemPluginWriteCallback)(void *pFile, const void *pBuffer, size_t nSize, size_t nCount)
Write bytes at current offset.
Definition: cpl_vsi.h:548
VSIGetActualURL
const char * VSIGetActualURL(const char *pszFilename)
Returns the actual URL of a supplied filename.
Definition: cpl_vsil.cpp:1087
VSIAbortPendingUploads
int VSIAbortPendingUploads(const char *pszFilename)
Abort ongoing multi-part uploads.
Definition: cpl_vsil.cpp:635
VSIMalloc3
void * VSIMalloc3(size_t nSize1, size_t nSize2, size_t nSize3)
VSIMalloc3 allocates (nSize1 * nSize2 * nSize3) bytes.
Definition: cpl_vsisimple.cpp:1128
VSIFilesystemPluginCallbacksStruct::write
VSIFilesystemPluginWriteCallback write
write bytes to current position (w)
Definition: cpl_vsi.h:589
VSI_RANGE_STATUS_DATA
@ VSI_RANGE_STATUS_DATA
Data present.
Definition: cpl_vsi.h:181
VSIFGetNativeFileDescriptorL
void * VSIFGetNativeFileDescriptorL(VSILFILE *)
Returns the "native" file descriptor for the virtual handle.
Definition: cpl_vsil.cpp:2655
VSIFilesystemPluginCloseCallback
int(* VSIFilesystemPluginCloseCallback)(void *pFile)
Close file handle.
Definition: cpl_vsi.h:562
VSICallocVerbose
void * VSICallocVerbose(size_t nCount, size_t nSize, const char *pszFile, int nLine)
VSICallocVerbose.
Definition: cpl_vsisimple.cpp:1204
VSILFILE
FILE VSILFILE
Opaque type for a FILE that implements the VSIVirtualHandle API.
Definition: cpl_vsi.h:158
VSIFReadL
size_t VSIFReadL(void *, size_t, size_t, VSILFILE *)
Read bytes from file.
Definition: cpl_vsil.cpp:2046