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/module.hpp"
10#include "../datum.hpp"
11#include "../strings.hpp"
12#include "../indent.hpp"
13#include <string>
14#include <string_view>
15#include <vector>
16#include <optional>
17
18namespace hi::inline v1 {
19
24[[nodiscard]] datum parse_JSON(std::string_view text);
25
26[[nodiscard]] inline datum parse_JSON(std::string const& text)
27{
28 return parse_JSON(std::string_view{text});
29}
30
31[[nodiscard]] inline datum parse_JSON(char const *text)
32{
33 return parse_JSON(std::string_view{text});
34}
35
40[[nodiscard]] inline datum parse_JSON(std::filesystem::path const& path)
41{
42 return parse_JSON(as_string_view(file_view(path)));
43}
44
49[[nodiscard]] std::string format_JSON(datum const& root);
50
51} // namespace hi::inline v1
Defines the file_view class.
DOXYGEN BUG.
Definition algorithm.hpp:13
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:223