Remove deprecated json NullDoubleWriter class

This commit is contained in:
Tim Wojtulewicz 2024-08-02 11:08:59 -07:00
parent 401a074036
commit aba1f431cf
3 changed files with 2 additions and 30 deletions

View file

@ -340,7 +340,6 @@ add_zeek_dynamic_plugin_build_interface_include_directories(
${PROJECT_SOURCE_DIR}/auxil/binpac/lib ${PROJECT_SOURCE_DIR}/auxil/binpac/lib
${PROJECT_SOURCE_DIR}/auxil/broker/libbroker ${PROJECT_SOURCE_DIR}/auxil/broker/libbroker
${PROJECT_SOURCE_DIR}/auxil/paraglob/include ${PROJECT_SOURCE_DIR}/auxil/paraglob/include
${PROJECT_SOURCE_DIR}/auxil/rapidjson/include
${PROJECT_SOURCE_DIR}/auxil/prometheus-cpp/core/include ${PROJECT_SOURCE_DIR}/auxil/prometheus-cpp/core/include
${CMAKE_BINARY_DIR}/src ${CMAKE_BINARY_DIR}/src
${CMAKE_BINARY_DIR}/src/include ${CMAKE_BINARY_DIR}/src/include
@ -348,10 +347,6 @@ add_zeek_dynamic_plugin_build_interface_include_directories(
${CMAKE_BINARY_DIR}/auxil/broker/libbroker ${CMAKE_BINARY_DIR}/auxil/broker/libbroker
${CMAKE_BINARY_DIR}/auxil/prometheus-cpp/core/include) ${CMAKE_BINARY_DIR}/auxil/prometheus-cpp/core/include)
# threading/formatters/JSON.h includes rapidjson headers and may be used
# by external plugins, extend the include path.
target_include_directories(zeek_dynamic_plugin_base SYSTEM
INTERFACE $<INSTALL_INTERFACE:include/zeek/3rdparty/rapidjson/include>)
target_include_directories( target_include_directories(
zeek_dynamic_plugin_base SYSTEM zeek_dynamic_plugin_base SYSTEM
INTERFACE $<INSTALL_INTERFACE:include/zeek/3rdparty/prometheus-cpp/include>) INTERFACE $<INSTALL_INTERFACE:include/zeek/3rdparty/prometheus-cpp/include>)
@ -1010,9 +1005,6 @@ include(BuiltInSpicyAnalyzer)
include_directories(BEFORE ${PCAP_INCLUDE_DIR} ${BIND_INCLUDE_DIR} ${BinPAC_INCLUDE_DIR} include_directories(BEFORE ${PCAP_INCLUDE_DIR} ${BIND_INCLUDE_DIR} ${BinPAC_INCLUDE_DIR}
${ZLIB_INCLUDE_DIR} ${JEMALLOC_INCLUDE_DIR}) ${ZLIB_INCLUDE_DIR} ${JEMALLOC_INCLUDE_DIR})
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/auxil/rapidjson/include/rapidjson
DESTINATION include/zeek/3rdparty/rapidjson/include)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/auxil/filesystem/include/ghc install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/auxil/filesystem/include/ghc
DESTINATION include/zeek/3rdparty/) DESTINATION include/zeek/3rdparty/)

View file

@ -8,6 +8,8 @@
#define __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS
#endif #endif
#define RAPIDJSON_HAS_STDSTRING 1
#include <rapidjson/internal/ieee754.h> #include <rapidjson/internal/ieee754.h>
#include <cerrno> #include <cerrno>
#include <cmath> #include <cmath>
@ -20,12 +22,6 @@
namespace zeek::threading::formatter { namespace zeek::threading::formatter {
// For deprecated NullDoubleWriter
JSON::NullDoubleWriter::NullDoubleWriter(rapidjson::StringBuffer& stream)
: writer(std::make_unique<zeek::json::detail::NullDoubleWriter>(stream)) {}
bool JSON::NullDoubleWriter::Double(double d) { return writer->Double(d); }
JSON::JSON(MsgThread* t, TimeFormat tf, bool arg_include_unset_fields) JSON::JSON(MsgThread* t, TimeFormat tf, bool arg_include_unset_fields)
: Formatter(t), timestamps(tf), include_unset_fields(arg_include_unset_fields) {} : Formatter(t), timestamps(tf), include_unset_fields(arg_include_unset_fields) {}

View file

@ -4,12 +4,6 @@
#include <memory> #include <memory>
#define RAPIDJSON_HAS_STDSTRING 1
// Remove in v7.1 when removing NullDoubleWriter below and also remove
// rapidjson include tweaks from CMake's dynamic_plugin_base target.
#include <rapidjson/document.h>
#include <rapidjson/writer.h>
#include "zeek/threading/Formatter.h" #include "zeek/threading/Formatter.h"
namespace zeek::json::detail { namespace zeek::json::detail {
@ -39,16 +33,6 @@ public:
Value* ParseValue(const std::string& s, const std::string& name, TypeTag type, Value* ParseValue(const std::string& s, const std::string& name, TypeTag type,
TypeTag subtype = TYPE_ERROR) const override; TypeTag subtype = TYPE_ERROR) const override;
class NullDoubleWriter : public rapidjson::Writer<rapidjson::StringBuffer> {
public:
[[deprecated("Remove in v7.1 - This is an implementation detail.")]] NullDoubleWriter(
rapidjson::StringBuffer& stream);
bool Double(double d);
private:
std::unique_ptr<json::detail::NullDoubleWriter> writer;
};
private: private:
void BuildJSON(zeek::json::detail::NullDoubleWriter& writer, Value* val, const std::string& name = "") const; void BuildJSON(zeek::json::detail::NullDoubleWriter& writer, Value* val, const std::string& name = "") const;