3 Commits

Author SHA1 Message Date
Abtin Keshavarzian a83d90702f [test] address uninitialized reference use warning (#7459)
This commit addresses "uninitialized reference use" warning in
`test_data`.
2022-03-08 17:22:02 -08:00
Abtin Keshavarzian d14acd4324 [message] update Message::Chunk definitions to use Data (#7019)
This commit updates the `Message::Chunk` type to use `Data` as its
base class (thus inheriting the common helper methods from it) which
helps simplify its use. This commit also adds couple of new methods in
`Data` class (method `SetLength()` to  change the `Data` length, and
`MatchesBytesIn()` to compare the `Data` content with bytes from a
given buffer). The `test_data` unit test is also updated to check the
newly added `Data` methods.
2021-09-20 19:13:00 -07:00
Abtin Keshavarzian ca35753a1e [common] adding Data and MutableData (#6984)
This commit adds two new generic types `Data` and `MutableData` which
are simply wrappers over a pointer to a buffer and a given data
length. The data length can be either `uint8_t` or `uint16_t` which
is determined by a template parameter. The `Data` treats the content
of the buffer as immutable  whereas `MutableData` allows it to be
changed. This commit also adds a unit test `tes_data` to verify the
behavior of newly added types.
2021-09-16 14:50:23 -07:00