Package::Asset
Asset
#include <icy/pacm/package.h>Archive asset metadata for a specific package build.
Public Attributes
| Return | Name | Description |
|---|---|---|
json::Value & | root |
root
json::Value & rootPublic Methods
| Return | Name | Description |
|---|---|---|
Asset | #### Parameters | |
Asset | Defaulted constructor. | |
std::string | fileName virtual const | Returns the archive file name (e.g. "my-plugin-1.0.0.zip"). |
std::string | version virtual const | Returns the package version string (e.g. "1.0.0"). |
std::string | sdkVersion virtual const | Returns the SDK version this asset was built against (e.g. "2.0.0"). |
std::string | checksum virtual const | Returns the asset checksum string, or empty if none is set. |
std::string | url virtual const | Returns the download URL from the mirror list at index. |
int | fileSize virtual const | Returns the uncompressed file size in bytes, or 0 if not set. |
bool | valid virtual const | Returns true if the asset has the minimum required fields (file-name, version, mirrors). |
void | print virtual const | Writes the raw JSON of this asset to ost. |
Asset & | operator= virtual | Copies the backing JSON node from r. |
bool | operator== virtual const | Returns true if file name, version and checksum all match r. |
Asset
Asset(json::Value & src)Parameters
srcJSON object node that backs this asset.
Asset
Asset(const Asset &) = defaultDefaulted constructor.
fileName
virtual const
virtual std::string fileName() constReturns the archive file name (e.g. "my-plugin-1.0.0.zip").
version
virtual const
virtual std::string version() constReturns the package version string (e.g. "1.0.0").
sdkVersion
virtual const
virtual std::string sdkVersion() constReturns the SDK version this asset was built against (e.g. "2.0.0").
checksum
virtual const
virtual std::string checksum() constReturns the asset checksum string, or empty if none is set.
url
virtual const
virtual std::string url(int index) constReturns the download URL from the mirror list at index.
Parameters
indexZero-based index into the mirrors array.
fileSize
virtual const
virtual int fileSize() constReturns the uncompressed file size in bytes, or 0 if not set.
valid
virtual const
virtual bool valid() constReturns true if the asset has the minimum required fields (file-name, version, mirrors).
virtual const
virtual void print(std::ostream & ost) constWrites the raw JSON of this asset to ost.
Parameters
ostOutput stream.
operator=
virtual
virtual Asset & operator=(const Asset & r)Copies the backing JSON node from r.
Parameters
rSource asset to copy from.
operator==
virtual const
virtual bool operator==(const Asset & r) constReturns true if file name, version and checksum all match r.
