Commit graph

44 commits

Author SHA1 Message Date
Chaosvex
bb4e0ffb35
Clang Docker build (#202) 2026-03-12 15:04:55 +00:00
Chaosvex
63cb74c31b Add unit tests to cover new prefixing options 2026-02-27 01:55:36 +00:00
Chaosvex
303a2951e3 Update stream calls to take advantage of the updated API 2026-02-21 22:50:38 +00:00
Chaosvex
4c35ef6716 Replace sha256 magic number 2026-02-21 22:36:08 +00:00
Chaosvex
09559aaf44
Change enum casing across the whole project (#137) 2026-02-19 01:25:02 +00:00
Chaosvex
ed0a3aac84 Rename util namespace to utility 2026-02-18 21:38:07 +00:00
Chaosvex
9e14d7be4f Add additional temporary crappy polyfills for libc++ 2025-04-21 17:49:35 +01:00
Chaosvex
1413afd2ca Fix exception/error state when using StaticBuffer with BufferAdaptor
Caused by adding support for std::array. Previously, StaticBuffer was not compatible with BufferAdaptor since there's no reason to use them together.
2025-04-10 15:52:51 +01:00
Chaosvex
8b5d8b1c63
Bring Spark buffers up to date with Hexi version (#67) 2025-04-04 21:30:52 +01:00
Chaosvex
8b8f3d5b52 Fix unit test 2025-04-03 18:47:27 +01:00
Chaosvex
d4a24ce929 Set stream error state on buffer write failure even when exceptions are allowed 2025-04-03 16:53:55 +01:00
Chaosvex
9cc5210f66 Add support for writing to std::array with BufferAdaptor 2025-04-03 16:36:27 +01:00
Chaosvex
cfa2a354a1 Improve ergonomics of using spark::io::no_throw by aiding deduction 2025-03-31 13:48:46 +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
fe5530eb5a Add const & non-const overloads for consistency 2025-03-26 11:48:26 +00:00
Chaosvex
59f4339ce0 Add unit tests for BinaryStream::set_error_state() 2025-03-24 11:55:56 +00:00
Chaosvex
9591eb4849 Replace iterator loops with ranged for 2025-03-19 06:29:46 +00:00
Chaosvex
f715224204 Add initial unit tests for BinaryStream / FileBuffer combo 2025-03-18 09:00:23 +00:00
Chaosvex
97d389920b Replace ::value with _v alternatives 2025-03-09 23:40:30 +00:00
Chaosvex
355e3b3475 Prune IO headers 2025-03-09 00:24:00 +00:00
Chaosvex
b4677d297b Update GSL to 4.1.0 2025-02-06 16:32:42 +00:00
Chaosvex
482fdafc47 util -> utility 2024-12-30 23:45:04 +00:00
Chaosvex
d0f7b641ec Using namespace in unit tests
Minor consistency nitpick
2024-12-24 01:15:35 +00:00
Chaosvex
1d81769522 Assert vector is not empty before writing to it (unit test) 2024-11-27 23:45:49 +00:00
Chaosvex
adece9c0ef Replace iota/shuffle with ranges equivalent 2024-09-28 19:40:28 +01:00
Chaosvex
70e1a804ad
Introduce ranges (#52)
Convert some algorithms to ranges
2024-09-10 00:11:41 +01:00
Chaosvex
729f71b7bd Make no throw stream a little more explicit 2024-09-08 07:15:15 +01:00
Chaosvex
9df9f59866 Rename unit tests 2024-08-27 14:20:07 +01:00
Chaosvex
ecd7e6c4af Unit test literal integral put() 2024-08-27 14:17:00 +01:00
Chaosvex
5b241e7f8b Fix test name 2024-07-16 20:19:06 +01:00
Chaosvex
6a47e79fce Add basic unit test to cover array read/write 2024-07-16 20:17:50 +01:00
Chaosvex
e253c54bd3
Reorganise buffers structure/namespacing (#38) 2024-07-16 18:48:43 +01:00
Chaosvex
77ce4b7fc9 Improve behaviour of string streaming
- Writing char* will now include a terminator
- If a terminator is not found, string/string_view will no longer read up to the end of the buffer but will instead empty the argument
2024-07-16 10:41:17 +01:00
Chaosvex
fc527cebbd Add basic TLSBlockAllocator unit tests 2024-07-10 03:51:19 +01:00
Chaosvex
9a7fb1664e Add unit tests for BinaryStream v2
Copied from v1 tests, code is not shared
2024-05-21 00:11:18 +01:00
Chaosvex
26aef6139b Add basic unit test for stream fill & fix total write 2024-05-20 00:43:14 +01:00
Chaosvex
025563a384 Use new BinaryStream in gateway
No more virtual calls
2024-02-25 03:59:32 +00:00
Chaosvex
58aa0bea91 Normalise all line endings 2024-02-25 00:07:54 +00:00
Chaosvex
05583fe4ac Refactoring Spark buffers 2021-05-21 03:21:44 +01:00
Chaosvex
d80642ba8b Change buffer names 2020-05-08 14:49:18 +00:00
Chaosvex
22268deaa7 Add basic unit tests for BinaryStream class
Fixed a bug in FNVHash too
2018-04-14 00:56:48 +01:00
Chaosvex
ddb77faeba Move Buffer.h to buffers directory 2018-04-08 18:53:29 +01:00
Chaosvex
b96de66763 Rename BufferChain to ChainedBuffer 2015-11-14 08:10:51 +00:00
Chaosvex
33787b728d Refactoring underway 2015-10-26 14:14:42 +00:00