Skip to content

Commit

Permalink
Committing clang-format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenberry committed Jun 13, 2024
1 parent a4a31d3 commit ec8cc7f
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions include/glaze/binary/read.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace glz
}
}
};

template <class T>
requires(glaze_value_t<T> && !custom_read<T>)
struct from_binary<T>
Expand All @@ -68,7 +68,7 @@ namespace glz
{
using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
from_binary<V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
std::forward<Ctx>(ctx), std::forward<It0>(it), std::forward<It1>(end));
std::forward<Ctx>(ctx), std::forward<It0>(it), std::forward<It1>(end));
}
};

Expand Down
4 changes: 2 additions & 2 deletions include/glaze/binary/write.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ namespace glz
std::forward<B>(b), std::forward<IX>(ix));
}
};

template <class T>
requires(glaze_value_t<T> && !custom_write<T>)
struct to_binary<T>
Expand All @@ -114,7 +114,7 @@ namespace glz
{
using V = std::remove_cvref_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
to_binary<V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
std::forward<Ctx>(ctx), std::forward<B>(b), std::forward<IX>(ix));
std::forward<Ctx>(ctx), std::forward<B>(b), std::forward<IX>(ix));
}
};

Expand Down
14 changes: 7 additions & 7 deletions include/glaze/json/json_t.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,23 +174,23 @@ namespace glz
[[nodiscard]] bool is_number() const noexcept { return holds<double>(); }

[[nodiscard]] bool is_string() const noexcept { return holds<std::string>(); }

[[nodiscard]] bool is_boolean() const noexcept { return holds<bool>(); }

[[nodiscard]] bool is_null() const noexcept { return holds<std::nullptr_t>(); }

[[nodiscard]] array_t& get_array() noexcept { return get<array_t>(); }
[[nodiscard]] const array_t& get_array() const noexcept { return get<array_t>(); }

[[nodiscard]] object_t& get_object() noexcept { return get<object_t>(); }
[[nodiscard]] const object_t& get_object() const noexcept { return get<object_t>(); }

[[nodiscard]] double& get_number() noexcept { return get<double>(); }
[[nodiscard]] const double& get_number() const noexcept { return get<double>(); }

[[nodiscard]] std::string& get_string() noexcept { return get<std::string>(); }
[[nodiscard]] const std::string& get_string() const noexcept { return get<std::string>(); }

[[nodiscard]] bool& get_boolean() noexcept { return get<bool>(); }
[[nodiscard]] const bool& get_boolean() const noexcept { return get<bool>(); }

Expand Down Expand Up @@ -240,7 +240,7 @@ namespace glz
[[nodiscard]] inline bool is_number(const json_t& value) { return value.is_number(); }

[[nodiscard]] inline bool is_string(const json_t& value) { return value.is_string(); }

[[nodiscard]] inline bool is_boolean(const json_t& value) { return value.is_boolean(); }

[[nodiscard]] inline bool is_null(const json_t& value) { return value.is_null(); }
Expand Down
16 changes: 8 additions & 8 deletions tests/binary_test/binary_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2129,40 +2129,40 @@ suite json_t_tests = [] {
"json_t"_test = [] {
glz::json_t json("Hello World");
auto b = glz::write_binary(json).value_or("error");

json = nullptr;
expect(not glz::read_binary(json, b));
expect(json.is_string());
expect(json.get_string() == "Hello World");
};

"json_t"_test = [] {
glz::json_t json{{"i", 42}};
auto b = glz::write_binary(json).value_or("error");

json = nullptr;
expect(not glz::read_binary(json, b));
expect(json.is_object());
expect(json.get_object().size() == 1);
expect(json["i"].get_number() == 42);
};

"json_t"_test = [] {
glz::json_t json{{"str", "somewhere"}, {"arr", {1,2,3}}};
glz::json_t json{{"str", "somewhere"}, {"arr", {1, 2, 3}}};
auto b = glz::write_binary(json).value_or("error");

json = nullptr;
expect(not glz::read_binary(json, b));
expect(json.is_object());
expect(json.get_object().size() == 2);
expect(json["str"].get_string() == "somewhere");
expect(json["arr"].get_array().size() == 3);
};

"json_t"_test = [] {
glz::json_t json{1, 2, 3};
auto b = glz::write_binary(json).value_or("error");

json = nullptr;
expect(not glz::read_binary(json, b));
expect(json.is_array());
Expand Down
2 changes: 1 addition & 1 deletion tests/json_test/json_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3182,7 +3182,7 @@ suite generic_json_tests = [] {
expect(json.size() == 0);
expect(json.get_number() == 3.882e2);
};

"json_t is_boolean"_test = [] {
glz::json_t json{};
expect(not glz::read_json(json, "true"));
Expand Down

0 comments on commit ec8cc7f

Please sign in to comment.