Commit Graph

4 Commits

Author SHA1 Message Date
Wyatt Hepler
289046011c pw_kvs: AlignedWriter read-and-write function
Define AlignedWriter::Write overload that reads into the internal buffer
from an Input and writes it aligned to the output.

Change-Id: I72c1dead8cdcb912bf44fd1e36940cdb741f92df
2020-03-10 20:34:40 +00:00
Wyatt Hepler
f707880fbe pw_status: StatusWithSize constants
- Provide StatusWithSize constants that can be used similarly to
  Status::Codes. For example, StatusWithSize::DATA_LOSS constructs a
  StatusWithSize with status DATA_LOSS and size 0.
- Remove the default constructor argument for the size. Use the
  constants instead.
- Update uses of StatusWithSize(Status::X) to use StatusWithSize::X.

Change-Id: I901b7bb0bbbb4fde52f6b3acc3047f366b250515
2020-02-25 13:50:41 -08:00
Wyatt Hepler
50f70779c8 Remove StatusWithSize implicit conversions
- Disallow implicit conversions between Status and StatusWithSize, which
  can be problematic.
- Add TRY_WITH_SIZE to pw_kvs to handle returning StatusWithSize from
  functions.
- Make zero the default size argument for StatusWithSize.
- Expand tests for StatusWithSize.

Change-Id: Ia1c36e5a39402a50138d93e89afbaa5e772adb8a
2020-02-14 17:59:00 +00:00
Wyatt Hepler
4da1fcb4b2 pw_kvs: Initial commit of new KVS design
Builds, but lots more work needed.

Fun fact: this code was written collaboratively in a Google Doc.

Change-Id: I8a89c5d0fdc71ec28cf432350e65d17e24a6f25c
2020-01-31 14:38:37 -08:00