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 
22 namespace spreadsheet { namespace iface {
23  class import_factory;
24  class export_factory;
25 }}
26 
27 class ORCUS_DLLPUBLIC orcus_xml
28 {
29  struct impl;
30  std::unique_ptr<impl> mp_impl;
31 
32  void read_impl(const pstring& strm);
33 
34 public:
35  orcus_xml(const orcus_xml&) = delete;
36  orcus_xml& operator= (const orcus_xml&) = delete;
37 
39  ~orcus_xml();
40 
52  void set_namespace_alias(const pstring& alias, const pstring& uri, bool default_ns=false);
53 
63  void set_cell_link(const pstring& xpath, const pstring& sheet, spreadsheet::row_t row, spreadsheet::col_t col);
64 
73  void start_range(const pstring& sheet, spreadsheet::row_t row, spreadsheet::col_t col);
74 
83  void append_field_link(const pstring& xpath, const pstring& label);
84 
94  void set_range_row_group(const pstring& xpath);
95 
99  void commit_range();
100 
106  void append_sheet(const pstring& name);
107 
114  void read_stream(const char* p, size_t n);
115 
124  void read_map_definition(const char* p, size_t n);
125 
133  void detect_map_definition(const char* p, size_t n);
134 
144  void write_map_definition(const char* p, size_t n, std::ostream& out) const;
145 
158  void write(const char* p_in, size_t n_in, std::ostream& out) const;
159 };
160 
161 }
162 
163 #endif
164 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: orcus_xml.hpp:28
void set_cell_link(const pstring &xpath, const pstring &sheet, spreadsheet::row_t row, spreadsheet::col_t col)
void append_sheet(const pstring &name)
void detect_map_definition(const char *p, size_t n)
void append_field_link(const pstring &xpath, const pstring &label)
void read_map_definition(const char *p, size_t n)
void read_stream(const char *p, size_t n)
void write(const char *p_in, size_t n_in, std::ostream &out) const
void write_map_definition(const char *p, size_t n, std::ostream &out) const
void set_namespace_alias(const pstring &alias, const pstring &uri, bool default_ns=false)
void set_range_row_group(const pstring &xpath)
void start_range(const pstring &sheet, spreadsheet::row_t row, spreadsheet::col_t col)
Definition: pstring.hpp:28
Definition: export_interface.hpp:27
Definition: import_interface.hpp:917
Definition: xml_namespace.hpp:28