HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
skeleton.hpp
1// Copyright Take Vos 2020.
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
7#include "skeleton_node.hpp"
8#include "skeleton_parse_context.hpp"
10
11namespace hi::inline v1 {
12
13[[nodiscard]] std::unique_ptr<skeleton_node> parse_skeleton(skeleton_parse_context &context);
14
15[[nodiscard]] inline std::unique_ptr<skeleton_node>
16parse_skeleton(std::filesystem::path path, std::string_view::const_iterator first, std::string_view::const_iterator last)
17{
18 auto context = skeleton_parse_context(std::move(path), first, last);
19 auto e = parse_skeleton(context);
20 return e;
21}
22
23[[nodiscard]] inline std::unique_ptr<skeleton_node> parse_skeleton(std::filesystem::path path, std::string_view text)
24{
25 return parse_skeleton(std::move(path), text.cbegin(), text.cend());
26}
27
28[[nodiscard]] inline std::unique_ptr<skeleton_node> parse_skeleton(std::filesystem::path path)
29{
30 hilet fv = file_view(path);
31 hilet sv = as_string_view(fv);
32
33 return parse_skeleton(std::move(path), sv.cbegin(), sv.cend());
34}
35
36} // namespace hi::inline v1
Defines the file_view class.
#define hilet
Invariant should be the default for variables.
Definition utility.hpp:23
DOXYGEN BUG.
Definition algorithm.hpp:13
T move(T... args)