| 329 | } |
| 330 | |
| 331 | bool strToInt(std::string s, uint32_t* x) { |
| 332 | for (const char& c : s) { |
| 333 | if (c < '0' || c > '9') { |
| 334 | return false; |
| 335 | } |
| 336 | } |
| 337 | if (!(std::stringstream(s) >> *x)) { |
| 338 | return false; |
| 339 | } |
| 340 | return true; |
| 341 | } |
| 342 | |
| 343 | } // anonymous namespace |
| 344 |