Orcus
Loading...
Searching...
No Matches
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 INCLUDED_ORCUS_ORCUS_XLSX_HPP
9#define INCLUDED_ORCUS_ORCUS_XLSX_HPP
10
11#include "interface.hpp"
12
13#include <memory>
14#include <string_view>
15
16namespace orcus {
17
18namespace spreadsheet { namespace iface { class import_factory; }}
19
20struct xlsx_rel_sheet_info;
21struct xlsx_rel_table_info;
22struct xlsx_rel_pivot_cache_info;
23struct xlsx_rel_pivot_cache_record_info;
24struct orcus_xlsx_impl;
25class xlsx_opc_handler;
26
27class ORCUS_DLLPUBLIC orcus_xlsx : public iface::import_filter
28{
29 friend class xlsx_opc_handler;
30 struct impl;
31 std::unique_ptr<impl> mp_impl;
32
33public:
34 orcus_xlsx(spreadsheet::iface::import_factory* factory);
35 ~orcus_xlsx();
36
37 orcus_xlsx() = delete;
38 orcus_xlsx(const orcus_xlsx&) = delete;
39 orcus_xlsx& operator= (const orcus_xlsx&) = delete;
40
41 static bool detect(std::string_view strm);
42
43 virtual void read_file(std::string_view filepath) override;
44 virtual void read_file(std::u16string_view filepath) override;
45 virtual void read_stream(std::string_view stream) override;
46
47 virtual std::string_view get_name() const override;
48
49private:
50
51 void set_formulas_to_doc();
52
53 void read_workbook(const std::string& dir_path, const std::string& file_name);
54
58 void read_sheet(const std::string& dir_path, const std::string& file_name, xlsx_rel_sheet_info* data);
59
64 void read_shared_strings(const std::string& dir_path, const std::string& file_name);
65
66 void read_styles(const std::string& dir_path, const std::string& file_name);
67
68 void read_table(const std::string& dir_path, const std::string& file_name, xlsx_rel_table_info* data);
69
70 void read_pivot_cache_def(
71 const std::string& dir_path, const std::string& file_name,
72 const xlsx_rel_pivot_cache_info* data);
73
74 void read_pivot_cache_rec(
75 const std::string& dir_path, const std::string& file_name,
76 const xlsx_rel_pivot_cache_record_info* data);
77
78 void read_pivot_table(const std::string& dir_path, const std::string& file_name);
79
80 void read_rev_headers(const std::string& dir_path, const std::string& file_name);
81
82 void read_rev_log(const std::string& dir_path, const std::string& file_name);
83
84 void read_drawing(const std::string& dir_path, const std::string& file_name);
85};
86
87}
88
89#endif
90/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition interface.hpp:27
virtual void read_file(std::string_view filepath) override
virtual void read_stream(std::string_view stream) override
virtual std::string_view get_name() const override
Definition import_interface.hpp:1184