File: spreadsheet_doc_2.cpp

package info (click to toggle)
liborcus 0.20.1-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 16,644 kB
  • sloc: xml: 78,349; cpp: 74,365; sh: 4,626; makefile: 2,787; python: 2,614
file content (44 lines) | stat: -rw-r--r-- 1,187 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

#include <orcus/spreadsheet/import_interface.hpp>
#include <orcus/orcus_ods.hpp>

#include <filesystem>
#include <iostream>

namespace ss = orcus::spreadsheet;

class my_empty_import_factory : public ss::iface::import_factory
{
public:
    virtual ss::iface::import_sheet* append_sheet(ss::sheet_t sheet_index, std::string_view name) override
    {
        std::cout << "append_sheet: sheet index: " << sheet_index << "; sheet name: " << name << std::endl;
        return nullptr;
    }

    virtual ss::iface::import_sheet* get_sheet(std::string_view name) override
    {
        std::cout << "get_sheet: sheet name: " << name << std::endl;
        return nullptr;
    }

    virtual ss::iface::import_sheet* get_sheet(ss::sheet_t sheet_index) override
    {
        std::cout << "get_sheet: sheet index: " << sheet_index << std::endl;
        return nullptr;
    }

    virtual void finalize() override {}
};

int main()
{
    std::filesystem::path input_dir = std::getenv("INPUTDIR");
    auto filepath = input_dir / "multi-sheets.ods";

    my_empty_import_factory factory;
    orcus::orcus_ods loader(&factory);
    loader.read_file(filepath.native());

    return EXIT_SUCCESS;
}