File tree Expand file tree Collapse file tree 3 files changed +11
-14
lines changed
Expand file tree Collapse file tree 3 files changed +11
-14
lines changed Original file line number Diff line number Diff line change 3333
3434namespace iceberg {
3535
36-
3736Result<std::shared_ptr<Expression>> ExpressionFromJson (const nlohmann::json& json) {
3837 // Handle boolean literals
3938 if (json.is_boolean ()) {
@@ -55,10 +54,10 @@ nlohmann::json ToJson(const Expression& expr) {
5554 }
5655}
5756
58- #define ICEBERG_DEFINE_FROM_JSON (Model ) \
59- template <> \
57+ #define ICEBERG_DEFINE_FROM_JSON (Model ) \
58+ template <> \
6059 Result<std::shared_ptr<Model>> FromJson<Model>(const nlohmann::json& json) { \
61- return Model##FromJson (json); \
60+ return Model##FromJson (json); \
6261 }
6362
6463ICEBERG_DEFINE_FROM_JSON (Expression)
Original file line number Diff line number Diff line change 3030
3131namespace iceberg {
3232
33-
3433template <typename Model>
3534Result<Model> FromJson (const nlohmann::json& json);
3635
37- #define ICEBERG_DECLARE_JSON_SERDE (Model ) \
38- Result<std::shared_ptr<Model>> Model##FromJson(const nlohmann::json& json); \
39- \
40- template <typename Model> \
41- Result<std::shared_ptr<Model>> FromJson (const nlohmann::json& json); \
42- \
43- nlohmann::json ToJson (const Model& model);
36+ #define ICEBERG_DECLARE_JSON_SERDE (Model ) \
37+ Result<std::shared_ptr<Model>> Model##FromJson(const nlohmann::json& json); \
38+ \
39+ template <typename Model> \
40+ Result<std::shared_ptr<Model>> FromJson (const nlohmann::json& json); \
41+ \
42+ nlohmann::json ToJson (const Model& model);
4443
4544// / \note Don't forget to add `ICEBERG_DEFINE_FROM_JSON` to the end of
4645// / `json_internal.cc` to define the `FromJson` function for the model.
Original file line number Diff line number Diff line change 1717 * under the License.
1818 */
1919
20- #include " iceberg/expression/json_internal.h"
21-
2220#include < memory>
2321#include < vector>
2422
2826
2927#include " iceberg/expression/expression.h"
3028#include " iceberg/expression/expressions.h"
29+ #include " iceberg/expression/json_internal.h"
3130#include " iceberg/expression/literal.h"
3231#include " iceberg/expression/predicate.h"
3332#include " iceberg/expression/term.h"
You can’t perform that action at this time.
0 commit comments