| commit | 52443c3f35ac5c32a16e2c649d2a2937cf2b0985 | [log] [tgz] |
|---|---|---|
| author | Marcin Kowalczyk <qrczak@google.com> | Mon Dec 22 22:30:18 2025 +0100 |
| committer | qrczak <qrczak@google.com> | Mon Dec 22 22:31:00 2025 +0100 |
| tree | 1432122d7d1386cff388081cb53e621a538ec503 | |
| parent | 3feaaab06e10ec58d51d557b7a9a9135a5945c8f [diff] |
Flip preferred names of reading/writing functions with explicit Endianness:
use `{Read,Write}{Little,Big}Endian{,s}<{u,}int{8,16,32,64}_t>()` etc., making
`{Read,Write}{Little,Big}Endian{,Signed}{16,32,64}{,s}()` etc. deprecated.
The latter names were original, but the former names are more clear, they make
it easier to write generic code, and there is no need to keep two variants.
Remove internal decoding/encoding functions, and inline their logic into
reading/writing functions. This was not done before because some compilers
generated poor code if decoding/encoding was applied to an external array as
opposed to a local variable. To be sure that this does not happen, and to make
the life of the compiler easier, use `memcpy()` instead of bit operations when
Endianness matches.
Reorder definitions: put `char*` before `Reader` / `Writer` / `BackwardWriter`,
and put scalar and array `Writer` functions together. The `char*` functions
must be defined before they are called from other functions (these template
specializations do not have individual forward declarations, a forward
declaration of the primary template is not enough), and also `char*` functions
are used as building blocks of various decoding/encoding functions of headers
etc.
PiperOrigin-RevId: 847867537
Riegeli/records is a file format for storing a sequence of string records, typically serialized protocol buffers. It supports dense compression, fast decoding, seeking, detection and optional skipping of data corruption, filtering of proto message fields for even faster decoding, and parallel encoding.
See documentation.
Riegeli file format will only change in a backward compatible way (i.e. future readers will understand current files, but current readers might not understand files using future features).
Riegeli C++ API might change in incompatible ways.