Commit graph

8 commits

Author SHA1 Message Date
Chaosvex
09559aaf44
Change enum casing across the whole project (#137) 2026-02-19 01:25:02 +00:00
Chaosvex
8b5d8b1c63
Bring Spark buffers up to date with Hexi version (#67) 2025-04-04 21:30:52 +01:00
Chaosvex
9cc5210f66 Add support for writing to std::array with BufferAdaptor 2025-04-03 16:36:27 +01:00
Chaosvex
751bf40316
Implement improved string handling for BinaryStream (#66)
Provides adaptors for explicitly specifying how strings should be handled with being serialised and deserialised. These adaptors are:

`raw()` - write the data exactly as in
`null_terminated` - ensure the string is written with a null terminator - strings with embedded null bytes are *not* allowed (but is only enforced in debug) as retrieving such a string would stop at the first embedded null. This is user error is mostly semantics.
`prefixed` - prefixes the length before the string, no terminator is written.
`prefixed_varint` - prefixes the length, encoded as a varint, no terminator is written. This is more compact but slower than `prefixed`

All adaptors can be used both as input and output, with the exception of `raw()`. Retrieving strings written using `raw` requires the user to know specifics about the string content (i.e. whether it has embedded nulls or its length), so `.get()` should be used.
2025-03-30 15:29:46 +01:00
Chaosvex
62638cc0cb Fix unit test so that it doesn't trip debug iterator assertions caused by the buffer adaptor resetting the vector 2025-03-23 15:02:28 +00:00
Chaosvex
70e1a804ad
Introduce ranges (#52)
Convert some algorithms to ranges
2024-09-10 00:11:41 +01:00
Chaosvex
ecdf79f722 Fix unit test iterator range 2024-09-09 23:03:25 +01:00
Chaosvex
9df9f59866 Rename unit tests 2024-08-27 14:20:07 +01:00
Renamed from tests/BufferAdaptorV2.cpp (Browse further)