parcel 0.2.2
Wrappable, wire-transferable C++23 value system with JSON serialization
Loading...
Searching...
No Matches
commons.h File Reference

Parcel cell adapters for the aurimasniekis/cpp-commons vocabulary types. More...

#include <parcel/cell.h>
#include <parcel/defaults.h>
#include <parcel/descriptor.h>
#include <parcel/json.h>
#include <commons/color.hpp>
#include <commons/display_info.hpp>
#include <commons/flag.hpp>
#include <commons/icon.hpp>
#include <commons/json.hpp>
#include <commons/origin.hpp>
#include <commons/semver.hpp>
#include <commons/version_constraint.hpp>
#include <compare>
#include <memory>
#include <optional>
#include <string>
#include <string_view>
Include dependency graph for commons.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  parcel::ColorCell
 Cell wrapping comms::Color. More...
 
class  parcel::IconCell
 Cell wrapping comms::Icon. More...
 
class  parcel::DisplayInfoCell
 Cell wrapping comms::DisplayInfo. More...
 
class  parcel::FlagCell
 Cell wrapping comms::FlagRef. More...
 
class  parcel::FlagSetCell
 Cell wrapping comms::FlagSet. More...
 
class  parcel::SemVerCell
 Cell wrapping comms::SemVer. More...
 
class  parcel::VersionConstraintCell
 Cell wrapping comms::VersionConstraint. More...
 
class  parcel::OriginCell
 Cell wrapping comms::OriginPtr (a std::unique_ptr<comms::IOrigin>). More...
 

Detailed Description

Parcel cell adapters for the aurimasniekis/cpp-commons vocabulary types.

Carries commons' Color, Icon, DisplayInfo, flag, and versioning / provenance types on the wire:

  • ColorCellcomms::Color"color" (hex string).
  • IconCellcomms::Icon"icon" ("set:name" string).
  • DisplayInfoCellcomms::DisplayInfo"display_info" (JSON object).
  • FlagCellcomms::FlagRef"flag" (flag name string).
  • FlagSetCellcomms::FlagSet"flag_set" (array of names).
  • SemVerCellcomms::SemVer"semver" (version string).
  • VersionConstraintCellcomms::VersionConstraint"version_constraint" (range string).
  • OriginCellcomms::OriginPtr"origin" ({"kind",…} object).

Each cell reuses commons' ADL to_json / from_json (from commons/json.hpp, auto-enabled because nlohmann/json is on the include path), so the inherited BaseCell::to_json / cell_from_json just work — only to_string, kind_id, from_json, and descriptor() are defined here, following the ext/filesystem.h PathCell pattern.

Decoding a FlagCell / FlagSetCell resolves each flag name against comms::GlobalFlagRegistry; an unregistered name throws (commons behavior).