| 723 | } |
| 724 | |
| 725 | Dynamic __hxcpp_parse_int(const String &inString) |
| 726 | { |
| 727 | if (!inString.raw_ptr()) |
| 728 | return null(); |
| 729 | hx::strbuf buf; |
| 730 | const char *str = inString.utf8_str(&buf); |
| 731 | |
| 732 | // On the first non space char check to see if we've got a hex string |
| 733 | while (isspace(*str)) ++str; |
| 734 | bool isHex = is_hex_string(str, strlen(str)); |
| 735 | char *end = 0; |
| 736 | long result; |
| 737 | if (isHex) |
| 738 | { |
| 739 | bool neg = str[0] == '-'; |
| 740 | if (neg) str++; |
| 741 | result = strtoul(str,&end,16); |
| 742 | if (neg) result = -result; |
| 743 | } |
| 744 | else |
| 745 | result = strtol(str,&end,10); |
| 746 | #ifdef HX_WINDOWS |
| 747 | if (str==end && !isHex) |
| 748 | #else |
| 749 | if (str==end) |
| 750 | #endif |
| 751 | return null(); |
| 752 | return (int)result; |
| 753 | } |
| 754 | |
| 755 | |
| 756 | double __hxcpp_parse_substr_float(const String &inString,int start, int length) |
nothing calls this directly
no test coverage detected