From 1facc34e09e1c2c52e099c49d077f193bd481c48 Mon Sep 17 00:00:00 2001 From: Arne Welzel Date: Tue, 9 May 2023 10:57:14 +0200 Subject: [PATCH] Fixup Val.h/Val.cc: Actually move ValFromJSON into zeek::detail Lost during merge.. --- CHANGES | 4 ++++ VERSION | 2 +- src/Val.cc | 2 +- src/Val.h | 3 +++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index e4b699d482..2a3d4662f0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +6.0.0-dev.519 | 2023-05-09 11:03:32 +0200 + + * Fixup Val.h/Val.cc: Actually move ValFromJSON into zeek::detail (Arne Welzel, Corelight) + 6.0.0-dev.518 | 2023-05-09 10:19:46 +0200 * Implement from_json bif (Fupeng Zhao) diff --git a/VERSION b/VERSION index 303a1e609d..07052b4a23 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.0.0-dev.518 +6.0.0-dev.519 diff --git a/src/Val.cc b/src/Val.cc index 816e583a30..a6d6fbfed5 100644 --- a/src/Val.cc +++ b/src/Val.cc @@ -1379,7 +1379,7 @@ static std::variant BuildVal(const rapidjson::Value& j, con } } -std::variant ValFromJSON(std::string_view json_str, const TypePtr& t) +std::variant detail::ValFromJSON(std::string_view json_str, const TypePtr& t) { rapidjson::Document doc; rapidjson::ParseResult ok = doc.Parse(json_str.data(), json_str.length()); diff --git a/src/Val.h b/src/Val.h index 0cd9dc3eb6..629dbe624e 100644 --- a/src/Val.h +++ b/src/Val.h @@ -1795,9 +1795,12 @@ extern bool can_cast_value_to_type(const Val* v, Type* t); // specific instance later. extern bool can_cast_value_to_type(const Type* s, Type* t); +namespace detail + { // Parses a JSON string into arbitrary Zeek data using std::variant to simulate functional exception // handling. Returns a ValPtr if parsing was successful, or a std::string containing an error // message if an error occurred. extern std::variant ValFromJSON(std::string_view json_str, const TypePtr& t); + } } // namespace zeek