Releases: injae/serdepp
Releases · injae/serdepp
Release v0.1.4.1
vcpkg serdepp-config.cmake error fix
- Before
get_filename_component(VCPKG_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_DIR}/../../" ABSOLUTE)get_filename_component(CPPM_CURRENT_MODULE_DIR ../ ABSOLUTE)
- After
get_filename_component(VCPKG_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_DIR}/../../" ABSOLUTE)
get_filename_component(CPPM_CURRENT_MODULE_DIR ../ ABSOLUTE)
v0.1.4
Changed
- Change: serde() function for reflection
- Before
template<class Context> constexpr static void serde(Context& context, Type& value) { using namespace serde::attribute; using Self [[maybe_unused]] = Type; serde::serde_struct ss(context, value); }
- After
template<class Context> constexpr static auto serde(Context& context, Type& value) { using namespace serde::attribute; using Self [[maybe_unused]] = Type; serde::serde_struct ss(context, value); return ss; }
- Before
- NEW: reflection
serde::type_info<T>
Examplestruct A { DERIVE_SERDE(A,_SF_(a)_SF_(b)_SF_(c)) int a; std::string b; std::vector<int> c; }; A a;
- Compile Time Type Convert: Struct -> Tuple
serde::to_tuple_t<A> == std::tuple<int,std::string,std::vector<int>>
- Compile Time Type member variable size: ->
serde::type_info<A>.size == 3
orserde::tuple_size_v<A> == 3
constexpr
member variable name array:serde::type_info<A>.member_names().members() == ["a", "b", "c"]
constexpr
Accessing member variables by index:serde::type_info<A>.member<1>(a) == a.b
constexpr
Accessing member variables by name:serde::type_info<A>.member<std::string>(a, "b"). == a.b
constexpr
Accessing member variable info by index:serde::type_info<A>.member_info<1>(a)
.name()
or.value()
- Compile Time Type Convert: Struct -> Tuple
- Fix: rapidjson Map type key allocate bug
- yaml-cpp: 0.6.3 -> 0.7.0
- New: simple unittest
Full Changelog: v0.1.3.1...v0.1.4
Release v0.1.3.1
v0.1.2
Release v0.1.1
Features
-
add new feature struct attributes
serde_struct<>{}.attributes(Attributes... )
DERIVE_SERDE(Test, .attributes(...))
-
add syntax sugar
- Old
DERIVE_SERDE(Test, (&Self::test, "test, flatten, default_{""})
- New
DERIVE_SERDE(Test, [attributes(flatten, default_{""})] (&Self::test, "test)
Release v0.1.0
Features
std::variant<T...>
supportstd::optional<T..>
supportsequence_type<T...>
, custom sequence type support ex(std::vector
,std::list
...)map_type<K,V>
, custom map type support ex(std::map
,std::unordered_map
...)enum
,enum class
supportstruct
, nested struct supportattribute
, custom attribute support ex(default_
,flatten
,value_or_struct
,make_optional
...)- custom
serde_serializer<T>
support - json support (nlohmann_json, RapidJson)
- toml support (toml11)
- yaml support (yaml-cpp)
- custom
serde_adaptor
(toml, yaml, json, ...) support
serde 0.0.2
0.0.2 backup