Program Listing for File executor.hpp

Return to documentation for file (include/email/curl/executor.hpp)

// Copyright 2020-2021 Christophe Bedard
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef EMAIL__CURL__EXECUTOR_HPP_
#define EMAIL__CURL__EXECUTOR_HPP_

#include "email/curl/context.hpp"
#include "email/curl/info.hpp"
#include "email/macros.hpp"
#include "email/visibility_control.hpp"

namespace email
{


class CurlExecutor
{
public:

  EMAIL_PUBLIC
  bool
  init();


  EMAIL_PUBLIC
  bool
  is_valid() const;

protected:

  explicit CurlExecutor(
    const struct ConnectionInfo & connection_info,
    const struct ProtocolInfo & protocol_info,
    const bool curl_verbose);

  virtual ~CurlExecutor();


  virtual
  bool
  init_options() = 0;

  CurlContext context_;

private:
  EMAIL_DISABLE_COPY(CurlExecutor)

  bool is_valid_;
};

}  // namespace email

#endif  // EMAIL__CURL__EXECUTOR_HPP_