#include <icy/pacm/package.h>Inherits:
Package
Package metadata for an installed package on the local filesystem.
| Return | Name | Description |
|---|---|---|
LocalPackage | Constructs an empty local package. | |
LocalPackage | Constructs a local package from an existing JSON value. | |
LocalPackage | Create the local package from the remote package reference with the following manipulations. 1) Add a local manifest element. 2) Remove asset mirror elements. | |
void | setState virtual | Set's the overall package state. Possible values are: Installing, Installed, Failed, Uninstalled. If the packages completes while still Installing, this means the package has yet to be finalized. |
void | setInstallState virtual | Set's the package installation state. See InstallationState for possible values. |
void | setInstallDir virtual | Set's the installation directory for this package. |
void | setInstalledAsset virtual | Sets the installed asset, once installed. This method also sets the version. |
void | setVersion virtual | Sets the current version of the local package. Installation must be complete. |
void | setVersionLock virtual | Locks the package at the given version. Once set this package will not be updated past the given version. Pass an empty string to remove the lock. |
void | setSDKVersionLock virtual | Locks the package at the given SDK version. Once set this package will only update to the most recent version with given SDK version. Pass an empty string to remove the lock. |
std::string | version virtual const | Returns the installed package version. |
std::string | state virtual const | Returns the current state of this package. |
std::string | installState virtual const | Returns the installation state of this package. |
std::string | installDir virtual const | Returns the installation directory for this package. |
std::string | versionLock virtual const | Returns the pinned version string, or empty if no lock is set. |
std::string | sdkLockedVersion virtual const | Returns the pinned SDK version string, or empty if no lock is set. |
Asset | asset virtual | Returns the currently installed asset, if any. If none, the returned asset will be empty(). |
bool | isInstalled virtual const | Returns true or false depending on weather or not the package is installed successfully. False if package is in Failed state. |
bool | isFailed virtual const | Returns true if the package state is "Failed". |
Manifest | manifest virtual | Returns the installation manifest. |
bool | verifyInstallManifest virtual | |
std::string | getInstalledFilePath virtual | Returns the full full path of the installed file. Thrown an exception if the install directory is unset. |
json::Value & | errors virtual | Returns a reference to the JSON array of accumulated error messages. |
void | addError virtual | Appends message to the errors array. |
std::string | lastError virtual const | Returns the most recently added error message, or empty if none. |
void | clearErrors virtual | Clears all recorded error messages. |
bool | valid virtual const | Returns true if id, name and type are all non-empty. |
LocalPackage()Constructs an empty local package.
LocalPackage(const json::Value & src)Constructs a local package from an existing JSON value.
src JSON object containing local package fields.LocalPackage(const RemotePackage & src)Create the local package from the remote package reference with the following manipulations. 1) Add a local manifest element. 2) Remove asset mirror elements.
virtual
virtual void setState(const std::string & state)Set's the overall package state. Possible values are: Installing, Installed, Failed, Uninstalled. If the packages completes while still Installing, this means the package has yet to be finalized.
virtual
virtual void setInstallState(const std::string & state)Set's the package installation state. See InstallationState for possible values.
virtual
virtual void setInstallDir(const std::string & dir)Set's the installation directory for this package.
virtual
virtual void setInstalledAsset(const Package::Asset & installedRemoteAsset)Sets the installed asset, once installed. This method also sets the version.
virtual
virtual void setVersion(const std::string & version)Sets the current version of the local package. Installation must be complete.
virtual
virtual void setVersionLock(const std::string & version)Locks the package at the given version. Once set this package will not be updated past the given version. Pass an empty string to remove the lock.
virtual
virtual void setSDKVersionLock(const std::string & version)Locks the package at the given SDK version. Once set this package will only update to the most recent version with given SDK version. Pass an empty string to remove the lock.
virtual const
virtual std::string version() constReturns the installed package version.
virtual const
virtual std::string state() constReturns the current state of this package.
virtual const
virtual std::string installState() constReturns the installation state of this package.
virtual const
virtual std::string installDir() constReturns the installation directory for this package.
virtual const
virtual std::string versionLock() constReturns the pinned version string, or empty if no lock is set.
virtual const
virtual std::string sdkLockedVersion() constReturns the pinned SDK version string, or empty if no lock is set.
virtual
virtual Asset asset()Returns the currently installed asset, if any. If none, the returned asset will be empty().
virtual const
virtual bool isInstalled() constReturns true or false depending on weather or not the package is installed successfully. False if package is in Failed state.
virtual const
virtual bool isFailed() constReturns true if the package state is "Failed".
virtual
virtual Manifest manifest()Returns the installation manifest.
virtual
virtual bool verifyInstallManifest(bool allowEmpty)virtual
virtual std::string getInstalledFilePath(const std::string & fileName, bool whiny)Returns the full full path of the installed file. Thrown an exception if the install directory is unset.
virtual
virtual json::Value & errors()Returns a reference to the JSON array of accumulated error messages.
virtual
virtual void addError(const std::string & message)Appends message to the errors array.
message Error description to record.virtual const
virtual std::string lastError() constReturns the most recently added error message, or empty if none.
virtual
virtual void clearErrors()Clears all recorded error messages.
virtual const
virtual bool valid() constReturns true if id, name and type are all non-empty.