Releases: simulton/gpds
1.9.0
This release introduces C++20 concepts Serializable
, Deserializable
and SerializableRange
and corresponding API to the container
class. The main purpose/benefit of this new interface is to serialize/deserialize types without forcing inheritance from the gpds::serializable
interface.
- Introduce concept
Serializable
(0dd4eff). - Introduce concept
Deserializable
(fc9360a). - Add
container::add_value()
overload acceptingSerializable
object (475f1b0). - Add
container::get_value()
overload acceptingDeserializable
object (9d130f2). - Add
container::get_values()
overload acceptingDeserializable
object (049a4b9). - Add missing nullptr check to
archiver_xml
(27c2abe). - Update examples to use new
Serializable
andDeserializable
concept interfaces. - Various code improvements.
1.8.4
This is a patch/maintenance release:
- Previously, GPDS linked to the
spdlog
dependency if the CMake optionGPDS_FEATURE_SPDLOG
was set toON
. This is no longer the case. Everything spdlog related is contained in a header-only file. It's up to the consumer to link tospdlog
if necessary. The CMake optionGPDS_FEATURE_SPDLOG
has been removed entirely and thespdlog_sink.hpp
file is always installed (2e4c121). - Previously, consumers were in need to create the CMake library aliases
gpds::gpds-static
andgpds::gpds-shared
when consuming GPDS in a superbuild scenario instead of viafind_package()
. From now on, GPDS provides those library aliases itself (thanks to @bjornstromberg) (36ea6e8).
1.8.3
This is a patch release only addressing an issue in the generated gpds-config.cmake
script which resulted in always calling find_dependency(PkgConfig REQUIRED)
(and subsequent call to located tinyxml2
) even if the consuming system did not choose to use pkg-config
to located tinyxml2
.
1.8.2
Patch release adding support to optionally ingest the tinyxml2
dependency via CMake's find_package()
or via pkg-config
.
Thanks to @bjornstromberg
1.8.1
This release only has one change: The previous v1.8.0
release changed the default build settings to no longer build the static library with -fPIC
. However, this library is often linked into downstream shared libraries to provide built-in de-serialization capabilities. Static libraries being linked into a shared library still require to be built with -fPIC
.
1.8.0
- Features
- Add support for
float
. - Make
value::get()
more robust. Previously, this was potentially throwingstd::bad_variant_access
when calling with a POD template parameter type while storing a nested container instead. - Decay type template parameters where reasonable. Previously, something like
gpds::value::get<const int>()
orgpds::container::get_value<const int>()
would have failed. These template parameters are now decayed before performing type conversions.
- Add support for
- Fixes
- Add missing include to
utils.hpp
(reported by @aboelens).
- Add missing include to
- CMake
- Set feature
GPDS_FEATURE_SPDLOG
toOFF
by default - Remove setting of the
POSITION_INDEPENDENT_CODE
property on the static library target - Introduce
GPDS_BUILD_STATIC
andGPDS_BUILD_SHARED
options to independently control which libraries are being built. When using MSVC, these two options are mutually exclusive as they would result in naming conflicts/collisions of the generated*.LIB
files (reported by @aboelens)..
- Set feature
1.7.0
- Add support for
std::size_t
- Add
container::get_value()
andcontainer::get_attribute()
overloads accepting a default value parameter - Refactor & simplify interfaces
archiver
no longer provides high-level interfaces to (de)serialize to/from strings, files etc. Archivers only operate on streams.serializable
no longer provides high-level interfaces for (de)serialization to/from strings, files etc.- All (de)serialization operations are now performed through the various free standing functions:
gpds::to_stream()
/gpds::from_stream
:gpds::to_string()
/gpds::from_string()
:gpds::to_file()
/gpds::from_file()
:
- Minor internal code improvements
Note: This bumps the minimum required C++ standard to C++20.
1.6.0
General
- Add YAML support (thanks to @vowstar)
- Improve testing infrastructure
- Various minor internal improvements
Serialization interface
The serialization interface gpds::serialize
was extended. These previously existing functions are now marked as deprecated:
gpds::serialize::to_string()
gpds::serialize::from_string()
gpds::serialize::to_file()
gpds::serialize::from_file()
As a replacement, free-standing function templates have been introduced which provide the following benefits:
- They accept the archiver as a template parameter (for example
gpds::archiver_xml
orgpds::archiver_yaml
). - They can optionally automatically fetch the serialization root name from a serializable via the
T::gpds_name
static member (if present). - Once the now deprecated member functions are removed, potential function/name collisions are avoided.
As such, consuming code should replace the now deprecated functions listed above with call to the corresponding replacements:
gpds::to_string()
gpds::from_string()
gpds::to_file()
gpds::from_file()
As an example, previous consuming code would have looked like this:
class dut :
public gpds::serialize
{
// ...
};
dut d;
const auto& [success, msg] = d.to_string(str, "dut");
Now looks like this:
class dut :
public gpds::serialize
{
static constexpr const char* gpds_name = "dut";
// ...
};
dut d;
const auto& [success, msg] = gpds::to_string<gpds::archiver_xml>(str, d);
Refer to /examples/basic/
for more information.
1.5.1
1.5.0
- Fix bug in
archiver::save(std::string&)
. - Fix bug in CMake
install()
usage. - Add
serialize::to_string()
andserialize::from_string()
convenience functions. - Add an
spdlog
sink for easy sinking of log messages to GPDS containers (optional, see CMake optionGPDS_FEATURE_SPDLOG
). - Add explicit support for handling
<![CDATA[]]>
. Values can now explicitly request to be serialized to XML using CDATA viavalue::set_use_cdata()
. - Internal improvements to
archiver_xml
implementation. - Pass
std::string_view
by value instead of by const-ref where applicable. - Use
std::string_view
instead ofconst std::string&
to pass root name where applicable.
Furthermore:
- Improve/extend examples
- Improve/extend test cases
- Minor CMake improvements