Skip to content

Commit bdfd07f

Browse files
committed
Committing clang-format changes
1 parent d68b505 commit bdfd07f

File tree

8 files changed

+89
-89
lines changed

8 files changed

+89
-89
lines changed

include/glaze/beve/write.hpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -876,15 +876,16 @@ namespace glz
876876
static constexpr auto sub_partial = get<1>(group);
877877
static constexpr auto index = key_index<T>(key);
878878
static_assert(index < reflect<T>::size, "Invalid key passed to partial write");
879-
879+
880880
if constexpr (glaze_object_t<T>) {
881881
static constexpr auto member = get<index>(reflect<T>::values);
882882
detail::write<BEVE>::no_header<Opts>(key, ctx, b, ix);
883883
write_partial<BEVE>::op<sub_partial, Opts>(get_member(value, member), ctx, b, ix);
884884
}
885885
else {
886886
detail::write<BEVE>::no_header<Opts>(key, ctx, b, ix);
887-
write_partial<BEVE>::op<sub_partial, Opts>(get_member(value, get<index>(to_tuple(value))), ctx, b, ix);
887+
write_partial<BEVE>::op<sub_partial, Opts>(get_member(value, get<index>(to_tuple(value))), ctx, b,
888+
ix);
888889
}
889890
});
890891
}

include/glaze/core/common.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,8 @@ namespace glz
372372
concept glaze_array_t = glaze_t<T> && is_specialization_v<meta_wrapper_t<T>, Array>;
373373

374374
template <class T>
375-
concept glaze_object_t = glaze_t<T> && (is_specialization_v<meta_wrapper_t<T>, Object> || (not std::is_enum_v<std::decay_t<T>> && meta_keys<T>));
375+
concept glaze_object_t = glaze_t<T> && (is_specialization_v<meta_wrapper_t<T>, Object> ||
376+
(not std::is_enum_v<std::decay_t<T>> && meta_keys<T>));
376377

377378
template <class T>
378379
concept glaze_enum_t = glaze_t<T> && is_specialization_v<meta_wrapper_t<T>, Enum>;

