|
parcel 0.2.2
Wrappable, wire-transferable C++23 value system with JSON serialization
|
std::generator-based walk over a cell tree.
More...
#include <parcel/cell.h>#include <parcel/list.h>#include <parcel/map.h>#include <parcel/struct.h>#include <parcel/union.h>#include <string>#include <utility>#include <vector>

Go to the source code of this file.
Classes | |
| struct | parcel::WalkEntry |
One node yielded by a tree walk: (json-pointer-path, cell). More... | |
Functions | |
| std::vector< WalkEntry > | parcel::walk_to_vector (cell_t const &root) |
Eagerly collect every cell in root's tree, depth-first. | |
std::generator-based walk over a cell tree.
Recurses into ListCell and MapCell depth-first, yielding each visited cell paired with a JSON-pointer-style path (RFC 6901, with ~ and / escaped to ~0 / ~1). Every other cell — including StructCell and UnionCell — is treated as a leaf.
Requires C++23 <generator>. When the standard header is unavailable (libc++ shipped with older Apple Clang, for example) this header exposes a fallback walk_to_vector that materializes the same nodes eagerly into a vector.
|
inline |
Eagerly collect every cell in root's tree, depth-first.
Independent of the <generator> header so it always compiles. Prefer walk (below) when targeting a toolchain with C++23 generator support.
| root | Root cell. |
(path, cell) entries.