File indexing completed on 2025-09-17 08:40:35
0001
0002
0003
0004
0005
0006 #ifndef BOOST_PARSER_TRANSCODE_VIEW_HPP
0007 #define BOOST_PARSER_TRANSCODE_VIEW_HPP
0008
0009 #include <boost/parser/detail/text/transcode_view.hpp>
0010
0011
0012 namespace boost::parser {
0013
0014 using format = detail::text::format;
0015
0016
0017
0018
0019
0020
0021 #if BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS || defined(BOOST_PARSER_DOXYGEN)
0022 template<detail::text::utf_range V>
0023 requires std::ranges::view<V>
0024 #else
0025 template<typename V>
0026 #endif
0027 class utf8_view : public detail::text::utf_view<format::utf8, V>
0028 {
0029 public:
0030 constexpr utf8_view()
0031 #if BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS || defined(BOOST_PARSER_DOXYGEN)
0032 requires std::default_initializable<V>
0033 #endif
0034 = default;
0035 constexpr utf8_view(V base) :
0036 detail::text::utf_view<format::utf8, V>{std::move(base)}
0037 {}
0038 };
0039
0040
0041
0042
0043
0044
0045 #if BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS || defined(BOOST_PARSER_DOXYGEN)
0046 template<detail::text::utf_range V>
0047 requires std::ranges::view<V>
0048 #else
0049 template<typename V>
0050 #endif
0051 class utf16_view : public detail::text::utf_view<format::utf16, V>
0052 {
0053 public:
0054 constexpr utf16_view()
0055 #if BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS || defined(BOOST_PARSER_DOXYGEN)
0056 requires std::default_initializable<V>
0057 #endif
0058 = default;
0059 constexpr utf16_view(V base) :
0060 detail::text::utf_view<format::utf16, V>{std::move(base)}
0061 {}
0062 };
0063
0064
0065
0066
0067
0068
0069 #if BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS || defined(BOOST_PARSER_DOXYGEN)
0070 template<detail::text::utf_range V>
0071 requires std::ranges::view<V>
0072 #else
0073 template<typename V>
0074 #endif
0075 class utf32_view : public detail::text::utf_view<format::utf32, V>
0076 {
0077 public:
0078 constexpr utf32_view()
0079 #if BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS || defined(BOOST_PARSER_DOXYGEN)
0080 requires std::default_initializable<V>
0081 #endif
0082 = default;
0083 constexpr utf32_view(V base) :
0084 detail::text::utf_view<format::utf32, V>{std::move(base)}
0085 {}
0086 };
0087
0088 #if BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS
0089 template<class R>
0090 utf8_view(R &&) -> utf8_view<std::views::all_t<R>>;
0091 template<class R>
0092 utf16_view(R &&) -> utf16_view<std::views::all_t<R>>;
0093 template<class R>
0094 utf32_view(R &&) -> utf32_view<std::views::all_t<R>>;
0095 #endif
0096
0097
0098 inline constexpr auto as_utf8 = detail::text::as_utf8;
0099
0100 inline constexpr auto as_utf16 = detail::text::as_utf16;
0101
0102 inline constexpr auto as_utf32 = detail::text::as_utf32;
0103
0104 }
0105
0106 #endif