include/glaze/core/reflect.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ namespace glz::detail
732732
}
733733
return n;
734734
}
735-
735+
736736
GLZ_ALWAYS_INLINE constexpr uint64_t bitmix(uint64_t h, const uint64_t seed) noexcept
737737
{
738738
h *= seed;

include/glaze/core/seek.hpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,9 @@ namespace glz
547547
constexpr auto rem_ptr = glz::string_literal_from_view<tokens.second.size()>(tokens.second);
548548
if constexpr (glz::detail::glaze_object_t<V>) {
549549
constexpr auto& HashInfo = detail::hash_info<V>;
550-
constexpr auto I = detail::decode_hash_with_size<JSON, V, HashInfo, HashInfo.type>::op(key_str.data(), key_str.data() + key_str.size(), key_str.size());
551-
550+
constexpr auto I = detail::decode_hash_with_size<JSON, V, HashInfo, HashInfo.type>::op(
551+
key_str.data(), key_str.data() + key_str.size(), key_str.size());
552+
552553
if constexpr (I < reflect<V>::size) {
553554
if constexpr (key_str != reflect<V>::keys[I]) {
554555
return false;

include/glaze/json/read.hpp

+5-6
Original file line numberDiff line numberDiff line change
@@ -1612,14 +1612,13 @@ namespace glz
16121612
read<JSON>::op<ws_handled_off<Opts>()>(s, ctx, it, end);
16131613
if (bool(ctx.error)) [[unlikely]]
16141614
return;
1615-
1616-
const auto index = decode_hash_with_size<JSON, T, HashInfo, HashInfo.type>::op(s.data(), s.data() + s.size(), s.size());
1617-
1615+
1616+
const auto index =
1617+
decode_hash_with_size<JSON, T, HashInfo, HashInfo.type>::op(s.data(), s.data() + s.size(), s.size());
1618+
16181619
constexpr auto N = reflect<T>::size;
16191620
if (index < N) [[likely]] {
1620-
visit<N>([&]<size_t I>(){
1621-
get_member(value, get<I>(reflect<T>::values)) = true;
1622-
}, index);
1621+
visit<N>([&]<size_t I>() { get_member(value, get<I>(reflect<T>::values)) = true; }, index);
16231622
}
16241623
else [[unlikely]] {
16251624
ctx.error = error_code::invalid_flag_input;

include/glaze/json/schema.hpp

+71-73
Original file line numberDiff line numberDiff line change
@@ -196,79 +196,77 @@ struct glz::meta<glz::detail::schematic>
196196
{
197197
static constexpr std::string_view name = "glz::detail::schema";
198198
using T = detail::schematic;
199-
static constexpr std::array keys{
200-
"type", //
201-
"properties", //
202-
"items", //
203-
"additionalProperties", //
204-
"$defs", //
205-
"oneOf", //
206-
"examples", //
207-
"required", //
208-
"title", //
209-
"description", //
210-
"default", //
211-
"deprecated", //
212-
"readOnly", //
213-
"writeOnly", //
214-
"const", //
215-
"minLength", //
216-
"maxLength", //
217-
"pattern", //
218-
"format", //
219-
"minimum", //
220-
"maximum", //
221-
"exclusiveMinimum", //
222-
"exclusiveMaximum", //
223-
"multipleOf", //
224-
"minProperties", //
225-
"maxProperties", //
226-
// "dependentRequired", //
227-
"minItems", //
228-
"maxItems", //
229-
"minContains", //
230-
"maxContains", //
231-
"uniqueItems", //
232-
"enum", //
233-
"ExtUnits", //
234-
"ExtAdvanced"};
235-
236-
static constexpr glz::tuplet::tuple value{
237-
&T::type, //
238-
&T::properties, //
239-
&T::items, //
240-
&T::additionalProperties, //
241-
&T::defs, //
242-
&T::oneOf, //
243-
raw<&T::examples>, //
244-
&T::required, //
245-
[](auto&& s) -> auto& { return s.attributes.title; }, //
246-
[](auto&& s) -> auto& { return s.attributes.description; }, //
247-
[](auto&& s) -> auto& { return s.attributes.defaultValue; }, //
248-
[](auto&& s) -> auto& { return s.attributes.deprecated; }, //
249-
[](auto&& s) -> auto& { return s.attributes.readOnly; }, //
250-
[](auto&& s) -> auto& { return s.attributes.writeOnly; }, //
251-
[](auto&& s) -> auto& { return s.attributes.constant; }, //
252-
[](auto&& s) -> auto& { return s.attributes.minLength; }, //
253-
[](auto&& s) -> auto& { return s.attributes.maxLength; }, //
254-
[](auto&& s) -> auto& { return s.attributes.pattern; }, //
255-
[](auto&& s) -> auto& { return s.attributes.format; }, //
256-
[](auto&& s) -> auto& { return s.attributes.minimum; }, //
257-
[](auto&& s) -> auto& { return s.attributes.maximum; }, //
258-
[](auto&& s) -> auto& { return s.attributes.exclusiveMinimum; }, //
259-
[](auto&& s) -> auto& { return s.attributes.exclusiveMaximum; }, //
260-
[](auto&& s) -> auto& { return s.attributes.multipleOf; }, //
261-
[](auto&& s) -> auto& { return s.attributes.minProperties; }, //
262-
[](auto&& s) -> auto& { return s.attributes.maxProperties; }, //
263-
// [](auto&& s) -> auto& { return s.attributes.dependent_required; }, //
264-
[](auto&& s) -> auto& { return s.attributes.minItems; }, //
265-
[](auto&& s) -> auto& { return s.attributes.maxItems; }, //
266-
[](auto&& s) -> auto& { return s.attributes.minContains; }, //
267-
[](auto&& s) -> auto& { return s.attributes.maxContains; }, //
268-
[](auto&& s) -> auto& { return s.attributes.uniqueItems; }, //
269-
[](auto&& s) -> auto& { return s.attributes.enumeration; }, //
270-
[](auto&& s) -> auto& { return s.attributes.ExtUnits; }, //
271-
[](auto&& s) -> auto& { return s.attributes.ExtAdvanced; }};
199+
static constexpr std::array keys{"type", //
200+
"properties", //
201+
"items", //
202+
"additionalProperties", //
203+
"$defs", //
204+
"oneOf", //
205+
"examples", //
206+
"required", //
207+
"title", //
208+
"description", //
209+
"default", //
210+
"deprecated", //
211+
"readOnly", //
212+
"writeOnly", //
213+
"const", //
214+
"minLength", //
215+
"maxLength", //
216+
"pattern", //
217+
"format", //
218+
"minimum", //
219+
"maximum", //
220+
"exclusiveMinimum", //
221+
"exclusiveMaximum", //
222+
"multipleOf", //
223+
"minProperties", //
224+
"maxProperties", //
225+
// "dependentRequired", //
226+
"minItems", //
227+
"maxItems", //
228+
"minContains", //
229+
"maxContains", //
230+
"uniqueItems", //
231+
"enum", //
232+
"ExtUnits", //
233+
"ExtAdvanced"};
234+
235+
static constexpr glz::tuplet::tuple value{&T::type, //
236+
&T::properties, //
237+
&T::items, //
238+
&T::additionalProperties, //
239+
&T::defs, //
240+
&T::oneOf, //
241+
raw<&T::examples>, //
242+
&T::required, //
243+
[](auto&& s) -> auto& { return s.attributes.title; }, //
244+
[](auto&& s) -> auto& { return s.attributes.description; }, //
245+
[](auto&& s) -> auto& { return s.attributes.defaultValue; }, //
246+
[](auto&& s) -> auto& { return s.attributes.deprecated; }, //
247+
[](auto&& s) -> auto& { return s.attributes.readOnly; }, //
248+
[](auto&& s) -> auto& { return s.attributes.writeOnly; }, //
249+
[](auto&& s) -> auto& { return s.attributes.constant; }, //
250+
[](auto&& s) -> auto& { return s.attributes.minLength; }, //
251+
[](auto&& s) -> auto& { return s.attributes.maxLength; }, //
252+
[](auto&& s) -> auto& { return s.attributes.pattern; }, //
253+
[](auto&& s) -> auto& { return s.attributes.format; }, //
254+
[](auto&& s) -> auto& { return s.attributes.minimum; }, //
255+
[](auto&& s) -> auto& { return s.attributes.maximum; }, //
256+
[](auto&& s) -> auto& { return s.attributes.exclusiveMinimum; }, //
257+
[](auto&& s) -> auto& { return s.attributes.exclusiveMaximum; }, //
258+
[](auto&& s) -> auto& { return s.attributes.multipleOf; }, //
259+
[](auto&& s) -> auto& { return s.attributes.minProperties; }, //
260+
[](auto&& s) -> auto& { return s.attributes.maxProperties; }, //
261+
// [](auto&& s) -> auto& { return s.attributes.dependent_required; }, //
262+
[](auto&& s) -> auto& { return s.attributes.minItems; }, //
263+
[](auto&& s) -> auto& { return s.attributes.maxItems; }, //
264+
[](auto&& s) -> auto& { return s.attributes.minContains; }, //
265+
[](auto&& s) -> auto& { return s.attributes.maxContains; }, //
266+
[](auto&& s) -> auto& { return s.attributes.uniqueItems; }, //
267+
[](auto&& s) -> auto& { return s.attributes.enumeration; }, //
268+
[](auto&& s) -> auto& { return s.attributes.ExtUnits; }, //
269+
[](auto&& s) -> auto& { return s.attributes.ExtAdvanced; }};
272270
};
273271

274272
namespace glz

include/glaze/util/hash_map.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ namespace glz::detail
270270
}
271271
}
272272
};
273-
273+
274274
// Check if a size_t value exists inside of a container like std::array<size_t, N>
275275
// Using a pointer and size rather than std::span for faster compile times
276276
constexpr bool contains(const size_t* data, const size_t size, const size_t val) noexcept

tests/json_test/json_test.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -10047,12 +10047,12 @@ struct glz::meta<birds>
1004710047

1004810048
suite meta_keys_for_struct = [] {
1004910049
"meta_keys birds"_test = [] {
10050-
birds obj{"caw","chirp","screech"};
10051-
10050+
birds obj{"caw", "chirp", "screech"};
10051+
1005210052
std::string buffer{};
1005310053
expect(not glz::write_json(obj, buffer));
1005410054
expect(buffer == R"({"crow":"caw","sparrow":"chirp","hawk":"screech"})") << buffer;
10055-
10055+
1005610056
obj = {};
1005710057
expect(not glz::read_json(obj, buffer));
1005810058
expect(obj.crow == "caw");

0 commit comments

Comments
 (0)