|
GDAL
|
00001 /********************************************************************** 00002 * Project: CPL - Common Portability Library 00003 * Purpose: Google Cloud Storage routines 00004 * Author: Even Rouault <even.rouault at spatialys.com> 00005 * 00006 ********************************************************************** 00007 * Copyright (c) 2017, Even Rouault <even.rouault at spatialys.com> 00008 * 00009 * Permission is hereby granted, free of charge, to any person obtaining a 00010 * copy of this software and associated documentation files (the "Software"), 00011 * to deal in the Software without restriction, including without limitation 00012 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 00013 * and/or sell copies of the Software, and to permit persons to whom the 00014 * Software is furnished to do so, subject to the following conditions: 00015 * 00016 * The above copyright notice and this permission notice shall be included 00017 * in all copies or substantial portions of the Software. 00018 * 00019 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00020 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00021 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 00022 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00023 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 00024 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 00025 * DEALINGS IN THE SOFTWARE. 00026 ****************************************************************************/ 00027 00028 #ifndef CPL_GOOGLE_CLOUD_INCLUDED_H 00029 #define CPL_GOOGLE_CLOUD_INCLUDED_H 00030 00031 #ifndef DOXYGEN_SKIP 00032 00033 #include <cstddef> 00034 00035 #include "cpl_string.h" 00036 00037 #ifdef HAVE_CURL 00038 00039 #include <curl/curl.h> 00040 00041 class VSIGSHandleHelper 00042 { 00043 CPLString m_osURL; 00044 CPLString m_osEndpoint; 00045 CPLString m_osBucketObjectKey; 00046 CPLString m_osSecretAccessKey; 00047 CPLString m_osAccessKeyId; 00048 bool m_bUseHeaderFile; 00049 00050 public: 00051 VSIGSHandleHelper(const CPLString& osEndpoint, 00052 const CPLString& osBucketObjectKey, 00053 const CPLString& osSecretAccessKey, 00054 const CPLString& osAccessKeyId, 00055 bool bUseHeaderFile); 00056 ~VSIGSHandleHelper(); 00057 00058 static VSIGSHandleHelper* BuildFromURI(const char* pszURI, 00059 const char* pszFSPrefix); 00060 00061 struct curl_slist* GetCurlHeaders(const CPLString& osVerb) const; 00062 00063 const CPLString& GetURL() const { return m_osURL; } 00064 }; 00065 00066 #endif /* HAVE_CURL */ 00067 00068 #endif /* #ifndef DOXYGEN_SKIP */ 00069 00070 #endif /* CPL_GOOGLE_CLOUD_INCLUDED_H */
1.7.6.1.