Orcus
orcus_xlsx.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 ORCUS_ORCUS_XLSX_HPP
9 #define ORCUS_ORCUS_XLSX_HPP
10 
11 #include "interface.hpp"
12 
13 namespace orcus {
14 
15 namespace spreadsheet { namespace iface { class import_factory; }}
16 
17 struct xlsx_rel_sheet_info;
18 struct xlsx_rel_table_info;
19 struct orcus_xlsx_impl;
20 class xlsx_opc_handler;
21 
22 class ORCUS_DLLPUBLIC orcus_xlsx : public iface::import_filter
23 {
24  friend class xlsx_opc_handler;
25 
26  orcus_xlsx(const orcus_xlsx&); // disabled
27  orcus_xlsx& operator= (const orcus_xlsx&); // disabled
28 
29 public:
30  orcus_xlsx(spreadsheet::iface::import_factory* factory);
31  ~orcus_xlsx();
32 
33  static bool detect(const unsigned char* blob, size_t size);
34 
35  virtual void read_file(const std::string& filepath);
36  virtual void read_stream(const char* content, size_t len);
37 
38  virtual const char* get_name() const;
39 
40 private:
41 
42  void set_formulas_to_doc();
43 
44  void read_workbook(const std::string& dir_path, const std::string& file_name);
45 
49  void read_sheet(const std::string& dir_path, const std::string& file_name, xlsx_rel_sheet_info* data);
50 
55  void read_shared_strings(const std::string& dir_path, const std::string& file_name);
56 
57  void read_styles(const std::string& dir_path, const std::string& file_name);
58 
59  void read_table(const std::string& dir_path, const std::string& file_name, xlsx_rel_table_info* data);
60 
61  void read_pivot_cache_def(const std::string& dir_path, const std::string& file_name);
62 
63  void read_pivot_cache_rec(const std::string& dir_path, const std::string& file_name);
64 
65  void read_pivot_table(const std::string& dir_path, const std::string& file_name);
66 
67  void read_rev_headers(const std::string& dir_path, const std::string& file_name);
68 
69  void read_rev_log(const std::string& dir_path, const std::string& file_name);
70 
71 private:
72  orcus_xlsx_impl* mp_impl;
73 };
74 
75 }
76 
77 #endif
78 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: import_interface.hpp:685
Definition: orcus_xlsx.hpp:22
Definition: base64.hpp:15
Definition: interface.hpp:21