Commit graph

13 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
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
d0f7b641ec Using namespace in unit tests
Minor consistency nitpick
2024-12-24 01:15:35 +00:00
Chaosvex
70e1a804ad
Introduce ranges (#52)
Convert some algorithms to ranges
2024-09-10 00:11:41 +01:00
Chaosvex
9df9f59866 Rename unit tests 2024-08-27 14:20:07 +01:00
Chaosvex
9bc3e4b91a Add compile-time support for optimised buffer resizing 2024-08-25 17:43:13 +01:00
Chaosvex
95bcf9790c
Add StaticBuffer type (#39)
- Few other fixes/changes at the same time
2024-07-17 18:35:43 +01:00
Chaosvex
4a38167daa Add unit tests for span & find_first_of 2024-07-17 08:08:50 +01:00
Chaosvex
e253c54bd3
Reorganise buffers structure/namespacing (#38) 2024-07-16 18:48:43 +01:00
Chaosvex
64ca24bd2b Add empty() BufferAdaptor unit test 2024-07-04 23:45:25 +01:00
Chaosvex
f9f03240a9 Add unit tests for BufferAdaptor (v1) 2024-07-04 00:19:38 +01:00