pitrou commented on code in PR #50568: URL: https://github.com/apache/arrow/pull/50568#discussion_r3622622190
########## cpp/src/arrow/json/json_writer.h: ########## @@ -0,0 +1,67 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#pragma once + +#include <simdjson.h> + +#include <cstdint> +#include <string_view> + +#include "arrow/util/visibility.h" + +namespace arrow::json { + +class ARROW_EXPORT JsonWriter { + public: + JsonWriter() = default; + + void StartObject(); + void EndObject(); + + void StartArray(); + void EndArray(); + + void Key(std::string_view key); + + void String(std::string_view value); + void String(const char* data, size_t length); Review Comment: Let's have only the `std::string_view` version? The other doesn't bring any benefit. ########## cpp/src/arrow/json/json_writer.h: ########## Review Comment: Does this header have to be public? Otherwise, you can make it internal by renaming it to `json_writer_internal.h`. ########## cpp/src/arrow/integration/json_internal.h: ########## @@ -36,9 +36,14 @@ #include "arrow/util/visibility.h" namespace rj = arrow::rapidjson; -using RjWriter = rj::Writer<rj::StringBuffer>; -using RjArray = rj::Value::ConstArray; using RjObject = rj::Value::ConstObject; +using RjArray = rj::Value::ConstArray; + +namespace arrow { +namespace json { Review Comment: Can you collapse this as `namespace arrow::json`? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
