Repository navigation
Immutable
release. Only release title and notes can be modified.
New features
- New built-in JSON/JSONC archive (about 3x faster than the previous RapidJSON-based archive):
- Strict RFC 8259 JSON parsing and JSONC comments/trailing commas.
- Native stream I/O for memory and files.
- New standard type support:
std::variantserialization (initial implementation by @hoshinohikari):- Index-, name- and discriminator-based representations (
VariantAsIndexed,VariantAsNamed,VariantAsDiscriminated). - Custom tag/content names and selectable default representation via
SerializationOptions::variantOptions. std::monostate.
- Index-, name- and discriminator-based representations (
std::basic_string_view<T>(save-only).std::span(C++20;std::span<const T>is save-only).std::chrono::year_month_day/hh_mm_ss(C++20).
- New validators:
GreaterThan,GreaterThanOrEqual,LessThan,LessThanOrEqual,MultipleOfandUuid. - Added
PropertyValuewrapper that automatically chooses an XML attribute or an element/key-value depending on the archive. - More control over the representation of map-like containers:
- Wrappers
MapAsObject,MapAsDictionaryandMapAsPairs. - Selectable default
MapLoadModeviaSerializationOptions::mapOptions.
- Wrappers
- Added
BITSERIALIZER_DECLARE_STRING_TYPEfor zero-copy serialization of custom string types:- Usable as map keys.
- Supported by string validators and refiners.
- Payload passthrough for the built-in JSON and MsgPack archives.
- RapidYaml v0.16 support.
Changes
trimStringFieldsnow applies to all string-like values;maxValidationErrorslimits fields with errors rather than individual messages.- Loading a boolean from numbers greater than 1 now reports
MismatchedTypesinstead ofOverflow. SerializationExceptionis preserved whenConvertByPolicyis used.std::pairserialization no longer uses static locals, so custom allocators work correctly (thanks @hoshinohikari).- Significant performance improvements (thanks @Cyberex for testing on real ARM hardware):
fast_floatparsing acceleration (optional; bundled in prebuilt packages).- Built-in JSON: SIMD scanning/escaping and buffered stream output.
- CSV and MsgPack: SIMD CSV scanning and buffered MsgPack stream I/O.
- Faster key comparison across archives.
SaveObjectnow honors the requested output type and supports output streams.
Breaking changes
- Built-in JSON behavior differs from the deprecated RapidJSON archive:
- Saving
NaN/InfinitythrowsSerializationException(previously it did not produce a valid JSON value). - Raw payloads are stored as opaque JSON text (not a DOM); loading scans them only to determine their extent.
- Saving re-emits the captured value verbatim without validation.
- Saving
std::multimapis now saved as a dictionary by default; useMapAsPairsfor the previous representation.
Deprecations
- RapidJSON-based JSON archive; use
BitSerializer::Json::JsonArchive(migration guide).- The archive remains available during the transition period.
ParsingException::Line/Offset->line/offset.CRawTime/CTimeRef->UnixTime/TimeRef.EnumAsBin->EnumAsInteger(the old name remains available as a deprecated alias).
Bug fixes
- Fixed PugiXml/RapidJSON array-scope edge cases and skipped array values in MsgPack.
- Fixed
TrimWhitespacefor whitespace-only strings andFallbackcopying of lvalue values. - Fixed validator messages and edge cases, including a GCC 14
-Warray-boundswarning in theEmailvalidator. - Fixed UTF validation/detection, enum matching/numeric parsing and float-to-string precision for legacy compilers.
- Fixed
ToLowerCase/ToUpperCaseto use locale-independent ASCII case conversion. - Fixed the fallback floating-point conversion path (legacy compilers without
from_chars) to be locale-independent. - Fixed PugiXml wide-character mode (
PUGIXML_WCHAR_MODE), which previously failed to compile in several paths.
Build and packaging
- Added first-class Bazel support (
MODULE.bazel/BUILD.bazel, integration tests and CI). - Bazel consumers pull PugiXml/RapidYAML only when they add those third-party modules explicitly; MsgPack-only builds stay free of them.
- Prebuilt packages bundle
fast_floatheaders and include the built-in JSON archive. - Release assets include the source tarball
bitserializer_v0.91_src.tar.gzwith a.sha256checksum.