Pacm module

Package::Asset

Archive asset metadata for a specific package build.

Asset

#include <icy/pacm/package.h>

Archive asset metadata for a specific package build.

Public Attributes

ReturnNameDescription
json::Value &root

root

json::Value & root

Public Methods

ReturnNameDescription
Asset#### Parameters
AssetDefaulted constructor.
std::stringfileName virtual constReturns the archive file name (e.g. "my-plugin-1.0.0.zip").
std::stringversion virtual constReturns the package version string (e.g. "1.0.0").
std::stringsdkVersion virtual constReturns the SDK version this asset was built against (e.g. "2.0.0").
std::stringchecksum virtual constReturns the asset checksum string, or empty if none is set.
std::stringurl virtual constReturns the download URL from the mirror list at index.
intfileSize virtual constReturns the uncompressed file size in bytes, or 0 if not set.
boolvalid virtual constReturns true if the asset has the minimum required fields (file-name, version, mirrors).
voidprint virtual constWrites the raw JSON of this asset to ost.
Asset &operator= virtualCopies the backing JSON node from r.
booloperator== virtual constReturns true if file name, version and checksum all match r.

Asset

Asset(json::Value & src)

Parameters

  • src JSON object node that backs this asset.

Asset

Asset(const Asset &) = default

Defaulted constructor.


fileName

virtual const

virtual std::string fileName() const

Returns the archive file name (e.g. "my-plugin-1.0.0.zip").


version

virtual const

virtual std::string version() const

Returns the package version string (e.g. "1.0.0").


sdkVersion

virtual const

virtual std::string sdkVersion() const

Returns the SDK version this asset was built against (e.g. "2.0.0").


checksum

virtual const

virtual std::string checksum() const

Returns the asset checksum string, or empty if none is set.


url

virtual const

virtual std::string url(int index) const

Returns the download URL from the mirror list at index.

Parameters

  • index Zero-based index into the mirrors array.

fileSize

virtual const

virtual int fileSize() const

Returns the uncompressed file size in bytes, or 0 if not set.


valid

virtual const

virtual bool valid() const

Returns true if the asset has the minimum required fields (file-name, version, mirrors).


print

virtual const

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

Writes the raw JSON of this asset to ost.

Parameters

  • ost Output stream.

operator=

virtual

virtual Asset & operator=(const Asset & r)

Copies the backing JSON node from r.

Parameters

  • r Source asset to copy from.

operator==

virtual const

virtual bool operator==(const Asset & r) const

Returns true if file name, version and checksum all match r.