| 609 | } |
| 610 | |
| 611 | bool XMLUtil::ToInt(const char* str, int* value) |
| 612 | { |
| 613 | if (IsPrefixHex(str)) { |
| 614 | unsigned v; |
| 615 | if (TIXML_SSCANF(str, "%x", &v) == 1) { |
| 616 | *value = static_cast<int>(v); |
| 617 | return true; |
| 618 | } |
| 619 | } |
| 620 | else { |
| 621 | if (TIXML_SSCANF(str, "%d", value) == 1) { |
| 622 | return true; |
| 623 | } |
| 624 | } |
| 625 | return false; |
| 626 | } |
| 627 | |
| 628 | bool XMLUtil::ToUnsigned(const char* str, unsigned* value) |
| 629 | { |
nothing calls this directly
no test coverage detected