12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #ifndef BOOST_LOCALE_UTIL_STRING_HPP
- #define BOOST_LOCALE_UTIL_STRING_HPP
- #include <boost/locale/config.hpp>
- #include <limits>
- namespace boost { namespace locale { namespace util {
-
- template<typename Char>
- Char* str_end(Char* str)
- {
- while(*str)
- ++str;
- return str;
- }
- inline constexpr bool is_upper_ascii(const char c)
- {
- return 'A' <= c && c <= 'Z';
- }
- inline constexpr bool is_lower_ascii(const char c)
- {
- return 'a' <= c && c <= 'z';
- }
- inline constexpr bool is_numeric_ascii(const char c)
- {
- return '0' <= c && c <= '9';
- }
-
- constexpr char to_char(unsigned char c)
- {
- return static_cast<char>((c - (std::numeric_limits<char>::min)()) + (std::numeric_limits<char>::min)());
- }
- }}}
- #endif
|