Home
Pacm module

Package

JSON-backed package metadata shared by local and remote package records.

Package

#include <icy/pacm/package.h>
struct Package

Defined in src/pacm/include/icy/pacm/package.h:26

Inherits: Value Subclassed by: LocalPackage, RemotePackage

JSON-backed package metadata shared by local and remote package records.

List of all members

NameKindOwner
PackagefunctionDeclared here
PackagefunctionDeclared here
~PackagefunctionDeclared here
idfunctionDeclared here
namefunctionDeclared here
typefunctionDeclared here
authorfunctionDeclared here
descriptionfunctionDeclared here
hasExtensionfunctionDeclared here
extensionfunctionDeclared here
validfunctionDeclared here
toJsonfunctionDeclared here
printfunctionDeclared here

Public Methods

ReturnNameDescription
PackageConstructs an empty package.
PackageConstructs a package from an existing JSON value.
std::stringid virtual constReturns the package unique identifier.
std::stringname virtual constReturns the package display name.
std::stringtype virtual constReturns the package type (e.g. "plugin", "asset").
std::stringauthor virtual constReturns the package author string.
std::stringdescription virtual constReturns the package description string.
boolhasExtension virtual constReturns true when the package has an "extension" object.
Extensionextension virtual constReturns a read-only view of the extension metadata. Throws if no extension object is present.
boolvalid virtual constReturns true if id, name and type are all non-empty.
json::ValuetoJson virtual constReturns a plain JSON copy of this package object.
voidprint virtual constDumps the JSON representation of this package to ost.

Package

Package()

Defined in src/pacm/include/icy/pacm/package.h:105

Constructs an empty package.


Package

Package(const json::Value & src)

Defined in src/pacm/include/icy/pacm/package.h:109

Constructs a package from an existing JSON value.

Parameters

  • src JSON object containing package fields.

id

virtual const

virtual std::string id() const

Defined in src/pacm/include/icy/pacm/package.h:113

Returns the package unique identifier.


name

virtual const

virtual std::string name() const

Defined in src/pacm/include/icy/pacm/package.h:116

Returns the package display name.


type

virtual const

virtual std::string type() const

Defined in src/pacm/include/icy/pacm/package.h:119

Returns the package type (e.g. "plugin", "asset").


author

virtual const

virtual std::string author() const

Defined in src/pacm/include/icy/pacm/package.h:122

Returns the package author string.


description

virtual const

virtual std::string description() const

Defined in src/pacm/include/icy/pacm/package.h:125

Returns the package description string.


hasExtension

virtual const

virtual bool hasExtension() const

Defined in src/pacm/include/icy/pacm/package.h:128

Returns true when the package has an "extension" object.


extension

virtual const

virtual Extension extension() const

Defined in src/pacm/include/icy/pacm/package.h:132

Returns a read-only view of the extension metadata. Throws if no extension object is present.


valid

virtual const

virtual bool valid() const

Defined in src/pacm/include/icy/pacm/package.h:135

Returns true if id, name and type are all non-empty.

Reimplemented by

toJson

virtual const

virtual json::Value toJson() const

Defined in src/pacm/include/icy/pacm/package.h:138

Returns a plain JSON copy of this package object.


print

virtual const

virtual void print(std::ostream & ost) const

Defined in src/pacm/include/icy/pacm/package.h:142

Dumps the JSON representation of this package to ost.

Parameters

  • ost Output stream.