Apply clang-format/cmake-format
This commit is contained in:
parent
e82d834bf2
commit
9a6d550d8f
|
@ -58,8 +58,7 @@ template <typename Type, BinaryVersion v> Type BinarySerializable<Type, v>::from
|
||||||
* Find out whether this is a compiler bug or a correct error message.
|
* Find out whether this is a compiler bug or a correct error message.
|
||||||
*/
|
*/
|
||||||
#define REFLECTIVE_RAPIDJSON_MAKE_BINARY_SERIALIZABLE(T) \
|
#define REFLECTIVE_RAPIDJSON_MAKE_BINARY_SERIALIZABLE(T) \
|
||||||
template <> struct ReflectiveRapidJSON::AdaptedBinarySerializable<T> : Traits::Bool<true> { \
|
template <> struct ReflectiveRapidJSON::AdaptedBinarySerializable<T> : Traits::Bool<true> {}
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace ReflectiveRapidJSON
|
} // namespace ReflectiveRapidJSON
|
||||||
|
|
||||||
|
|
|
@ -141,7 +141,11 @@ function (add_reflection_generator_invocation)
|
||||||
if (ARGS_CLANG_OPTIONS_FROM_TARGETS)
|
if (ARGS_CLANG_OPTIONS_FROM_TARGETS)
|
||||||
foreach (TARGET_NAME ${ARGS_CLANG_OPTIONS_FROM_TARGETS})
|
foreach (TARGET_NAME ${ARGS_CLANG_OPTIONS_FROM_TARGETS})
|
||||||
# set c++ standard
|
# set c++ standard
|
||||||
list(APPEND ARGS_CLANG_OPTIONS "$<$<BOOL:$<TARGET_PROPERTY:${TARGET_NAME},CXX_STANDARD>>:-std=c++$<TARGET_PROPERTY:${TARGET_NAME},CXX_STANDARD>>")
|
list(
|
||||||
|
APPEND
|
||||||
|
ARGS_CLANG_OPTIONS
|
||||||
|
"$<$<BOOL:$<TARGET_PROPERTY:${TARGET_NAME},CXX_STANDARD>>:-std=c++$<TARGET_PROPERTY:${TARGET_NAME},CXX_STANDARD>>"
|
||||||
|
)
|
||||||
# add compile flags and options
|
# add compile flags and options
|
||||||
_reflective_rapidjson_set_prop("${TARGET_NAME}" COMPILE_FLAGS)
|
_reflective_rapidjson_set_prop("${TARGET_NAME}" COMPILE_FLAGS)
|
||||||
list(APPEND ARGS_CLANG_OPTIONS "$<$<BOOL:${PROP}>:$<JOIN:${PROP},$<SEMICOLON>>>")
|
list(APPEND ARGS_CLANG_OPTIONS "$<$<BOOL:${PROP}>:$<JOIN:${PROP},$<SEMICOLON>>>")
|
||||||
|
|
|
@ -120,8 +120,7 @@ const JsonSerializable<Type> &as(const Type &serializable)
|
||||||
* Find out whether this is a compiler bug or a correct error message.
|
* Find out whether this is a compiler bug or a correct error message.
|
||||||
*/
|
*/
|
||||||
#define REFLECTIVE_RAPIDJSON_MAKE_JSON_SERIALIZABLE(T) \
|
#define REFLECTIVE_RAPIDJSON_MAKE_JSON_SERIALIZABLE(T) \
|
||||||
template <> struct ReflectiveRapidJSON::AdaptedJsonSerializable<T> : Traits::Bool<true> { \
|
template <> struct ReflectiveRapidJSON::AdaptedJsonSerializable<T> : Traits::Bool<true> {}
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \def The REFLECTIVE_RAPIDJSON_PUSH_PRIVATE_MEMBERS macro enables serialization of private members.
|
* \def The REFLECTIVE_RAPIDJSON_PUSH_PRIVATE_MEMBERS macro enables serialization of private members.
|
||||||
|
|
24
lib/traits.h
24
lib/traits.h
|
@ -16,30 +16,22 @@ namespace Traits = ::CppUtilities::Traits;
|
||||||
|
|
||||||
// define structs and macros to allow treating custom data types as std::map, std::set, ...
|
// define structs and macros to allow treating custom data types as std::map, std::set, ...
|
||||||
/// \brief \brief The TreatAsMapOrHash class allows treating custom classes as std::map or std::unordered_map.
|
/// \brief \brief The TreatAsMapOrHash class allows treating custom classes as std::map or std::unordered_map.
|
||||||
template <typename T> struct TreatAsMapOrHash : public Traits::Bool<false> {
|
template <typename T> struct TreatAsMapOrHash : public Traits::Bool<false> {};
|
||||||
};
|
|
||||||
/// \brief \brief The TreatAsMultiMapOrHash class allows treating custom classes as std::multimap or std::unordered_multimap.
|
/// \brief \brief The TreatAsMultiMapOrHash class allows treating custom classes as std::multimap or std::unordered_multimap.
|
||||||
template <typename T> struct TreatAsMultiMapOrHash : public Traits::Bool<false> {
|
template <typename T> struct TreatAsMultiMapOrHash : public Traits::Bool<false> {};
|
||||||
};
|
|
||||||
/// \brief \brief The TreatAsSet class allows treating custom classes as std::set or std::unordered_set.
|
/// \brief \brief The TreatAsSet class allows treating custom classes as std::set or std::unordered_set.
|
||||||
template <typename T> struct TreatAsSet : public Traits::Bool<false> {
|
template <typename T> struct TreatAsSet : public Traits::Bool<false> {};
|
||||||
};
|
|
||||||
/// \brief \brief The TreatAsMultiSet class allows treating custom classes as std::multiset or std::unordered_multiset.
|
/// \brief \brief The TreatAsMultiSet class allows treating custom classes as std::multiset or std::unordered_multiset.
|
||||||
template <typename T> struct TreatAsMultiSet : public Traits::Bool<false> {
|
template <typename T> struct TreatAsMultiSet : public Traits::Bool<false> {};
|
||||||
};
|
|
||||||
|
|
||||||
#define REFLECTIVE_RAPIDJSON_TREAT_AS_MAP_OR_HASH(T) \
|
#define REFLECTIVE_RAPIDJSON_TREAT_AS_MAP_OR_HASH(T) \
|
||||||
template <> struct TreatAsMapOrHash<T> : public Traits::Bool<true> { \
|
template <> struct TreatAsMapOrHash<T> : public Traits::Bool<true> {}
|
||||||
}
|
|
||||||
#define REFLECTIVE_RAPIDJSON_TREAT_AS_MULTI_MAP_OR_HASH(T) \
|
#define REFLECTIVE_RAPIDJSON_TREAT_AS_MULTI_MAP_OR_HASH(T) \
|
||||||
template <> struct TreatAsMultiMapOrHash<T> : public Traits::Bool<true> { \
|
template <> struct TreatAsMultiMapOrHash<T> : public Traits::Bool<true> {}
|
||||||
}
|
|
||||||
#define REFLECTIVE_RAPIDJSON_TREAT_AS_SET(T) \
|
#define REFLECTIVE_RAPIDJSON_TREAT_AS_SET(T) \
|
||||||
template <> struct TreatAsSet<T> : public Traits::Bool<true> { \
|
template <> struct TreatAsSet<T> : public Traits::Bool<true> {}
|
||||||
}
|
|
||||||
#define REFLECTIVE_RAPIDJSON_TREAT_AS_MULTI_SET(T) \
|
#define REFLECTIVE_RAPIDJSON_TREAT_AS_MULTI_SET(T) \
|
||||||
template <> struct TreatAsMultiSet<T> : public Traits::Bool<true> { \
|
template <> struct TreatAsMultiSet<T> : public Traits::Bool<true> {}
|
||||||
}
|
|
||||||
|
|
||||||
// define traits to check for arrays, sets and maps
|
// define traits to check for arrays, sets and maps
|
||||||
template <typename Type>
|
template <typename Type>
|
||||||
|
|
Loading…
Reference in New Issue