metadata 0.2.0
Modern C++23 header-only metadata container (JSON-like)
Loading...
Searching...
No Matches
parcel.hpp File Reference

Optional cpp-parcel adapter. More...

#include <commons/color.hpp>
#include <commons/icons.hpp>
#include <md/json.hpp>
#include <md/object.hpp>
#include <md/ostream.hpp>
#include <md/value.hpp>
#include <memory>
#include <sstream>
#include <string>
#include <string_view>
#include <parcel/parcel.h>
Include dependency graph for parcel.hpp:

Go to the source code of this file.

Classes

class  md::ValueCell
 Parcel cell wrapping an md::Value. More...
 
class  md::ObjectCell
 Parcel cell wrapping an md::Object (a.k.a. More...
 
class  md::ArrayCell
 Parcel cell wrapping an md::Array (std::vector<md::Value>). More...
 

Functions

void md::register_cells (parcel::ParcelRegistry &registry)
 Register all three md cells (md:v, md:o, md:a) on registry.
 

Detailed Description

Optional cpp-parcel adapter.

Wraps md::Value, md::Object, and md::Array as primitive-style parcel::BaseCell types so they round-trip through a parcel::ParcelRegistry like any other cell.

Wire kinds:

This header is auto-included from <md/metadata.hpp> when <parcel/parcel.h> is on the include path. Including it directly when cpp-parcel (or the nlohmann/json adapter it builds on) is unavailable will fail at the #include line below — match the <md/json.hpp> gating style.

Function Documentation

◆ register_cells()

void md::register_cells ( parcel::ParcelRegistry &  registry)
inline

Register all three md cells (md:v, md:o, md:a) on registry.

Equivalent to three separate register_kind(...) calls — the one-liner every consumer otherwise has to repeat. Re-registering a kind on an existing registry is a parcel-level error, so call this exactly once per registry.