Orcus
Loading...
Searching...
No Matches
orcus_json.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_JSON_HPP
9#define INCLUDED_ORCUS_ORCUS_JSON_HPP
10
11#include "env.hpp"
12#include "./spreadsheet/types.hpp"
13
14#include <memory>
15#include <string_view>
16
17namespace orcus {
18
19namespace spreadsheet { namespace iface {
20
21class import_factory;
22
23}}
24
25class ORCUS_DLLPUBLIC orcus_json
26{
27 struct impl;
28 std::unique_ptr<impl> mp_impl;
29
30public:
31 orcus_json() = delete;
32 orcus_json(const orcus_json&) = delete;
33 orcus_json& operator= (const orcus_json&) = delete;
34
35 orcus_json(spreadsheet::iface::import_factory* im_fact);
36 ~orcus_json();
37
38 static bool detect(std::string_view strm);
39
49 static bool has_range(std::string_view stream);
50
51 void set_cell_link(std::string_view path, std::string_view sheet, spreadsheet::row_t row, spreadsheet::col_t col);
52
53 void start_range(
54 std::string_view sheet, spreadsheet::row_t row, spreadsheet::col_t col, bool row_header);
55
56 void append_field_link(std::string_view path, std::string_view label);
57 void set_range_row_group(std::string_view path);
58 void commit_range();
59
60 void append_sheet(std::string_view name);
61
62 void read_stream(std::string_view stream);
63
71 void read_map_definition(std::string_view stream);
72
79 void detect_map_definition(std::string_view stream);
80};
81
82}
83
84#endif
85
86/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void read_map_definition(std::string_view stream)
static bool has_range(std::string_view stream)
void detect_map_definition(std::string_view stream)
Definition import_interface.hpp:1184