| 565 | }; |
| 566 | #ifdef CXXOPTS_NO_REGEX |
| 567 | inline IntegerDesc SplitInteger(const std::string &text) |
| 568 | { |
| 569 | if (text.empty()) |
| 570 | { |
| 571 | throw_or_mimic<argument_incorrect_type>(text); |
| 572 | } |
| 573 | IntegerDesc desc; |
| 574 | const char *pdata = text.c_str(); |
| 575 | if (*pdata == '-') |
| 576 | { |
| 577 | pdata += 1; |
| 578 | desc.negative = "-"; |
| 579 | } |
| 580 | if (strncmp(pdata, "0x", 2) == 0) |
| 581 | { |
| 582 | pdata += 2; |
| 583 | desc.base = "0x"; |
| 584 | } |
| 585 | if (*pdata != '\0') |
| 586 | { |
| 587 | desc.value = std::string(pdata); |
| 588 | } |
| 589 | else |
| 590 | { |
| 591 | throw_or_mimic<argument_incorrect_type>(text); |
| 592 | } |
| 593 | return desc; |
| 594 | } |
| 595 | |
| 596 | inline bool IsTrueText(const std::string &text) |
| 597 | { |