Iros
 
Loading...
Searching...
No Matches
string.h
Go to the documentation of this file.
1#pragma once
2
9
10namespace di::parser {
11namespace detail {
12 template<concepts::Encoding Enc, concepts::ParserContext Context>
13 requires(concepts::SameAs<Enc, meta::Encoding<Context>>)
14 constexpr auto tag_invoke(types::Tag<create_parser_in_place>, InPlaceType<container::string::StringViewImpl<Enc>>,
15 Context&) {
16 return match_zero_or_more([](auto) {
17 return true;
18 }) <<
19 [](Context& context,
21 auto encoding = context.encoding();
22 auto begin = encoding::unicode_code_point_unwrap(encoding, results.begin());
23 auto end = encoding::unicode_code_point_unwrap(encoding, results.end());
24 return container::string::StringViewImpl<Enc> { begin, end, encoding };
25 };
26 }
27
28 template<concepts::Encoding Enc, concepts::ParserContext Context>
29 requires(concepts::SameAs<Enc, meta::Encoding<Context>>)
31 return match_zero_or_more([](auto) {
32 return true;
33 }) <<
34 [](Context& context,
36 auto encoding = context.encoding();
37 auto begin = encoding::unicode_code_point_unwrap(encoding, results.begin());
38 auto end = encoding::unicode_code_point_unwrap(encoding, results.end());
39 auto view = container::string::StringViewImpl<Enc> { begin, end, encoding };
40 return container::PathViewImpl<Enc> { view };
41 };
42 }
43}
44}
Definition path_view_impl.h:22
vocab::Expected< T, meta::ParserContextError< Context > > ParserContextResult
Definition parser_context_result.h:8
Definition zstring_parser.h:9
constexpr auto match_zero_or_more
Definition match_zero_or_more.h:48
di::meta::Decay< decltype(T)> Tag
Definition tag_invoke.h:28
constexpr tag_invoke_detail::TagInvokeFn tag_invoke
Definition tag_invoke.h:22
constexpr auto end
Definition end.h:47
constexpr auto begin
Definition begin.h:44
Definition in_place_type.h:5