OGR
cpl_google_cloud.h
1 /**********************************************************************
2  * Project: CPL - Common Portability Library
3  * Purpose: Google Cloud Storage routines
4  * Author: Even Rouault <even.rouault at spatialys.com>
5  *
6  **********************************************************************
7  * Copyright (c) 2017, Even Rouault <even.rouault at spatialys.com>
8  *
9  * Permission is hereby granted, free of charge, to any person obtaining a
10  * copy of this software and associated documentation files (the "Software"),
11  * to deal in the Software without restriction, including without limitation
12  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13  * and/or sell copies of the Software, and to permit persons to whom the
14  * Software is furnished to do so, subject to the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be included
17  * in all copies or substantial portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25  * DEALINGS IN THE SOFTWARE.
26  ****************************************************************************/
27 
28 #ifndef CPL_GOOGLE_CLOUD_INCLUDED_H
29 #define CPL_GOOGLE_CLOUD_INCLUDED_H
30 
31 #ifndef DOXYGEN_SKIP
32 
33 #include <cstddef>
34 
35 #include "cpl_string.h"
36 
37 #ifdef HAVE_CURL
38 
39 #include <curl/curl.h>
40 
41 class VSIGSHandleHelper
42 {
43  CPLString m_osURL;
44  CPLString m_osEndpoint;
45  CPLString m_osBucketObjectKey;
46  CPLString m_osSecretAccessKey;
47  CPLString m_osAccessKeyId;
48  bool m_bUseHeaderFile;
49 
50  public:
51  VSIGSHandleHelper(const CPLString& osEndpoint,
52  const CPLString& osBucketObjectKey,
53  const CPLString& osSecretAccessKey,
54  const CPLString& osAccessKeyId,
55  bool bUseHeaderFile);
56  ~VSIGSHandleHelper();
57 
58  static VSIGSHandleHelper* BuildFromURI(const char* pszURI,
59  const char* pszFSPrefix);
60 
61  struct curl_slist* GetCurlHeaders(const CPLString& osVerb) const;
62 
63  const CPLString& GetURL() const { return m_osURL; }
64 };
65 
66 #endif /* HAVE_CURL */
67 
68 #endif /* #ifndef DOXYGEN_SKIP */
69 
70 #endif /* CPL_GOOGLE_CLOUD_INCLUDED_H */
CPLPopFinderLocation
void CPLPopFinderLocation(void)
Definition: cpl_findfile.cpp:285
CPLRecodeFromWChar
char * CPLRecodeFromWChar(const wchar_t *pwszSource, const char *pszSrcEncoding, const char *pszDstEncoding)
Definition: cpl_recode.cpp:149
GByte
unsigned char GByte
Definition: cpl_port.h:207
CPLGetExecPath
int CPLGetExecPath(char *pszPathBuf, int nMaxLength)
Definition: cpl_getexecpath.cpp:132
CPLFindFile
const char * CPLFindFile(const char *pszClass, const char *pszBasename)
Definition: cpl_findfile.cpp:177
CPLString::Printf
CPLString & Printf(const char *pszFormat,...)
Definition: cplstring.cpp:59
CPLCalloc
void * CPLCalloc(size_t, size_t)
Definition: cpl_conv.cpp:128
cpl_vsi.h
CPLPushFinderLocation
void CPLPushFinderLocation(const char *)
Definition: cpl_findfile.cpp:246
CPLString
Convenient string class based on std::string.
Definition: cpl_string.h:338
CPLRealloc
void * CPLRealloc(void *, size_t)
Definition: cpl_conv.cpp:215
CPLFinderClean
void CPLFinderClean(void)
Definition: cpl_findfile.cpp:134
CPLDefaultFindFile
const char * CPLDefaultFindFile(const char *pszClass, const char *pszBasename)
Definition: cpl_findfile.cpp:149
FindFileTLS
Definition: cpl_findfile.cpp:41
CPLTestBool
bool CPLTestBool(const char *pszValue)
Definition: cpl_string.cpp:1522
CPLFileFinder
const typedef char *(* CPLFileFinder)(const char *, const char *)
Definition: cpl_conv.h:183
CSLCount
int CSLCount(const char *const *papszStrList)
Definition: cpl_string.cpp:147
CPL_ENC_UTF8
#define CPL_ENC_UTF8
Definition: cpl_string.h:292
CPLBase64Encode
char * CPLBase64Encode(int nBytes, const GByte *pabyData)
Definition: cpl_base64.cpp:199
CSLFindStringCaseSensitive
int CSLFindStringCaseSensitive(const char *const *papszList, const char *pszTarget)
Definition: cpl_string.cpp:702
CPLDebug
void CPLDebug(const char *, const char *,...)
Definition: cpl_error.cpp:492
CPLFormFilename
const char * CPLFormFilename(const char *pszPath, const char *pszBasename, const char *pszExtension)
Definition: cpl_path.cpp:501
VSIStatL
int VSIStatL(const char *, VSIStatBufL *)
Get filesystem object info.
Definition: cpl_vsil.cpp:451
cpl_conv.h
cpl_string.h
VSI_CALLOC_VERBOSE
#define VSI_CALLOC_VERBOSE(nCount, nSize)
Definition: cpl_vsi.h:269
CPLSPrintf
const char * CPLSPrintf(const char *fmt,...)
Definition: cpl_string.cpp:975
CSLAddStringMayFail
char ** CSLAddStringMayFail(char **papszStrList, const char *pszNewString)
Definition: cpl_string.cpp:92
CPL_ENC_UCS2
#define CPL_ENC_UCS2
Definition: cpl_string.h:296
CPL_UNUSED
#define CPL_UNUSED
Definition: cpl_port.h:1008
VSIStatBufL
struct stat64 VSIStatBufL
Definition: cpl_vsi.h:190
cpl_port.h
CPLPopFileFinder
CPLFileFinder CPLPopFileFinder(void)
Definition: cpl_findfile.cpp:235
CPLPushFileFinder
void CPLPushFileFinder(CPLFileFinder pfnFinder)
Definition: cpl_findfile.cpp:200
CPLFree
#define CPLFree
Definition: cpl_conv.h:81
CPLGetConfigOption
const char * CPLGetConfigOption(const char *, const char *)
Definition: cpl_conv.cpp:1625

Generated for GDAL by doxygen 1.8.17.