|
parcel 0.2.2
Wrappable, wire-transferable C++23 value system with JSON serialization
|
Stream / byte-span JSON I/O for cells. More...
#include <parcel/cell.h>#include <parcel/error.h>#include <parcel/json.h>#include <parcel/registry.h>#include <cstddef>#include <span>#include <string>

Go to the source code of this file.
Functions | |
| cell_t | parcel::cell_from_stream (std::istream &is, ParcelRegistry const ®) |
Read one JSON document from is and dispatch via reg. | |
| cell_t | parcel::cell_from_bytes (const std::span< const std::byte > bytes, ParcelRegistry const ®) |
Read raw bytes as JSON and dispatch via reg. | |
| void | parcel::cell_to_stream (std::ostream &os, cell_t const &c, const int indent=-1) |
Render c as JSON onto os. | |
Stream / byte-span JSON I/O for cells.
Adds thin facades on top of ParcelRegistry::cell_from_json and ICell::to_json so callers don't have to do the std::string round-trip themselves. The non-throwing try_* overloads are wired in when <expected> is available.
|
inline |
Read raw bytes as JSON and dispatch via reg.
| bytes | UTF-8 JSON bytes. |
| reg | Registry used to resolve the kind. |
| std::runtime_error | on parse failure or shape/kind mismatch. |
|
inline |
Read one JSON document from is and dispatch via reg.
| is | Input stream — read to EOF as a single JSON value. |
| reg | Registry used to resolve the kind. |
| std::runtime_error | on parse failure or shape/kind mismatch. |
|
inline |
Render c as JSON onto os.
| os | Output stream. |
| c | Cell to dump (null → JSON null). |
| indent | -1 for compact (default); non-negative for pretty. |