Orcus
interface.hpp
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This Source Code Form is subject to the terms of the Mozilla Public
4  * License, v. 2.0. If a copy of the MPL was not distributed with this
5  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6  */
7 
8 #ifndef INCLUDED_ORCUS_INTERFACE_HPP
9 #define INCLUDED_ORCUS_INTERFACE_HPP
10 
11 #include "orcus/env.hpp"
12 #include "orcus/types.hpp"
13 
14 #include <string>
15 #include <memory>
16 
17 namespace orcus {
18 
19 struct config;
20 
21 namespace iface {
22 
26 class ORCUS_DLLPUBLIC import_filter
27 {
28  struct impl;
29  std::unique_ptr<impl> mp_impl;
30 
31 public:
32  import_filter(format_t input);
33  virtual ~import_filter();
34 
40  virtual void read_file(std::string_view filepath) = 0;
41 
47  virtual void read_stream(std::string_view stream) = 0;
48 
54  virtual std::string_view get_name() const = 0;
55 
56  void set_config(const orcus::config& v);
57  const orcus::config& get_config() const;
58 };
59 
63 class ORCUS_DLLPUBLIC document_dumper
64 {
65 public:
66  virtual ~document_dumper();
67 
78  virtual void dump(dump_format_t format, const std::string& output) const = 0;
79 
86  virtual void dump_check(std::ostream& os) const = 0;
87 };
88 
89 }}
90 
91 #endif
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: interface.hpp:64
virtual void dump_check(std::ostream &os) const =0
virtual void dump(dump_format_t format, const std::string &output) const =0
Definition: interface.hpp:27
virtual void read_stream(std::string_view stream)=0
virtual std::string_view get_name() const =0
virtual void read_file(std::string_view filepath)=0
Definition: config.hpp:20