| 18 | namespace |
| 19 | { |
| 20 | static bool ParsePrechecks(const std::string& str) |
| 21 | { |
| 22 | if (str.empty()) // No empty string allowed |
| 23 | return false; |
| 24 | if (str.size() >= 1 && (json_isspace(str[0]) || json_isspace(str[str.size()-1]))) // No padding allowed |
| 25 | return false; |
| 26 | if (str.size() != strlen(str.c_str())) // No embedded NUL characters allowed |
| 27 | return false; |
| 28 | return true; |
| 29 | } |
| 30 | |
| 31 | bool ParseInt32(const std::string& str, int32_t *out) |
| 32 | { |
no test coverage detected