Orcus
orcus_xml.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_ORCUS_XML_HPP
9 #define INCLUDED_ORCUS_ORCUS_XML_HPP
10 
11 #include "env.hpp"
12 #include "spreadsheet/types.hpp"
13 
14 #include <ostream>
15 #include <memory>
16 
17 namespace orcus {
18 
19 class pstring;
20 class xmlns_repository;
21 struct orcus_xml_impl;
22 
23 namespace spreadsheet { namespace iface {
24  class import_factory;
25  class export_factory;
26 }}
27 
28 class ORCUS_DLLPUBLIC orcus_xml
29 {
30  struct impl;
31  std::unique_ptr<impl> mp_impl;
32 
33  void read_impl(const pstring& strm);
34 
35 public:
36  orcus_xml(const orcus_xml&) = delete;
37  orcus_xml& operator= (const orcus_xml&) = delete;
38 
40  ~orcus_xml();
41 
42  void set_namespace_alias(const pstring& alias, const pstring& uri);
43 
44  void set_cell_link(const pstring& xpath, const pstring& sheet, spreadsheet::row_t row, spreadsheet::col_t col);
45 
46  void start_range(const pstring& sheet, spreadsheet::row_t row, spreadsheet::col_t col);
47  void append_field_link(const pstring& xpath);
48  void set_range_row_group(const pstring& xpath);
49  void commit_range();
50 
51  void append_sheet(const pstring& name);
52 
53  void read_stream(const char* p, size_t n);
54 
63  void read_map_definition(const char* p, size_t n);
64 
65  void write(const char* p_in, size_t n_in, std::ostream& out) const;
66 };
67 
68 }
69 
70 #endif
71 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
orcus::spreadsheet::iface::import_factory
Definition: import_interface.hpp:881
orcus::spreadsheet::iface::export_factory
Definition: export_interface.hpp:26
orcus::pstring
Definition: pstring.hpp:27
orcus::xmlns_repository
Definition: xml_namespace.hpp:27
orcus::orcus_xml
Definition: orcus_xml.hpp:28