Home
Pacm module

LocalPackage

Package metadata for an installed package on the local filesystem.

LocalPackage

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

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

Inherits: Package

Package metadata for an installed package on the local filesystem.

List of all members

NameKindOwner
LocalPackagefunctionDeclared here
LocalPackagefunctionDeclared here
LocalPackagefunctionDeclared here
~LocalPackagefunctionDeclared here
setStatefunctionDeclared here
setInstallStatefunctionDeclared here
setInstallDirfunctionDeclared here
setInstalledAssetfunctionDeclared here
setVersionfunctionDeclared here
setVersionLockfunctionDeclared here
setSDKVersionLockfunctionDeclared here
versionfunctionDeclared here
statefunctionDeclared here
installStatefunctionDeclared here
installDirfunctionDeclared here
versionLockfunctionDeclared here
sdkLockedVersionfunctionDeclared here
assetfunctionDeclared here
isInstalledfunctionDeclared here
isFailedfunctionDeclared here
manifestfunctionDeclared here
verifyInstallManifestfunctionDeclared here
getInstalledFilePathfunctionDeclared here
extensionEntryPointPathfunctionDeclared here
errorsfunctionDeclared here
addErrorfunctionDeclared here
lastErrorfunctionDeclared here
clearErrorsfunctionDeclared here
validfunctionDeclared here
PackagefunctionInherited from Package
PackagefunctionInherited from Package
~PackagefunctionInherited from Package
idfunctionInherited from Package
namefunctionInherited from Package
typefunctionInherited from Package
authorfunctionInherited from Package
descriptionfunctionInherited from Package
hasExtensionfunctionInherited from Package
extensionfunctionInherited from Package
validfunctionInherited from Package
toJsonfunctionInherited from Package
printfunctionInherited from Package

Inherited from Package

KindNameDescription
functionPackageConstructs an empty package.
functionPackageConstructs a package from an existing JSON value.
function~Package virtual noexcept
functionid virtual constReturns the package unique identifier.
functionname virtual constReturns the package display name.
functiontype virtual constReturns the package type (e.g. "plugin", "asset").
functionauthor virtual constReturns the package author string.
functiondescription virtual constReturns the package description string.
functionhasExtension virtual constReturns true when the package has an "extension" object.
functionextension virtual constReturns a read-only view of the extension metadata. Throws if no extension object is present.
functionvalid virtual constReturns true if id, name and type are all non-empty.
functiontoJson virtual constReturns a plain JSON copy of this package object.
functionprint virtual constDumps the JSON representation of this package to ost.

Public Methods

ReturnNameDescription
LocalPackageConstructs an empty local package.
LocalPackageConstructs a local package from an existing JSON value.
LocalPackageCreate the local package from the remote package reference with the following manipulations. 1) Add a local manifest element. 2) Remove asset mirror elements.
voidsetState virtualSet'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.
voidsetInstallState virtualSet's the package installation state. See InstallationState for possible values.
voidsetInstallDir virtualSet's the installation directory for this package.
voidsetInstalledAsset virtualSets the installed asset, once installed. This method also sets the version.
voidsetVersion virtualSets the current version of the local package. Installation must be complete.
voidsetVersionLock virtualLocks 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.
voidsetSDKVersionLock virtualLocks 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::stringversion virtual constReturns the installed package version.
std::stringstate virtual constReturns the current state of this package.
std::stringinstallState virtual constReturns the installation state of this package.
std::stringinstallDir virtual constReturns the installation directory for this package.
std::stringversionLock virtual constReturns the pinned version string, or empty if no lock is set.
std::stringsdkLockedVersion virtual constReturns the pinned SDK version string, or empty if no lock is set.
Assetasset virtualReturns the currently installed asset, if any. If none, the returned asset will be empty().
boolisInstalled virtual constReturns true or false depending on weather or not the package is installed successfully. False if package is in Failed state.
boolisFailed virtual constReturns true if the package state is "Failed".
Manifestmanifest virtualReturns the installation manifest.
boolverifyInstallManifest virtual
std::stringgetInstalledFilePath virtualReturns the full full path of the installed file. Thrown an exception if the install directory is unset.
std::stringextensionEntryPointPath virtual constReturns the install-relative extension entrypoint resolved against installDir(). Returns an empty string when no extension metadata is present.
json::Value &errors virtualReturns a reference to the JSON array of accumulated error messages.
voidaddError virtualAppends message to the errors array.
std::stringlastError virtual constReturns the most recently added error message, or empty if none.
voidclearErrors virtualClears all recorded error messages.
boolvalid virtual constReturns true if id, name and type are all non-empty.

