13#ifndef CPL_VSIL_CURL_CLASS_H_INCLUDED
14#define CPL_VSIL_CURL_CLASS_H_INCLUDED
23#include "cpl_vsil_curl_priv.h"
24#include "cpl_mem_cache.h"
26#include "cpl_curl_priv.h"
30#include <condition_variable>
46#define HAVE_CURLINFO_REDIRECT_URL
48void VSICurlStreamingClearCache(
void);
50struct curl_slist *VSICurlSetOptions(CURL *hCurlHandle,
const char *pszURL,
51 const char *
const *papszOptions);
52struct curl_slist *VSICurlMergeHeaders(
struct curl_slist *poDest,
53 struct curl_slist *poSrcToDestroy);
55struct curl_slist *VSICurlSetContentTypeFromExt(
struct curl_slist *polist,
58struct curl_slist *VSICurlSetCreationHeadersFromOptions(
59 struct curl_slist *headers,
CSLConstList papszOptions,
const char *pszPath);
74 unsigned int nGenerationAuthParameters = 0;
75 ExistStatus eExists = EXIST_UNKNOWN;
79 time_t nExpireTimestampLocal = 0;
80 std::string osRedirectURL{};
81 bool bHasComputedFileSize =
false;
82 bool bIsDirectory =
false;
84 bool bS3LikeRedirect =
false;
90 bool bGotFileList =
false;
91 unsigned int nGenerationAuthParameters = 0;
97 char *pBuffer =
nullptr;
100 bool bMultiRange =
false;
104 int nFirstHTTPCode = 0;
106 bool bFoundContentRange =
false;
108 bool bInterruptDownload =
false;
109 bool bDetectRangeDownloadingError =
false;
113 VSICurlReadCbkFunc pfnReadCbk =
nullptr;
114 void *pReadCbkUserData =
nullptr;
115 bool bInterrupted =
false;
120 const GByte *pabyData =
nullptr;
122 size_t nTotalSize = 0;
124 static size_t ReadCallBackBuffer(
char *buffer,
size_t size,
size_t nitems,
127 PutData *poThis =
static_cast<PutData *
>(instream);
128 const size_t nSizeMax = size * nitems;
129 const size_t nSizeToWrite =
130 std::min(nSizeMax, poThis->nTotalSize - poThis->nOff);
131 memcpy(buffer, poThis->pabyData + poThis->nOff, nSizeToWrite);
132 poThis->nOff += nSizeToWrite;
143class VSICurlFilesystemHandlerBase :
public VSIFilesystemHandler
147 struct FilenameOffsetPair
149 std::string filename_;
152 FilenameOffsetPair(
const std::string &filename,
vsi_l_offset offset)
153 : filename_(filename), offset_(offset)
157 bool operator==(
const FilenameOffsetPair &other)
const
159 return filename_ == other.filename_ && offset_ == other.offset_;
163 struct FilenameOffsetPairHasher
165 std::size_t operator()(
const FilenameOffsetPair &k)
const
167 return std::hash<std::string>()(k.filename_) ^
168 std::hash<vsi_l_offset>()(k.offset_);
172 using RegionCacheType = lru11::Cache<
173 FilenameOffsetPair, std::shared_ptr<std::string>, lru11::NullLock,
176 typename std::list<lru11::KeyValuePair<
177 FilenameOffsetPair, std::shared_ptr<std::string>>>::iterator,
178 FilenameOffsetPairHasher>>;
180 std::unique_ptr<RegionCacheType>
181 m_poRegionCacheDoNotUseDirectly{};
183 RegionCacheType *GetRegionCache();
190 lru11::Cache<std::string, bool> oCacheFileProp;
192 int nCachedFilesInDirList = 0;
193 lru11::Cache<std::string, CachedDirList> oCacheDirList;
195 char **ParseHTMLFileList(
const char *pszFilename,
int nMaxFiles,
196 char *pszData,
bool *pbGotFileList);
201 struct RegionInDownload
204 std::condition_variable oCond{};
205 bool bDownloadInProgress =
false;
207 std::string osData{};
210 std::mutex m_oMutex{};
211 std::map<std::string, std::unique_ptr<RegionInDownload>>
212 m_oMapRegionInDownload{};
215 CPLMutex *hMutex =
nullptr;
217 virtual VSICurlHandle *CreateFileHandle(
const char *pszFilename);
218 virtual char **GetFileList(
const char *pszFilename,
int nMaxFiles,
219 bool *pbGotFileList);
221 void RegisterEmptyDir(
const std::string &osDirname);
224 AnalyseS3FileList(
const std::string &osBaseURL,
const char *pszXML,
226 const std::set<std::string> &oSetIgnoredStorageClasses,
229 void AnalyseSwiftFileList(
const std::string &osBaseURL,
230 const std::string &osPrefix,
const char *pszJson,
232 int nMaxFiles,
bool &bIsTruncated,
233 std::string &osNextMarker);
235 static const char *GetOptionsStatic();
237 VSICurlFilesystemHandlerBase();
240 ~VSICurlFilesystemHandlerBase()
override;
242 static bool IsAllowedFilename(
const char *pszFilename);
248 int Stat(
const char *pszFilename,
VSIStatBufL *pStatBuf,
249 int nFlags)
override;
250 int Unlink(
const char *pszFilename)
override;
251 int Rename(
const char *oldpath,
const char *newpath)
override;
252 int Mkdir(
const char *pszDirname,
long nMode)
override;
253 int Rmdir(
const char *pszDirname)
override;
254 char **ReadDirEx(
const char *pszDirname,
int nMaxFiles)
override;
255 char **SiblingFiles(
const char *pszFilename)
override;
257 int HasOptimizedReadMultiRange(
const char * )
override
262 const char *GetActualURL(
const char *pszFilename)
override;
264 const char *GetOptions()
override;
266 char **GetFileMetadata(
const char *pszFilename,
const char *pszDomain,
269 char **ReadDirInternal(
const char *pszDirname,
int nMaxFiles,
270 bool *pbGotFileList);
271 void InvalidateDirContent(
const char *pszDirname);
273 virtual const char *GetDebugKey()
const = 0;
275 virtual std::string GetFSPrefix()
const = 0;
276 virtual bool AllowCachedDataFor(
const char *pszFilename);
278 virtual bool IsLocal(
const char * )
override
284 SupportsSequentialWrite(
const char * ,
290 virtual bool SupportsRandomWrite(
const char * ,
296 std::shared_ptr<std::string> GetRegion(
const char *pszURL,
299 void AddRegion(
const char *pszURL,
vsi_l_offset nFileOffsetStart,
300 size_t nSize,
const char *pData);
302 std::pair<bool, std::string>
303 NotifyStartDownloadRegion(
const std::string &osURL,
305 void NotifyStopDownloadRegion(
const std::string &osURL,
307 const std::string &osData);
309 bool GetCachedFileProp(
const char *pszURL, FileProp &oFileProp);
310 void SetCachedFileProp(
const char *pszURL, FileProp &oFileProp);
311 void InvalidateCachedData(
const char *pszURL);
313 CURLM *GetCurlMultiHandleFor(
const std::string &osURL);
315 virtual void ClearCache();
316 virtual void PartialClearCache(
const char *pszFilename);
318 bool GetCachedDirList(
const char *pszURL, CachedDirList &oCachedDirList);
319 void SetCachedDirList(
const char *pszURL, CachedDirList &oCachedDirList);
320 bool ExistsInCacheDirList(
const std::string &osDirname,
bool *pbIsDir);
322 virtual std::string GetURLFromFilename(
const std::string &osFilename)
const;
325 GetStreamingFilename(
const std::string &osFilename)
const override = 0;
327 static std::set<std::string> GetS3IgnoredStorageClasses();
330class VSICurlFilesystemHandler :
public VSICurlFilesystemHandlerBase
335 VSICurlFilesystemHandler() =
default;
337 const char *GetDebugKey()
const override
342 std::string GetFSPrefix()
const override
348 GetStreamingFilename(
const std::string &osFilename)
const override;
360 VSICurlFilesystemHandlerBase *poFS =
nullptr;
362 bool m_bCached =
true;
364 mutable FileProp oFileProp{};
366 mutable std::mutex m_oMutex{};
367 std::string m_osFilename{};
368 char *m_pszURL =
nullptr;
369 mutable std::string m_osQueryString{};
372 CPLHTTPRetryParameters
376 int nBlocksToDownload = 1;
378 bool bStopOnInterruptUntilUninstall =
false;
379 bool bInterrupted =
false;
380 VSICurlReadCbkFunc pfnReadCbk =
nullptr;
381 void *pReadCbkUserData =
nullptr;
385 void DownloadRegionPostProcess(
const vsi_l_offset startOffset,
386 const int nBlocks,
const char *pBuffer,
395 virtual std::string DownloadRegion(
vsi_l_offset startOffset,
int nBlocks);
397 bool m_bUseHead =
false;
398 bool m_bUseRedirectURLIfNoQueryStringParams =
false;
400 mutable std::atomic<bool> m_bInterrupt =
false;
404 mutable bool m_bPlanetaryComputerURLSigning =
false;
405 mutable std::string m_osPlanetaryComputerCollection{};
406 void ManagePlanetaryComputerSigning()
const;
408 int ReadMultiRangeSingleGet(
int nRanges,
void **ppData,
410 const size_t *panSizes);
411 std::string GetRedirectURLIfValid(
bool &bHasExpired,
414 void UpdateRedirectInfo(CURL *hCurlHandle,
415 const WriteFuncStruct &sWriteFuncHeaderData);
418 struct AdviseReadRange
422 std::condition_variable oCV{};
425 std::vector<GByte> abyData{};
428 std::vector<std::unique_ptr<AdviseReadRange>> m_aoAdviseReadRanges{};
429 std::thread m_oThreadAdviseRead{};
432 virtual struct curl_slist *
433 GetCurlHeaders(
const std::string & ,
434 const struct curl_slist * )
439 virtual bool AllowAutomaticRedirection()
444 virtual bool CanRestartOnError(
const char *,
const char *,
bool)
449 virtual bool UseLimitRangeGetInsteadOfHead()
454 virtual bool IsDirectoryFromExists(
const char * ,
460 virtual void ProcessGetFileSizeResult(
const char * )
464 void SetURL(
const char *pszURL);
466 virtual bool Authenticate(
const char * )
472 VSICurlHandle(VSICurlFilesystemHandlerBase *poFS,
const char *pszFilename,
473 const char *pszURLIn =
nullptr);
474 ~VSICurlHandle()
override;
478 size_t Read(
void *pBuffer,
size_t nSize,
size_t nMemb)
override;
479 int ReadMultiRange(
int nRanges,
void **ppData,
481 const size_t *panSizes)
override;
482 size_t Write(
const void *pBuffer,
size_t nSize,
size_t nMemb)
override;
483 void ClearErr()
override;
485 int Error()
override;
486 int Flush()
override;
487 int Close()
override;
489 void Interrupt()
override
494 bool HasPRead()
const override
499 size_t PRead(
void *pBuffer,
size_t nSize,
502 void AdviseRead(
int nRanges,
const vsi_l_offset *panOffsets,
503 const size_t *panSizes)
override;
505 size_t GetAdviseReadTotalBytesLimit()
const override;
507 bool IsKnownFileSize()
const
509 return oFileProp.bHasComputedFileSize;
512 vsi_l_offset GetFileSizeOrHeaders(
bool bSetError,
bool bGetHeaders);
516 return GetFileSizeOrHeaders(bSetError,
false);
519 bool Exists(
bool bSetError);
521 bool IsDirectory()
const
523 return oFileProp.bIsDirectory;
528 return oFileProp.nMode;
531 time_t GetMTime()
const
533 return oFileProp.mTime;
541 int InstallReadCbk(VSICurlReadCbkFunc pfnReadCbk,
void *pfnUserData,
542 int bStopOnInterruptUntilUninstall);
543 int UninstallReadCbk();
545 const char *GetURL()
const
555class VSICurlFilesystemHandlerBaseWritable :
public VSICurlFilesystemHandlerBase
560 VSICurlFilesystemHandlerBaseWritable() =
default;
562 virtual VSIVirtualHandleUniquePtr
563 CreateWriteHandle(
const char *pszFilename,
CSLConstList papszOptions) = 0;
569 bool SupportsSequentialWrite(
const char * ,
575 bool SupportsRandomWrite(
const char * ,
583class IVSIS3LikeFSHandler :
public VSICurlFilesystemHandlerBaseWritable
587 virtual int MkdirInternal(
const char *pszDirname,
long nMode,
591 char **GetFileList(
const char *pszFilename,
int nMaxFiles,
592 bool *pbGotFileList)
override;
594 virtual IVSIS3LikeHandleHelper *CreateHandleHelper(
const char *pszURI,
595 bool bAllowNoObject) = 0;
597 virtual int CopyObject(
const char *oldpath,
const char *newpath,
600 int RmdirRecursiveInternal(
const char *pszDirname,
int nBatchSize);
603 IsAllowedHeaderForObjectCreation(
const char * )
608 IVSIS3LikeFSHandler() =
default;
611 int Unlink(
const char *pszFilename)
override;
612 int Mkdir(
const char *pszDirname,
long nMode)
override;
613 int Rmdir(
const char *pszDirname)
override;
614 int Stat(
const char *pszFilename,
VSIStatBufL *pStatBuf,
615 int nFlags)
override;
616 int Rename(
const char *oldpath,
const char *newpath)
override;
618 virtual int CopyFile(
const char *pszSource,
const char *pszTarget,
620 const char *
const *papszOptions,
621 GDALProgressFunc pProgressFunc,
622 void *pProgressData)
override;
624 virtual int DeleteObject(
const char *pszFilename);
626 virtual int *DeleteObjectBatch(
CSLConstList papszFilesOrDirs);
628 bool Sync(
const char *pszSource,
const char *pszTarget,
629 const char *
const *papszOptions, GDALProgressFunc pProgressFunc,
630 void *pProgressData,
char ***ppapszOutputs)
override;
632 VSIDIR *OpenDir(
const char *pszPath,
int nRecurseDepth,
633 const char *
const *papszOptions)
override;
640class IVSIS3LikeFSHandlerWithMultipartUpload :
public IVSIS3LikeFSHandler
645 IVSIS3LikeFSHandlerWithMultipartUpload() =
default;
648 virtual bool SupportsNonSequentialMultipartUpload()
const
653 virtual bool SupportsParallelMultipartUpload()
const
658 virtual bool SupportsMultipartAbort()
const = 0;
660 size_t GetUploadChunkSizeInBytes(
const char *pszFilename,
661 const char *pszSpecifiedValInBytes);
663 virtual int CopyFileRestartable(
const char *pszSource,
664 const char *pszTarget,
665 const char *pszInputPayload,
666 char **ppszOutputPayload,
668 GDALProgressFunc pProgressFunc,
669 void *pProgressData)
override;
675 virtual int GetMaximumPartCount()
684 virtual int GetMinimumPartSizeInMiB()
693 virtual int GetMaximumPartSizeInMiB()
705 virtual int GetDefaultPartSizeInMiB()
711 InitiateMultipartUpload(
const std::string &osFilename,
712 IVSIS3LikeHandleHelper *poS3HandleHelper,
713 const CPLHTTPRetryParameters &oRetryParameters,
717 UploadPart(
const std::string &osFilename,
int nPartNumber,
719 const void *pabyBuffer,
size_t nBufferSize,
720 IVSIS3LikeHandleHelper *poS3HandleHelper,
721 const CPLHTTPRetryParameters &oRetryParameters,
724 virtual bool CompleteMultipart(
725 const std::string &osFilename,
const std::string &osUploadID,
726 const std::vector<std::string> &aosEtags,
vsi_l_offset nTotalSize,
727 IVSIS3LikeHandleHelper *poS3HandleHelper,
728 const CPLHTTPRetryParameters &oRetryParameters);
730 virtual bool AbortMultipart(
const std::string &osFilename,
731 const std::string &osUploadID,
732 IVSIS3LikeHandleHelper *poS3HandleHelper,
733 const CPLHTTPRetryParameters &oRetryParameters);
735 bool AbortPendingUploads(
const char *pszFilename)
override;
737 bool MultipartUploadGetCapabilities(
int *pbNonSequentialUploadSupported,
738 int *pbParallelUploadSupported,
739 int *pbAbortSupported,
740 size_t *pnMinPartSize,
741 size_t *pnMaxPartSize,
742 int *pnMaxPartCount)
override;
744 char *MultipartUploadStart(
const char *pszFilename,
747 char *MultipartUploadAddPart(
const char *pszFilename,
748 const char *pszUploadId,
int nPartNumber,
753 bool MultipartUploadEnd(
const char *pszFilename,
const char *pszUploadId,
754 size_t nPartIdsCount,
755 const char *
const *apszPartIds,
759 bool MultipartUploadAbort(
const char *pszFilename,
const char *pszUploadId,
767class IVSIS3LikeHandle :
public VSICurlHandle
772 bool UseLimitRangeGetInsteadOfHead()
override
777 bool IsDirectoryFromExists(
const char *pszVerb,
int response_code)
override
780 return response_code == 416 &&
EQUAL(pszVerb,
"GET") &&
781 std::string(m_pszURL).back() ==
'/';
784 void ProcessGetFileSizeResult(
const char *pszContent)
override
786 oFileProp.bIsDirectory =
787 strstr(pszContent,
"ListBucketResult") !=
nullptr;
791 IVSIS3LikeHandle(VSICurlFilesystemHandlerBase *poFSIn,
792 const char *pszFilename,
const char *pszURLIn)
793 : VSICurlHandle(poFSIn, pszFilename, pszURLIn)
797 ~IVSIS3LikeHandle()
override
810 IVSIS3LikeFSHandlerWithMultipartUpload *m_poFS =
nullptr;
811 std::string m_osFilename{};
812 IVSIS3LikeHandleHelper *m_poS3HandleHelper =
nullptr;
815 CPLHTTPRetryParameters m_oRetryParameters;
818 size_t m_nBufferOff = 0;
819 size_t m_nBufferSize = 0;
820 bool m_bClosed =
false;
821 GByte *m_pabyBuffer =
nullptr;
822 std::string m_osUploadID{};
823 int m_nPartNumber = 0;
824 std::vector<std::string> m_aosEtags{};
825 bool m_bError =
false;
827 WriteFuncStruct m_sWriteFuncHeaderData{};
830 bool DoSinglePartPUT();
832 void InvalidateParentDirectory();
835 VSIMultipartWriteHandle(IVSIS3LikeFSHandlerWithMultipartUpload *poFS,
836 const char *pszFilename,
837 IVSIS3LikeHandleHelper *poS3HandleHelper,
839 ~VSIMultipartWriteHandle()
override;
843 size_t Read(
void *pBuffer,
size_t nSize,
size_t nMemb)
override;
844 size_t Write(
const void *pBuffer,
size_t nSize,
size_t nMemb)
override;
846 void ClearErr()
override
860 int Close()
override;
864 return m_pabyBuffer !=
nullptr;
879 IVSIS3LikeFSHandler *m_poFS =
nullptr;
880 std::string m_osFilename{};
881 IVSIS3LikeHandleHelper *m_poS3HandleHelper =
nullptr;
884 CPLHTTPRetryParameters m_oRetryParameters;
887 size_t m_nBufferOff = 0;
888 bool m_bError =
false;
889 bool m_bClosed =
false;
891 CURLM *m_hCurlMulti =
nullptr;
892 CURL *m_hCurl =
nullptr;
893 const void *m_pBuffer =
nullptr;
894 std::string m_osCurlErrBuf{};
895 size_t m_nChunkedBufferOff = 0;
896 size_t m_nChunkedBufferSize = 0;
897 size_t m_nWrittenInPUT = 0;
899 WriteFuncStruct m_sWriteFuncHeaderData{};
901 static size_t ReadCallBackBufferChunked(
char *buffer,
size_t size,
902 size_t nitems,
void *instream);
903 int FinishChunkedTransfer();
907 void InvalidateParentDirectory();
910 VSIChunkedWriteHandle(IVSIS3LikeFSHandler *poFS,
const char *pszFilename,
911 IVSIS3LikeHandleHelper *poS3HandleHelper,
913 virtual ~VSIChunkedWriteHandle();
917 size_t Read(
void *pBuffer,
size_t nSize,
size_t nMemb)
override;
918 size_t Write(
const void *pBuffer,
size_t nSize,
size_t nMemb)
override;
920 void ClearErr()
override
934 int Close()
override;
946 VSICurlFilesystemHandlerBase *m_poFS =
nullptr;
947 std::string m_osFSPrefix{};
948 std::string m_osFilename{};
949 CPLHTTPRetryParameters m_oRetryParameters{};
952 int m_nBufferOff = 0;
953 int m_nBufferSize = 0;
954 int m_nBufferOffReadCallback = 0;
955 bool m_bClosed =
false;
956 GByte *m_pabyBuffer =
nullptr;
957 bool m_bError =
false;
959 static size_t ReadCallBackBuffer(
char *buffer,
size_t size,
size_t nitems,
961 virtual bool Send(
bool bIsLastBlock) = 0;
964 VSIAppendWriteHandle(VSICurlFilesystemHandlerBase *poFS,
965 const char *pszFSPrefix,
const char *pszFilename,
967 virtual ~VSIAppendWriteHandle();
971 size_t Read(
void *pBuffer,
size_t nSize,
size_t nMemb)
override;
972 size_t Write(
const void *pBuffer,
size_t nSize,
size_t nMemb)
override;
974 void ClearErr()
override
988 int Close()
override;
992 return m_pabyBuffer !=
nullptr;
1000struct VSIDIRWithMissingDirSynthesis :
public VSIDIR
1002 std::vector<std::unique_ptr<VSIDIREntry>> aoEntries{};
1005 std::vector<std::string> m_aosSubpathsStack{};
1007 void SynthetizeMissingDirectories(
const std::string &osCurSubdir,
1008 bool bAddEntryForThisSubdir);
1015struct CurlRequestHelper
1017 WriteFuncStruct sWriteFuncData{};
1018 WriteFuncStruct sWriteFuncHeaderData{};
1019 char szCurlErrBuf[CURL_ERROR_SIZE + 1] = {};
1021 CurlRequestHelper();
1022 ~CurlRequestHelper();
1023 long perform(CURL *hCurlHandle,
1024 struct curl_slist *headers,
1025 VSICurlFilesystemHandlerBase *poFS,
1026 IVSIS3LikeHandleHelper *poS3HandleHelper);
1033class NetworkStatisticsLogger
1035 static int gnEnabled;
1036 static NetworkStatisticsLogger gInstance;
1038 NetworkStatisticsLogger() =
default;
1040 std::mutex m_mutex{};
1049 GIntBig nGETDownloadedBytes = 0;
1050 GIntBig nPUTUploadedBytes = 0;
1051 GIntBig nPOSTDownloadedBytes = 0;
1052 GIntBig nPOSTUploadedBytes = 0;
1055 enum class ContextPathType
1062 struct ContextPathItem
1064 ContextPathType eType;
1067 ContextPathItem(ContextPathType eTypeIn,
const std::string &osNameIn)
1068 : eType(eTypeIn), osName(osNameIn)
1072 bool operator<(
const ContextPathItem &other)
const
1074 if (
static_cast<int>(eType) <
static_cast<int>(other.eType))
1076 if (
static_cast<int>(eType) >
static_cast<int>(other.eType))
1078 return osName < other.osName;
1084 Counters counters{};
1085 std::map<ContextPathItem, Stats> children{};
1093 std::map<GIntBig, std::vector<ContextPathItem>>
1094 m_mapThreadIdToContextPath{};
1096 static void ReadEnabled();
1098 std::vector<Counters *> GetCountersForContext();
1101 static inline bool IsEnabled()
1107 return gnEnabled == TRUE;
1110 static void EnterFileSystem(
const char *pszName);
1112 static void LeaveFileSystem();
1114 static void EnterFile(
const char *pszName);
1116 static void LeaveFile();
1118 static void EnterAction(
const char *pszName);
1120 static void LeaveAction();
1122 static void LogHEAD();
1124 static void LogGET(
size_t nDownloadedBytes);
1126 static void LogPUT(
size_t nUploadedBytes);
1128 static void LogPOST(
size_t nUploadedBytes,
size_t nDownloadedBytes);
1130 static void LogDELETE();
1132 static void Reset();
1134 static std::string GetReportAsSerializedJSON();
1137struct NetworkStatisticsFileSystem
1139 inline explicit NetworkStatisticsFileSystem(
const char *pszName)
1141 NetworkStatisticsLogger::EnterFileSystem(pszName);
1144 inline ~NetworkStatisticsFileSystem()
1146 NetworkStatisticsLogger::LeaveFileSystem();
1150struct NetworkStatisticsFile
1152 inline explicit NetworkStatisticsFile(
const char *pszName)
1154 NetworkStatisticsLogger::EnterFile(pszName);
1157 inline ~NetworkStatisticsFile()
1159 NetworkStatisticsLogger::LeaveFile();
1163struct NetworkStatisticsAction
1165 inline explicit NetworkStatisticsAction(
const char *pszName)
1167 NetworkStatisticsLogger::EnterAction(pszName);
1170 inline ~NetworkStatisticsAction()
1172 NetworkStatisticsLogger::LeaveAction();
1178int VSICURLGetDownloadChunkSize();
1180void VSICURLInitWriteFuncStruct(cpl::WriteFuncStruct *psStruct,
VSILFILE *fp,
1181 VSICurlReadCbkFunc pfnReadCbk,
1182 void *pReadCbkUserData);
1183size_t VSICurlHandleWriteFunc(
void *buffer,
size_t count,
size_t nmemb,
1185void VSICURLMultiPerform(CURLM *hCurlMultiHandle, CURL *hEasyHandle =
nullptr,
1186 std::atomic<bool> *pbInterrupt =
nullptr);
1187void VSICURLResetHeaderAndWriterFunctions(CURL *hCurlHandle);
1189int VSICurlParseUnixPermissions(
const char *pszPermissions);
1192bool VSICURLGetCachedFileProp(
const char *pszURL, cpl::FileProp &oFileProp);
1193void VSICURLSetCachedFileProp(
const char *pszURL, cpl::FileProp &oFileProp);
1194void VSICURLInvalidateCachedFileProp(
const char *pszURL);
1195void VSICURLInvalidateCachedFilePropPrefix(
const char *pszURL);
1196void VSICURLDestroyCacheFileProp();
1198void VSICURLMultiCleanup(CURLM *hCurlMultiHandle);
The CPLJSONArray class holds JSON object from CPLJSONDocument.
Definition: cpl_json.h:41
String list class designed around our use of C "char**" string lists.
Definition: cpl_string.h:436
Interface for read and write JSON documents.
Core portability definitions for CPL.
#define CPL_NON_FINAL
Mark that a class is explicitly recognized as non-final.
Definition: cpl_port.h:1023
#define EQUAL(a, b)
Alias for strcasecmp() == 0.
Definition: cpl_port.h:535
#define CPL_DISALLOW_COPY_ASSIGN(ClassName)
Helper to remove the copy and assignment constructors so that the compiler will not generate the defa...
Definition: cpl_port.h:1030
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition: cpl_port.h:1179
unsigned char GByte
Unsigned byte type.
Definition: cpl_port.h:169
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition: cpl_port.h:199
Various convenience functions for working with strings and string lists.
#define VSIStatBufL
Type for VSIStatL()
Definition: cpl_vsi.h:189
#define VSI_L_OFFSET_MAX
Maximum value for a file offset.
Definition: cpl_vsi.h:132
struct VSIDIR VSIDIR
Opaque type for a directory iterator.
Definition: cpl_vsi.h:388
GUIntBig vsi_l_offset
Type for a file offset.
Definition: cpl_vsi.h:130
Virtual file handle.
Definition: cpl_vsi_virtual.h:47