OTB  9.0.0
Orfeo Toolbox
otbCurlHelperInterface.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef otbCurlHelperInterface_h
22 #define otbCurlHelperInterface_h
23 
24 #include <iosfwd>
25 #include "itkObject.h"
26 #include "itkObjectFactory.h"
27 #include "OTBCurlAdaptersExport.h"
28 
29 namespace otb
30 {
41 class OTBCurlAdapters_EXPORT CurlHelperInterface : public itk::Object
42 {
43 public:
44 
47  typedef itk::SmartPointer<Self> Pointer;
48  typedef itk::SmartPointer<const Self> ConstPointer;
49  typedef itk::Object Superclass;
50 
51  itkTypeMacro(CurlHelperInterface, itk::Object);
52 
53  virtual bool TestUrlAvailability(const std::string& url) const = 0;
54 
55  virtual int RetrieveFile(const std::ostringstream& urlStream, std::string filename) const = 0;
56 
57  virtual int RetrieveFile(const std::string& urlString, std::string filename) const = 0;
58 
59  virtual int RetrieveUrlInMemory(const std::string& urlString, std::string& output) const = 0;
60 
61  virtual int RetrieveFileMulti(const std::vector<std::string>& listURLs, const std::vector<std::string>& listFiles, int maxConnect) const = 0;
62 
63  static bool IsCurlAvailable();
64  static bool IsCurlMultiAvailable();
65 
66 protected:
68  {
69  }
71  {
72  }
73 
74 private:
75  CurlHelperInterface(const Self&) = delete;
76  void operator=(const Self&) = delete;
77 };
78 }
79 #endif
otb::CurlHelperInterface::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbCurlHelperInterface.h:47
otb::CurlHelperInterface::~CurlHelperInterface
~CurlHelperInterface() override
Definition: otbCurlHelperInterface.h:70
otb::CurlHelperInterface::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbCurlHelperInterface.h:48
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::CurlHelperInterface::Self
CurlHelperInterface Self
Definition: otbCurlHelperInterface.h:46
otb::CurlHelperInterface
Class to use the curl capabilities from OTB.
Definition: otbCurlHelperInterface.h:41
otb::CurlHelperInterface::Superclass
itk::Object Superclass
Definition: otbCurlHelperInterface.h:49
otb::CurlHelperInterface::CurlHelperInterface
CurlHelperInterface()
Definition: otbCurlHelperInterface.h:67