LocalPackage

LocalPackage()

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

Constructs an empty local package.


LocalPackage

LocalPackage(const json::Value & src)

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

Constructs a local package from an existing JSON value.

Parameters

  • src JSON object containing local package fields.

LocalPackage

LocalPackage(const RemotePackage & src)

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

Create the local package from the remote package reference with the following manipulations. 1) Add a local manifest element. 2) Remove asset mirror elements.


setState

virtual

virtual void setState(const std::string & state)

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

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.


setInstallState

virtual

virtual void setInstallState(const std::string & state)

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

Set's the package installation state. See InstallationState for possible values.


setInstallDir

virtual

virtual void setInstallDir(const std::string & dir)

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

Set's the installation directory for this package.


setInstalledAsset

virtual

virtual void setInstalledAsset(const Package::Asset & installedRemoteAsset)

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

Sets the installed asset, once installed. This method also sets the version.


setVersion

virtual

virtual void setVersion(const std::string & version)

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

Sets the current version of the local package. Installation must be complete.


setVersionLock

virtual

virtual void setVersionLock(const std::string & version)

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

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.


setSDKVersionLock

virtual

virtual void setSDKVersionLock(const std::string & version)

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

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.


version

virtual const

virtual std::string version() const

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

Returns the installed package version.


state

virtual const

virtual std::string state() const

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

Returns the current state of this package.


installState

virtual const

virtual std::string installState() const

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

Returns the installation state of this package.


installDir

virtual const

virtual std::string installDir() const

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

Returns the installation directory for this package.


versionLock

virtual const

virtual std::string versionLock() const

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

Returns the pinned version string, or empty if no lock is set.


sdkLockedVersion

virtual const

virtual std::string sdkLockedVersion() const

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

Returns the pinned SDK version string, or empty if no lock is set.


asset

virtual

virtual Asset asset()

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

Returns the currently installed asset, if any. If none, the returned asset will be empty().


isInstalled

virtual const

virtual bool isInstalled() const

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

Returns true or false depending on weather or not the package is installed successfully. False if package is in Failed state.


isFailed

virtual const

virtual bool isFailed() const

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

Returns true if the package state is "Failed".


manifest

virtual

virtual Manifest manifest()

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

Returns the installation manifest.


verifyInstallManifest

virtual

virtual bool verifyInstallManifest(bool allowEmpty = false)

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


getInstalledFilePath

virtual

virtual std::string getInstalledFilePath(const std::string & fileName, bool whiny = false)

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

Returns the full full path of the installed file. Thrown an exception if the install directory is unset.


extensionEntryPointPath

virtual const

virtual std::string extensionEntryPointPath(bool whiny = false) const

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

Returns the install-relative extension entrypoint resolved against installDir(). Returns an empty string when no extension metadata is present.


errors

virtual

virtual json::Value & errors()

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

Returns a reference to the JSON array of accumulated error messages.


addError

virtual

virtual void addError(const std::string & message)

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

Appends message to the errors array.

Parameters

  • message Error description to record.

lastError

virtual const

virtual std::string lastError() const

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

Returns the most recently added error message, or empty if none.


clearErrors

virtual

virtual void clearErrors()

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

Clears all recorded error messages.


valid

virtual const

virtual bool valid() const

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

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

Reimplements