mirror of
https://github.com/ceph/go-ceph
synced 2024-12-19 21:02:12 +00:00
e5d1a53060
Add SplitBuffer and SplitSparseBuffer functions for extracting a list of strings from a single buffer, typically returned in C code, from a single Go buffer. The SplitBuffer variant will return empty strings if multiple nulls are found in sequence, assuming that the C code packs data between on single null byte (expect the final byte). The SplitSparseBuffer variant assumes that the C code may not tightly pack the data with single null bytes and thus will not return any empty strings (unless the input buffer is empty or only contains nulls). Most of the code in the go-ceph codebase is doing the latter but probably should have been doing the former. Thus both approaches are provided. Signed-off-by: John Mulligan <jmulligan@redhat.com> |
||
---|---|---|
.. | ||
command_input_test.go | ||
command_input.go | ||
command_output_test.go | ||
command_output.go | ||
splitbuf_test.go | ||
splitbuf.go | ||
type_aliases.go |