HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
JSON.hpp
1// Copyright Take Vos 2019.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5#pragma once
6
8#include "../tokenizer.hpp"
9#include "../utility.hpp"
10#include "../datum.hpp"
11#include "../strings.hpp"
12#include "../exception.hpp"
13#include "../indent.hpp"
14#include <string>
15#include <string_view>
16#include <vector>
17#include <optional>
18
19namespace hi::inline v1 {
20
25[[nodiscard]] datum parse_JSON(std::string_view text);
26
27[[nodiscard]] inline datum parse_JSON(std::string const& text)
28{
29 return parse_JSON(std::string_view{text});
30}
31
32[[nodiscard]] inline datum parse_JSON(char const *text)
33{
34 return parse_JSON(std::string_view{text});
35}
36
41[[nodiscard]] inline datum parse_JSON(std::filesystem::path const& path)
42{
43 return parse_JSON(as_string_view(file_view(path)));
44}
45
50[[nodiscard]] std::string format_JSON(datum const& root);
51
52} // namespace hi::inline v1
Defines the file_view class.
Utilities used by the HikoGUI library itself.
DOXYGEN BUG.
Definition algorithm.hpp:15
std::string format_JSON(datum const &root)
Dump an datum object into a JSON string.
datum parse_JSON(std::string_view text)
Parse a JSON string.
A dynamic data type.
Definition datum.hpp:224
A variant of text.
Definition label.hpp:36