Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-08-28 08:26:59

0001 // Licensed to the Apache Software Foundation (ASF) under one
0002 // or more contributor license agreements.  See the NOTICE file
0003 // distributed with this work for additional information
0004 // regarding copyright ownership.  The ASF licenses this file
0005 // to you under the Apache License, Version 2.0 (the
0006 // "License"); you may not use this file except in compliance
0007 // with the License.  You may obtain a copy of the License at
0008 //
0009 //   http://www.apache.org/licenses/LICENSE-2.0
0010 //
0011 // Unless required by applicable law or agreed to in writing,
0012 // software distributed under the License is distributed on an
0013 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
0014 // KIND, either express or implied.  See the License for the
0015 // specific language governing permissions and limitations
0016 // under the License.
0017 
0018 // Implement a simple JSON representation format for arrays
0019 
0020 #pragma once
0021 
0022 #include <memory>
0023 #include <string>
0024 #include <string_view>
0025 
0026 #include "arrow/status.h"
0027 #include "arrow/type_fwd.h"
0028 #include "arrow/util/visibility.h"
0029 
0030 namespace arrow {
0031 
0032 class Array;
0033 class DataType;
0034 
0035 namespace ipc {
0036 namespace internal {
0037 namespace json {
0038 
0039 ARROW_EXPORT
0040 Result<std::shared_ptr<Array>> ArrayFromJSON(const std::shared_ptr<DataType>&,
0041                                              const std::string& json);
0042 
0043 ARROW_EXPORT
0044 Result<std::shared_ptr<Array>> ArrayFromJSON(const std::shared_ptr<DataType>&,
0045                                              std::string_view json);
0046 
0047 ARROW_EXPORT
0048 Result<std::shared_ptr<Array>> ArrayFromJSON(const std::shared_ptr<DataType>&,
0049                                              const char* json);
0050 
0051 ARROW_EXPORT
0052 Status ChunkedArrayFromJSON(const std::shared_ptr<DataType>& type,
0053                             const std::vector<std::string>& json_strings,
0054                             std::shared_ptr<ChunkedArray>* out);
0055 
0056 ARROW_EXPORT
0057 Status DictArrayFromJSON(const std::shared_ptr<DataType>&, std::string_view indices_json,
0058                          std::string_view dictionary_json, std::shared_ptr<Array>* out);
0059 
0060 ARROW_EXPORT
0061 Status ScalarFromJSON(const std::shared_ptr<DataType>&, std::string_view json,
0062                       std::shared_ptr<Scalar>* out);
0063 
0064 ARROW_EXPORT
0065 Status DictScalarFromJSON(const std::shared_ptr<DataType>&, std::string_view index_json,
0066                           std::string_view dictionary_json, std::shared_ptr<Scalar>* out);
0067 
0068 }  // namespace json
0069 }  // namespace internal
0070 }  // namespace ipc
0071 }  // namespace arrow