A reference to one component row, for a result that must name components it does not own. More...
#include <component.hpp>
Public Types | |
| enum class | Kind : std::uint8_t { file , dependency } |
Static Public Member Functions | |
| static ComponentRef | to_file (std::string path) |
| static ComponentRef | to_dependency (std::string id) |
Public Attributes | |
| Kind | kind = Kind::file |
| std::string | id |
| The files[] row's archive path, or the dependencies[] row's id. | |
Friends | |
| bool | operator== (const ComponentRef &, const ComponentRef &)=default |
| Ordered and compared by kind then identifier, so a list of these has a total order that does not depend on the order the rows were read. | |
| std::strong_ordering | operator<=> (const ComponentRef &, const ComponentRef &)=default |
A reference to one component row, for a result that must name components it does not own.
The two row kinds are identified in different namespaces: a files[] row by its archive path, a dependencies[] row by its content identity. A bare string cannot say which of the two a reader is holding, and a path-only list cannot name a dependency at all — which would make such a list structurally empty for a profile whose components are entirely dependencies. Carrying the kind alongside the identifier is what keeps the reference resolvable back to the row it came from.
|
strong |
|
inlinestaticnodiscard |
|
inlinestaticnodiscard |
|
friend |
|
friend |
Ordered and compared by kind then identifier, so a list of these has a total order that does not depend on the order the rows were read.
| std::string pulp::authoring_capsule::ComponentRef::id |
The files[] row's archive path, or the dependencies[] row's id.
| Kind pulp::authoring_capsule::ComponentRef::kind = Kind::file |