Releases: stephenberry/glaze
Releases · stephenberry/glaze
1.4.2
1.4.1
Fixes:
- Properly erroring for invalid Enum keys
New Features:
- Added
custom_read
andcustom_write
flag support toglz::meta
, which can solve ambiguous partial template specialization (see custom-serialization.md) - Added
error_on_const_read
compile time option toglz::opts
, which will produce errors if an attempt is made to read into a const value (the default behavior is still to skip the value)
Internal Improvements:
- Using
.erase
rather than.resize
where appropriate when reducing lengths of array like types
1.4.0
BREAKING JSON RPC 2.0 interface changes:
rpc::server_method_t
andrpc::client_method_t
have been replaced with a singlerpc::method
type.
rpc::json_rpc_t
has been replaced withrpc::id_t
- Significant JSON RPC 2.0 code cleanup, with some performance improvements
- Fixed long
0.000...
float reading - Thread pool (
glz::pool
) cleaning and internal improvements
1.3.6
JSON
- Safer buffer resize (avoids issues if buffer is of zero length)
- Support for raw buffers in
write_as_json
name_v
fix forlong long
andunsigned long long
(Thanks @jbbjarnason)- Fix the counting of json array elements when the element type is object or array (Thanks @huangminghuang)
Binary
- Significant binary format changes to support latest EVE specification
- Faster and cleaner binary format code
write_file_binary
supports more buffer types- New binary matrix format handled with Eigen
1.3.5
- Removed undefined behavior with page boundary checking (fixes address sanitizer complaints)
- Much safer integer parsing, with underflow and overflow checking
- Removed deprecated file writing functions
- Removed some unnecessary
<iostream>
includes for smaller sizes on embedded devices
1.3.4
Fixes
- Negative numbers when attempting to parse into unsigned integers are now properly errors
- Integer types with sizes less than 8 bytes (int8_t, int16_t, int32_t, etc.) are now checked for overflow and underflow against a parse into an
int64_t
or auint64_t
, depending on whether signed or unsigned - Fixed
glz::merge
for nested object types - Removed a bad noexcept for
glz::ex::read_json
New Features
- Added
glz::obj_copy
andglz::arr_copy
, which behave likeglz::obj
andglz::arr
, but copy state (these structures are for logging JSON) - Added CSV writing for
glz::recorder
Cleanup
- Eliminated unnecessary
thread_local
for set reading - Removed an unnecessary
#include <iostream>
1.3.3
- Fixed writing out objects within
glz::obj
and further nesting - Fixed serializing maps that skip nulls (Thanks @justend29)
- Removed now unnecessary MSVC specific code
1.3.2
- Significantly increased JSON schema support (
glz::schema
can be passed in the place of comments inglz::meta
) (Thanks @jbbjarnason) - Better support for
std::string_view
as map key type - More efficient
std
map type handling (especially of non-string keys, which are quoted) (Thanks @SlaaneshChosen) - Fixed support for glaze enum keys in map types (e.g.
std::map<MyEnum,...>
)
1.3.1
- Added
glz::merge
, which allows users to merge JSON object types (suggested by @GJanos)
glz::obj o{"pi", 3.141};
std::map<std::string_view, int> map = {{"a", 1}, {"b", 2}, {"c", 3}};
auto merged = glz::merge{o, map};
std::string s{};
glz::write_json(merged, s); // will write out a single, merged object
// s is now: {"pi":3.141,"a":0,"b":2,"c":3}
- Fixed null
char*
issues and added better concepts for char array handling (Thanks @maor-da) - Fixed std::max/std::min macro issues with MSVC (Thanks @alfedotov)
1.3.0
BREAKING v1.3.0 CHANGE: std::pair is now handled as a JSON object ({"first":second}}. If you require a JSON array of two items, use std::array or std::tuple.
Removed MSVC 2019 support (the compiler has too many limitations for ranges and compile time logic)
- Added numeric enum support (default behavior)
- std::string reading with CSV format
- Added separate concepts for
readable_map_t
andwritable_map_t
(thanks @justend29) - Views and ranges of
std::pair
can now be serialized as objects: (thanks @justend29)
auto num_view =
std::views::iota(-2, 3) | std::views::transform([](const auto i) { return std::pair(i, i * i); });
expect(glz::write_json(num_view) == glz::sv{R"({"-2":4,"-1":1,"0":0,"1":1,"2":4})"});
- Added
glz::invoke
andglz::invoke_update
, which allow invoking functions when reading JSON input - Added
GLZ_QUOTED_X
helper macro (thanks @pwqbot)