charsets.hpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. //
  2. // Copyright (c) 2022 alandefreitas (alandefreitas@gmail.com)
  3. //
  4. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // Official repository: https://github.com/boostorg/url
  8. //
  9. #ifndef BOOST_URL_RFC_DETAIL_CHARSETS_HPP
  10. #define BOOST_URL_RFC_DETAIL_CHARSETS_HPP
  11. #include <boost/url/rfc/pchars.hpp>
  12. #include <boost/url/rfc/sub_delim_chars.hpp>
  13. #include <boost/url/rfc/unreserved_chars.hpp>
  14. namespace boost {
  15. namespace urls {
  16. namespace detail {
  17. constexpr
  18. auto
  19. user_chars =
  20. unreserved_chars + sub_delim_chars;
  21. constexpr
  22. auto
  23. password_chars =
  24. unreserved_chars + sub_delim_chars + ':';
  25. constexpr
  26. auto
  27. userinfo_chars =
  28. password_chars;
  29. constexpr
  30. auto
  31. host_chars =
  32. unreserved_chars + sub_delim_chars;
  33. constexpr
  34. auto
  35. reg_name_chars =
  36. unreserved_chars + '-' + '.';
  37. constexpr
  38. auto
  39. segment_chars =
  40. pchars;
  41. constexpr
  42. auto
  43. path_chars =
  44. segment_chars + '/';
  45. constexpr
  46. auto
  47. query_chars =
  48. pchars + '/' + '?';
  49. constexpr
  50. auto
  51. param_key_chars = pchars
  52. + '/' + '?' + '[' + ']'
  53. - '&' - '=';
  54. constexpr
  55. auto
  56. param_value_chars = pchars
  57. + '/' + '?'
  58. - '&';
  59. constexpr
  60. auto
  61. fragment_chars =
  62. pchars + '/' + '?' + '#';
  63. constexpr
  64. auto
  65. nocolon_pchars =
  66. pchars - ':';
  67. } // detail
  68. } // urls
  69. } // boost
  70. #endif