31 #ifndef CPL_ALIBABA_OSS_INCLUDED_H
32 #define CPL_ALIBABA_OSS_INCLUDED_H
42 #include <curl/curl.h>
46 class VSIOSSHandleHelper final:
public IVSIS3LikeHandleHelper
56 bool m_bUseHTTPS =
false;
57 bool m_bUseVirtualHosting =
false;
59 void RebuildURL()
override;
68 VSIOSSHandleHelper(
const CPLString& osSecretAccessKey,
73 bool bUseHTTPS,
bool bUseVirtualHosting);
74 ~VSIOSSHandleHelper();
76 static VSIOSSHandleHelper* BuildFromURI(
const char* pszURI,
77 const char* pszFSPrefix,
83 bool bUseHTTPS,
bool bUseVirtualHosting);
85 struct curl_slist* GetCurlHeaders(
87 const struct curl_slist* psExistingHeaders,
88 const void *pabyDataContent =
nullptr,
89 size_t nBytesContent = 0 )
const override;
91 bool CanRestartOnError(
const char*,
const char* pszHeaders,
93 bool* pbUpdateMap =
nullptr)
override;
95 const CPLString& GetURL()
const override {
return m_osURL; }
96 const CPLString& GetBucket()
const {
return m_osBucket; }
97 const CPLString& GetObjectKey()
const {
return m_osObjectKey; }
98 const CPLString& GetEndpoint()
const {
return m_osEndpoint; }
99 bool GetVirtualHosting()
const {
return m_bUseVirtualHosting; }
101 CPLString GetCopySourceHeader()
const override {
return "x-oss-copy-source"; }
103 void SetEndpoint(
const CPLString &osStr);
104 void SetVirtualHosting(
bool b);
109 class VSIOSSUpdateParams
114 VSIOSSUpdateParams() =
default;
116 explicit VSIOSSUpdateParams(
const VSIOSSHandleHelper* poHelper) :
117 m_osEndpoint(poHelper->GetEndpoint()) {}
119 void UpdateHandlerHelper(VSIOSSHandleHelper* poHelper) {
120 poHelper->SetEndpoint(m_osEndpoint);
Convenient string class based on std::string.
Definition: cpl_string.h:333
#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:955
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition: cpl_port.h:1169
Various convenience functions for working with strings and string lists.