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"
9#include "../resource_view.hpp"
10#include "../file_view.hpp"
11
12namespace hi::inline v1 {
13
14[[nodiscard]] std::unique_ptr<skeleton_node> parse_skeleton(skeleton_parse_context &context);
15
16[[nodiscard]] inline std::unique_ptr<skeleton_node>
17parse_skeleton(std::filesystem::path path, std::string_view::const_iterator first, std::string_view::const_iterator last)
18{
19 auto context = skeleton_parse_context(std::move(path), first, last);
20 auto e = parse_skeleton(context);
21 return e;
22}
23
24[[nodiscard]] inline std::unique_ptr<skeleton_node> parse_skeleton(std::filesystem::path path, std::string_view text)
25{
26 return parse_skeleton(std::move(path), text.cbegin(), text.cend());
27}
28
29[[nodiscard]] inline std::unique_ptr<skeleton_node> parse_skeleton(std::filesystem::path path)
30{
31 hilet fv = file_view(path);
32 hilet sv = as_string_view(fv);
33
34 return parse_skeleton(std::move(path), sv.cbegin(), sv.cend());
35}
36
37} // namespace hi::inline v1
#define hilet
Invariant should be the default for variables.
Definition utility.hpp:23
DOXYGEN BUG.
Definition algorithm.hpp:15
std::string_view as_string_view(resource_view const &rhs) noexcept
Get a span to the memory mapping.
Definition resource_view.hpp:48
T move(T... args)