| 1983 | namespace detail { |
| 1984 | |
| 1985 | inline bool is_hex(char c, int &v) { |
| 1986 | if (0x20 <= c && isdigit(c)) { |
| 1987 | v = c - '0'; |
| 1988 | return true; |
| 1989 | } else if ('A' <= c && c <= 'F') { |
| 1990 | v = c - 'A' + 10; |
| 1991 | return true; |
| 1992 | } else if ('a' <= c && c <= 'f') { |
| 1993 | v = c - 'a' + 10; |
| 1994 | return true; |
| 1995 | } |
| 1996 | return false; |
| 1997 | } |
| 1998 | |
| 1999 | inline bool from_hex_to_i(const std::string &s, size_t i, size_t cnt, |
| 2000 | int &val) { |