Skip to content

Commit ca9db4e

Browse files
committed
add export
1 parent b624071 commit ca9db4e

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/iceberg/json_internal.h

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Result<std::unique_ptr<SortField>> SortFieldFromJson(const nlohmann::json& json)
5959
///
6060
/// \param sort_order The `SortOrder` object to be serialized.
6161
/// \return A JSON object representing the `SortOrder` with its order ID and fields array.
62-
nlohmann::json ToJson(const SortOrder& sort_order);
62+
ICEBERG_EXPORT nlohmann::json ToJson(const SortOrder& sort_order);
6363

6464
/// \brief Deserializes a JSON object into a `SortOrder` object.
6565
///
@@ -70,19 +70,20 @@ nlohmann::json ToJson(const SortOrder& sort_order);
7070
/// \param json The JSON object representing a `SortOrder`.
7171
/// \return An `expected` value containing either a `SortOrder` object or an error. If the
7272
/// JSON is malformed or missing expected fields, an error will be returned.
73-
Result<std::unique_ptr<SortOrder>> SortOrderFromJson(const nlohmann::json& json);
73+
ICEBERG_EXPORT Result<std::unique_ptr<SortOrder>> SortOrderFromJson(
74+
const nlohmann::json& json);
7475

7576
/// \brief Convert an Iceberg Schema to JSON.
7677
///
7778
/// \param[in] schema The Iceberg schema to convert.
7879
/// \return The JSON representation of the schema.
79-
nlohmann::json ToJson(const Schema& schema);
80+
ICEBERG_EXPORT nlohmann::json ToJson(const Schema& schema);
8081

8182
/// \brief Convert JSON to an Iceberg Schema.
8283
///
8384
/// \param[in] json The JSON representation of the schema.
8485
/// \return The Iceberg schema or an error if the conversion fails.
85-
Result<std::unique_ptr<Schema>> SchemaFromJson(const nlohmann::json& json);
86+
ICEBERG_EXPORT Result<std::unique_ptr<Schema>> SchemaFromJson(const nlohmann::json& json);
8687

8788
/// \brief Convert an Iceberg Type to JSON.
8889
///
@@ -143,7 +144,7 @@ Result<std::unique_ptr<PartitionField>> PartitionFieldFromJson(
143144
/// \param partition_spec The `PartitionSpec` object to be serialized.
144145
/// \return A JSON object representing the `PartitionSpec` with its order ID and fields
145146
/// array.
146-
nlohmann::json ToJson(const PartitionSpec& partition_spec);
147+
ICEBERG_EXPORT nlohmann::json ToJson(const PartitionSpec& partition_spec);
147148

148149
/// \brief Deserializes a JSON object into a `PartitionSpec` object.
149150
///
@@ -155,7 +156,7 @@ nlohmann::json ToJson(const PartitionSpec& partition_spec);
155156
/// \param json The JSON object representing a `PartitionSpec`.
156157
/// \return An `expected` value containing either a `PartitionSpec` object or an error. If
157158
/// the JSON is malformed or missing expected fields, an error will be returned.
158-
Result<std::unique_ptr<PartitionSpec>> PartitionSpecFromJson(
159+
ICEBERG_EXPORT Result<std::unique_ptr<PartitionSpec>> PartitionSpecFromJson(
159160
const std::shared_ptr<Schema>& schema, const nlohmann::json& json);
160161

161162
/// \brief Serializes a `SnapshotRef` object to JSON.
@@ -236,13 +237,14 @@ Result<MetadataLogEntry> MetadataLogEntryFromJson(const nlohmann::json& json);
236237
///
237238
/// \param table_metadata The `TableMetadata` object to be serialized.
238239
/// \return A JSON object representing the `TableMetadata`.
239-
nlohmann::json ToJson(const TableMetadata& table_metadata);
240+
ICEBERG_EXPORT nlohmann::json ToJson(const TableMetadata& table_metadata);
240241

241242
/// \brief Deserializes a JSON object into a `TableMetadata` object.
242243
///
243244
/// \param json The JSON object representing a `TableMetadata`.
244245
/// \return A `TableMetadata` object or an error if the conversion fails.
245-
Result<std::unique_ptr<TableMetadata>> TableMetadataFromJson(const nlohmann::json& json);
246+
ICEBERG_EXPORT Result<std::unique_ptr<TableMetadata>> TableMetadataFromJson(
247+
const nlohmann::json& json);
246248

247249
/// \brief Deserialize a JSON string into a `nlohmann::json` object.
248250
///

0 commit comments

Comments
 (0)