MCPcopy Create free account
hub / github.com/dhbloo/rapfi / parse_hex

Function parse_hex

Rapfi/external/cpptoml/include/cpptoml.h:2630–2646  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2628 }
2629
2630 uint32_t parse_hex(std::string::iterator& it,
2631 const std::string::iterator& end, uint32_t place)
2632 {
2633 uint32_t value = 0;
2634 while (place > 0)
2635 {
2636 if (it == end)
2637 throw_parse_exception("Unexpected end of unicode sequence");
2638
2639 if (!is_hex(*it))
2640 throw_parse_exception("Invalid unicode escape sequence");
2641
2642 value += place * hex_to_digit(*it++);
2643 place /= 16;
2644 }
2645 return value;
2646 }
2647
2648 uint32_t hex_to_digit(char c)
2649 {

Callers 1

parse_unicodeFunction · 0.85

Calls 3

throw_parse_exceptionFunction · 0.85
is_hexFunction · 0.85
hex_to_digitFunction · 0.85

Tested by

no test coverage detected