unreserved_chars.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot 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_UNRESERVED_CHARS_HPP
  10. #define BOOST_URL_RFC_UNRESERVED_CHARS_HPP
  11. #include <boost/url/detail/config.hpp>
  12. #include <boost/url/grammar/lut_chars.hpp>
  13. namespace boost {
  14. namespace urls {
  15. /** The unreserved character set
  16. @par Example
  17. Character sets are used with rules and
  18. the functions @ref grammar::find_if and
  19. @ref grammar::find_if_not.
  20. @code
  21. system::result< decode_view > rv = grammar::parse( "Program%20Files", pct_encoded_rule( unreserved_chars ) );
  22. @endcode
  23. @par BNF
  24. @code
  25. unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
  26. @endcode
  27. @par Specification
  28. @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-2.3"
  29. >2.3. Unreserved Characters (rfc3986)</a>
  30. @see
  31. @ref grammar::find_if,
  32. @ref grammar::find_if_not,
  33. @ref grammar::parse,
  34. @ref pct_encoded_rule.
  35. */
  36. constexpr
  37. grammar::lut_chars
  38. unreserved_chars =
  39. "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  40. "abcdefghijklmnopqrstuvwxyz"
  41. "0123456789"
  42. "-._~";
  43. } // urls
  44. } // boost
  45. #endif