Orcus
orcus_ods.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_ODS_HPP
9 #define ORCUS_ORCUS_ODS_HPP
10 
11 #include "orcus/spreadsheet/import_interface.hpp"
12 #include "orcus/env.hpp"
13 #include "interface.hpp"
14 
15 namespace orcus {
16 
17 namespace spreadsheet { namespace iface { class import_factory; }}
18 
19 struct orcus_ods_impl;
20 class zip_archive;
21 class zip_archive_stream;
22 
23 class ORCUS_DLLPUBLIC orcus_ods : public iface::import_filter
24 {
25  orcus_ods(const orcus_ods&); // disabled
26  orcus_ods& operator= (const orcus_ods&); // disabled
27 
28 public:
29  orcus_ods(spreadsheet::iface::import_factory* factory);
30  ~orcus_ods();
31 
32  static bool detect(const unsigned char* blob, size_t size);
33 
34  virtual void read_file(const std::string& filepath);
35 
36  virtual void read_stream(const char* content, size_t len);
37 
38  virtual const char* get_name() const;
39 
40 private:
41  static void list_content(const zip_archive& archive);
42  void read_content(const zip_archive& archive);
43  void read_content_xml(const unsigned char* p, size_t size);
44 
45  void read_file_impl(zip_archive_stream* stream);
46 
47 private:
48  orcus_ods_impl* mp_impl;
49 };
50 
51 }
52 
53 #endif
54 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: zip_archive_stream.hpp:17
Definition: orcus_ods.hpp:23
Definition: import_interface.hpp:685
Definition: zip_archive.hpp:34
Definition: base64.hpp:15
Definition: interface.hpp:21