|
|
@@ -4,6 +4,7 @@
|
|
|
#include <cstddef>
|
|
|
#include <ctime>
|
|
|
#include <string>
|
|
|
+#include <string_view>
|
|
|
#include <unordered_map>
|
|
|
#include <utility>
|
|
|
|
|
|
@@ -303,7 +304,7 @@ private:
|
|
|
{"iri-reference", nullptr},
|
|
|
{"json-pointer", &format::json_pointer},
|
|
|
{"relative-json-pointer", &format::ctor_as_valid<detail::RelativePointer>},
|
|
|
- /* {"regex", &detail::StdRegexEngine::is_valid}, */
|
|
|
+ {"regex", nullptr},
|
|
|
{"time", &format::time},
|
|
|
{"uri", nullptr},
|
|
|
{"uri-reference", nullptr},
|
|
|
@@ -313,6 +314,7 @@ private:
|
|
|
|
|
|
public:
|
|
|
FormatValidator() = default;
|
|
|
+ FormatValidator(Predicate is_regex) { supported_formats_.insert_or_assign("regex", is_regex); }
|
|
|
|
|
|
Status operator()(std::string const & format, std::string_view text) const {
|
|
|
if (auto it = supported_formats_.find(format); it != supported_formats_.end() && it->second) {
|