|
|
@@ -3,6 +3,7 @@
|
|
|
#include <algorithm>
|
|
|
#include <cassert>
|
|
|
#include <iostream>
|
|
|
+#include <jvalidate/detail/number.h>
|
|
|
#include <string>
|
|
|
#include <string_view>
|
|
|
#include <variant>
|
|
|
@@ -53,7 +54,7 @@ public:
|
|
|
// assume that we are not going to use those kinds of paths in a reference
|
|
|
// field. Therefore we don't need to include any clever tricks for storage
|
|
|
if (not in.empty() && in.find_first_not_of("0123456789") == std::string::npos) {
|
|
|
- return tokens_.push_back(std::stoull(in));
|
|
|
+ return tokens_.push_back(from_str<size_t>(in));
|
|
|
}
|
|
|
|
|
|
for (size_t i = 0; i < in.size(); ++i) {
|
|
|
@@ -62,8 +63,8 @@ public:
|
|
|
// than '/' and '~' to be handled in all contexts.
|
|
|
// TODO(samjaffe): Only do this if enc is hex-like (currently throws?)
|
|
|
if (in[i] == '%') {
|
|
|
- char const enc[3] = {in[i + 1], in[i + 2]};
|
|
|
- in.replace(i, 3, 1, char(std::stoi(enc, nullptr, 16)));
|
|
|
+ char const enc[3] = {in[i + 1], in[i + 2], '\0'};
|
|
|
+ in.replace(i, 3, 1, from_str<char>(enc, 16));
|
|
|
} else if (in[i] != '~') {
|
|
|
// Not a special char-sequence, does not need massaging
|
|
|
continue;
|