Flox Package Database 1
CRUD Operations on Nix Package Metadata
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
flox::RawPackage Class Reference

The simplest ‘Package’ implementation comprised of raw values. More...

#include <raw-package.hh>

Inheritance diagram for flox::RawPackage:
flox::Package flox::pkgdb::DbPackage

Public Member Functions

 RawPackage (const AttrPath &path={}, std::string_view name={}, std::string_view pname={}, std::optional< std::string > version=std::nullopt, std::optional< std::string > semver=std::nullopt, std::optional< std::string > license=std::nullopt, const std::vector< std::string > &outputs={ "out" }, const std::vector< std::string > &outputsToInstall={ "out" }, std::optional< bool > broken=std::nullopt, std::optional< bool > unfree=std::nullopt, std::optional< std::string > description=std::nullopt)
 
AttrPath getPathStrs () const override
 
std::string getFullName () const override
 
std::string getPname () const override
 
std::optional< std::string > getVersion () const override
 
std::optional< std::string > getSemver () const override
 
std::optional< std::string > getLicense () const override
 
std::vector< std::string > getOutputs () const override
 
std::vector< std::string > getOutputsToInstall () const override
 
std::optional< bool > isBroken () const override
 
std::optional< bool > isUnfree () const override
 
std::optional< std::string > getDescription () const override
 
- Public Member Functions inherited from flox::Package
 Package (const Package &)=default
 
 Package (Package &&)=default
 
Packageoperator= (const Package &)=default
 
Packageoperator= (Package &&)=default
 
virtual AttrPath getPathStrs () const =0
 
virtual std::string getFullName () const =0
 
virtual std::string getPname () const =0
 
virtual std::optional< std::string > getVersion () const =0
 
virtual std::optional< std::string > getLicense () const =0
 
virtual std::vector< std::string > getOutputs () const =0
 
virtual std::vector< std::string > getOutputsToInstall () const =0
 
virtual std::optional< bool > isBroken () const =0
 
virtual std::optional< bool > isUnfree () const =0
 
virtual std::optional< std::string > getDescription () const =0
 
virtual Subtree getSubtreeType () const
 
virtual nix::DrvName getParsedDrvName () const
 
virtual std::optional< std::string > getSemver () const
 
virtual std::string toURIString (const nix::FlakeRef &ref) const
 Create an installable URI string associated with this package using ref as its input part.
 
virtual nlohmann::json getInfo (bool withDescription=false) const
 Serialize notable package metadata as a JSON object.
 

Public Attributes

AttrPath path
 
std::string name
 
std::string pname
 
std::optional< std::string > version
 
std::optional< std::string > semver
 
std::optional< std::string > license
 
std::vector< std::string > outputs
 
std::vector< std::string > outputsToInstall
 
std::optional< bool > broken
 
std::optional< bool > unfree
 
std::optional< std::string > description
 

Detailed Description

The simplest ‘Package’ implementation comprised of raw values.

This form largely exists for testing purposes.

Member Function Documentation

◆ getDescription()

std::optional< std::string > flox::RawPackage::getDescription ( ) const
inlineoverridevirtual
Returns
The meta.description field if defined, otherwise std::nullopt.

Implements flox::Package.

◆ getFullName()

std::string flox::RawPackage::getFullName ( ) const
inlineoverridevirtual
Returns
the derivation name field.

Implements flox::Package.

◆ getLicense()

std::optional< std::string > flox::RawPackage::getLicense ( ) const
inlineoverridevirtual
Returns
The meta.license.spdxId field if defined, otherwise std::nullopt

Implements flox::Package.

◆ getOutputs()

std::vector< std::string > flox::RawPackage::getOutputs ( ) const
inlineoverridevirtual
Returns
The derivation outputs list.

Implements flox::Package.

◆ getOutputsToInstall()

std::vector< std::string > flox::RawPackage::getOutputsToInstall ( ) const
inlineoverridevirtual
Returns
The meta.outputsToInstall field if defined, otherwise the derivation outputs members to the left of and including out.

Implements flox::Package.

◆ getPathStrs()

AttrPath flox::RawPackage::getPathStrs ( ) const
inlineoverridevirtual
Returns
attribute path where package is defined

Implements flox::Package.

◆ getPname()

std::string flox::RawPackage::getPname ( ) const
inlineoverridevirtual
Returns
iff the field pname is defined then pname, otherwise the name field stripped of is version part as recognized by nix::DrvName parsing rules.

Implements flox::Package.

◆ getSemver()

std::optional< std::string > flox::RawPackage::getSemver ( ) const
inlineoverridevirtual
Returns
std::nullopt iff this package does not use semantic versioning, otherwise a normalized semantic version number coerces from this package's version information.

Reimplemented from flox::Package.

◆ getVersion()

std::optional< std::string > flox::RawPackage::getVersion ( ) const
inlineoverridevirtual
Returns
iff the field version is defined then version, otherwise the name field stripped of is pname part as recognized by nix::DrvName parsing rules. If version is undefined and name contains no version suffix, then std::nullopt.

Implements flox::Package.

◆ isBroken()

std::optional< bool > flox::RawPackage::isBroken ( ) const
inlineoverridevirtual
Returns
The meta.broken field if defined, otherwise std::nullopt.

Implements flox::Package.

◆ isUnfree()

std::optional< bool > flox::RawPackage::isUnfree ( ) const
inlineoverridevirtual
Returns
The meta.unfree field if defined, otherwise std::nullopt.

Implements flox::Package.


The documentation for this class was generated from the following file: