| 23 | namespace |
| 24 | { |
| 25 | uint32_t wcstou32(const wchar_t* str, int length) |
| 26 | { |
| 27 | uint64_t ret = 0; |
| 28 | for (int i = 0; i < length; ++i) |
| 29 | { |
| 30 | if (str[i] > L'9' || str[i] < L'0') |
| 31 | throw std::out_of_range("unexpected character in numeric string"); |
| 32 | ret *= 10; |
| 33 | ret += str[i] - L'0'; |
| 34 | if (ret > std::numeric_limits<uint32_t>::max()) |
| 35 | throw std::out_of_range("number too large"); |
| 36 | } |
| 37 | return static_cast<uint32_t>(ret); |
| 38 | } |
| 39 | |
| 40 | class SimpleSAXContentHandler : public ISAXContentHandler |
| 41 | { |
no outgoing calls
no test coverage detected