Commit Graph

5 Commits

Author SHA1 Message Date
shaneajg
5c15f0db3c pw_bytes: Added iterator value-retrieval methods
Added 'peek' and 'read' functionality that enables ordered retreival
(Little/Big Endian) of the inserted integer values, and adjusts the
position of the iterator accordingly.

Change-Id: I418f7bd3ed5a1b627a80a0eaa190c2d26fed032c
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/12960
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Shane Gomindes <shaneajg@google.com>
2020-06-29 16:24:03 +00:00
Wyatt Hepler
0158ad731e pw_bytes: ByteSpan and ConstByteSpan aliases
- Introduce ByteSpan and ConstByteSpan aliases for std::span<std::byte>
  and std::span<const std::byte>.
- Use the new aliases in pw_bytes/byte_builder.h.

Change-Id: Ifaf5e19c9b34cf7874b366300aa1e582ae1e5587
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/12944
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-06-26 22:08:39 +00:00
shaneajg
9fe4cec6f2 pw_bytes: Added an iterator class
Added an iterator class to the ByteBuilder class with functionality
based on C++'s Random access iterator that allows access to the
elements in the buffer.

Change-Id: I3d4c1de916137bb515635fab575b29efc4a8855f
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/12802
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Shane Gomindes <shaneajg@google.com>
2020-06-24 21:05:45 +00:00
shaneajg
3181d18e36 pw_bytes: Added an ordered put method for values
Added functionality to insert values to the buffer in the endianness
order as specified by the user.

Change-Id: Ie33ac7a38a35cdd1cfdb2952233d13f09242cc8c
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/12472
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Shane Gomindes <shaneajg@google.com>
2020-06-19 21:01:52 +00:00
shaneajg
9c19db4e78 pw_bytes: Module for bytes manipulation.
Added a ByteBuffer module which contains a collection of utilities for
manipulating binary data.

Change-Id: Ia071c3e68a1ada63232fcb56f3d2d8171bac0778
2020-06-16 22:29:31 +00:00