pacm
May 15, 2026 ยท View on GitHub
{#pacmmodule}
pacm
Package manager for distributing and installing packaged extensions and assets.
Namespaces
| Name | Description |
|---|---|
pacm | Package manifests, install tasks, and repository management helpers. |
{#pacm}
pacm
Package manifests, install tasks, and repository management helpers.
Classes
| Name | Description |
|---|---|
InstallMonitor | Aggregates multiple install tasks and reports overall progress. |
InstallTask | Downloads, extracts, and finalizes a single package installation. |
PackageManager | Loads package manifests and coordinates install, update, and uninstall workflows. |
InstallationState | State machine states for package installation. |
InstallOptions | Package installation options. |
LocalPackage | Package metadata for an installed package on the local filesystem. |
Package | JSON-backed package metadata shared by local and remote package records. |
PackagePair | Pairing of the installed and remote metadata for the same package ID. |
RemotePackage | Package metadata loaded from the remote package index. |
Typedefs
| Return | Name | Description |
|---|---|---|
std::vector< LocalPackage * > | LocalPackageVec | Vector of local package pointers used by install monitor progress snapshots. |
std::vector< InstallTask * > | InstallTaskVec | Vector of raw install task pointers used for transient iteration. |
std::vector< InstallTask::Ptr > | InstallTaskPtrVec | Vector of shared install task handles retained across async workflows. |
std::vector< PackagePair > | PackagePairVec | Vector of local/remote package pairs used for reconciliation and update checks. |
KeyedStore< std::string, LocalPackage > | LocalPackageStore | Keyed store of installed packages indexed by package ID. |
KeyedStore< std::string, RemotePackage > | RemotePackageStore | Keyed store of remote package metadata indexed by package ID. |
{#localpackagevec}
LocalPackageVec
using LocalPackageVec = std::vector< LocalPackage * >
Vector of local package pointers used by install monitor progress snapshots.
{#installtaskvec}
InstallTaskVec
using InstallTaskVec = std::vector< InstallTask * >
Vector of raw install task pointers used for transient iteration.
{#installtaskptrvec}
InstallTaskPtrVec
using InstallTaskPtrVec = std::vector< InstallTask::Ptr >
Vector of shared install task handles retained across async workflows.
{#packagepairvec}
PackagePairVec
using PackagePairVec = std::vector< PackagePair >
Vector of local/remote package pairs used for reconciliation and update checks.
{#localpackagestore}
LocalPackageStore
using LocalPackageStore = KeyedStore< std::string, LocalPackage >
Keyed store of installed packages indexed by package ID.
{#remotepackagestore}
RemotePackageStore
using RemotePackageStore = KeyedStore< std::string, RemotePackage >
Keyed store of remote package metadata indexed by package ID.
Functions
| Return | Name | Description |
|---|---|---|
std::string | getInstallTaskNamesString inline | Returns a comma-delimited string of display names from packages. |
void | validatePathComponent inline | Validates that a string is safe to use as a path component. Rejects path traversal sequences (..), directory separators (/ and ), null bytes, and empty strings. |
{#getinstalltasknamesstring}
getInstallTaskNamesString
inline
inline std::string getInstallTaskNamesString(LocalPackageVec & packages)
Returns a comma-delimited string of display names from packages.
Parameters
packagesVector of LocalPackage pointers to format.
Returns
Comma-separated name string, e.g. "PluginA, PluginB".
{#validatepathcomponent}
validatePathComponent
inline
inline void validatePathComponent(std::string_view name, std::string_view context)
Validates that a string is safe to use as a path component. Rejects path traversal sequences (..), directory separators (/ and ), null bytes, and empty strings.
Parameters
-
nameThe path component to validate. -
contextCaller description included in the exception message.
Exceptions
std::invalid_argumentifnamefails any validation check.
{#installmonitor}
InstallMonitor
#include <icy/pacm/installmonitor.h>
class InstallMonitor
Defined in src/pacm/include/icy/pacm/installmonitor.h:27
Aggregates multiple install tasks and reports overall progress.
List of all members
| Name | Kind | Owner |
|---|---|---|
InstallStateChange | variable | Declared here |
InstallComplete | variable | Declared here |
Progress | variable | Declared here |
Complete | variable | Declared here |
InstallMonitor | function | Declared here |
InstallMonitor | function | Declared here |
InstallMonitor | function | Declared here |
addTask | function | Declared here |
startAll | function | Declared here |
cancelAll | function | Declared here |
isComplete | function | Declared here |
tasks | function | Declared here |
packages | function | Declared here |
_mutex | variable | Declared here |
_tasks | variable | Declared here |
_packages | variable | Declared here |
_progress | variable | Declared here |
onInstallStateChange | function | Declared here |
onInstallComplete | function | Declared here |
setProgress | function | Declared here |
Public Attributes
| Return | Name | Description |
|---|---|---|
ThreadSignal< void(InstallTask &, const InstallationState &, const InstallationState &)> | InstallStateChange | Proxies state change events from managed packages. |
ThreadSignal< void(LocalPackage &)> | InstallComplete | Signals when a managed install task completes. |
ThreadSignal< void(int &)> | Progress | Signals on overall progress update [0-100]. |
ThreadSignal< void(LocalPackageVec &)> | Complete | Signals on all tasks complete. |
{#installstatechange}
InstallStateChange
ThreadSignal< void(InstallTask &, const InstallationState &, const InstallationState &)> InstallStateChange
Defined in src/pacm/include/icy/pacm/installmonitor.h:60
Proxies state change events from managed packages.
{#installcomplete}
InstallComplete
ThreadSignal< void(LocalPackage &)> InstallComplete
Defined in src/pacm/include/icy/pacm/installmonitor.h:63
Signals when a managed install task completes.
{#progress-1}
Progress
ThreadSignal< void(int &)> Progress
Defined in src/pacm/include/icy/pacm/installmonitor.h:66
Signals on overall progress update [0-100].
{#complete-3}
Complete
ThreadSignal< void(LocalPackageVec &)> Complete
Defined in src/pacm/include/icy/pacm/installmonitor.h:69
Signals on all tasks complete.
Public Methods
| Return | Name | Description |
|---|---|---|
InstallMonitor | ||
InstallMonitor | Deleted constructor. | |
InstallMonitor | Deleted constructor. | |
void | addTask virtual | Adds a task to monitor. |
void | startAll virtual | Starts all monitored tasks. |
void | cancelAll virtual | Cancels all monitored tasks. |
bool | isComplete virtual const | Returns true if all install tasks have completed, either successfully or unsuccessfully. |
InstallTaskPtrVec | tasks virtual const | Returns the list of monitored package tasks. |
LocalPackageVec | packages virtual const | Returns the list of monitored packages. |
{#installmonitor-1}
InstallMonitor
InstallMonitor()
Defined in src/pacm/include/icy/pacm/installmonitor.h:30
{#installmonitor-2}
InstallMonitor
InstallMonitor(const InstallMonitor &) = delete
Defined in src/pacm/include/icy/pacm/installmonitor.h:33
Deleted constructor.
{#installmonitor-3}
InstallMonitor
InstallMonitor(InstallMonitor &&) = delete
Defined in src/pacm/include/icy/pacm/installmonitor.h:35
Deleted constructor.
{#addtask}
addTask
virtual
virtual void addTask(InstallTask::Ptr task)
Defined in src/pacm/include/icy/pacm/installmonitor.h:39
Adds a task to monitor.
{#startall}
startAll
virtual
virtual void startAll()
Defined in src/pacm/include/icy/pacm/installmonitor.h:42
Starts all monitored tasks.
{#cancelall}
cancelAll
virtual
virtual void cancelAll()
Defined in src/pacm/include/icy/pacm/installmonitor.h:45
Cancels all monitored tasks.
{#iscomplete}
isComplete
virtual const
virtual bool isComplete() const
Defined in src/pacm/include/icy/pacm/installmonitor.h:49
Returns true if all install tasks have completed, either successfully or unsuccessfully.
{#tasks}
tasks
virtual const
virtual InstallTaskPtrVec tasks() const
Defined in src/pacm/include/icy/pacm/installmonitor.h:52
Returns the list of monitored package tasks.
{#packages}
packages
virtual const
virtual LocalPackageVec packages() const
Defined in src/pacm/include/icy/pacm/installmonitor.h:55
Returns the list of monitored packages.
Protected Attributes
| Return | Name | Description |
|---|---|---|
std::mutex | _mutex | |
InstallTaskPtrVec | _tasks | |
LocalPackageVec | _packages | |
int | _progress |
{#_mutex-10}
_mutex
std::mutex _mutex
Defined in src/pacm/include/icy/pacm/installmonitor.h:81
{#_tasks}
_tasks
InstallTaskPtrVec _tasks
Defined in src/pacm/include/icy/pacm/installmonitor.h:82
{#_packages}
_packages
LocalPackageVec _packages
Defined in src/pacm/include/icy/pacm/installmonitor.h:83
{#_progress}
_progress
int _progress
Defined in src/pacm/include/icy/pacm/installmonitor.h:84
Protected Methods
| Return | Name | Description |
|---|---|---|
void | onInstallStateChange virtual | |
void | onInstallComplete virtual | |
void | setProgress virtual |
{#oninstallstatechange}
onInstallStateChange
virtual
virtual void onInstallStateChange(void * sender, InstallationState & state, const InstallationState & oldState)
Defined in src/pacm/include/icy/pacm/installmonitor.h:72
{#oninstallcomplete}
onInstallComplete
virtual
virtual void onInstallComplete(InstallTask & task)
Defined in src/pacm/include/icy/pacm/installmonitor.h:76
{#setprogress}
setProgress
virtual
virtual void setProgress(int value)
Defined in src/pacm/include/icy/pacm/installmonitor.h:78
{#installtask}
InstallTask
#include <icy/pacm/installtask.h>
class InstallTask
Defined in src/pacm/include/icy/pacm/installtask.h:89
Inherits:
Runnable,Stateful< InstallationState >
Downloads, extracts, and finalizes a single package installation.
List of all members
| Name | Kind | Owner |
|---|---|---|
PackageManager | friend | Declared here |
InstallMonitor | friend | Declared here |
Progress | variable | Declared here |
Complete | variable | Declared here |
InstallTask | function | Declared here |
InstallTask | function | Declared here |
InstallTask | function | Declared here |
start | function | Declared here |
cancel | function | Declared here |
doDownload | function | Declared here |
doExtract | function | Declared here |
doFinalize | function | Declared here |
setComplete | function | Declared here |
getRemoteAsset | function | Declared here |
local | function | Declared here |
remote | function | Declared here |
options | function | Declared here |
loop | function | Declared here |
valid | function | Declared here |
cancelled | function | Declared here |
failed | function | Declared here |
success | function | Declared here |
complete | function | Declared here |
progress | function | Declared here |
_mutex | variable | Declared here |
_runner | variable | Declared here |
_error | variable | Declared here |
_manager | variable | Declared here |
_local | variable | Declared here |
_remote | variable | Declared here |
_options | variable | Declared here |
_progress | variable | Declared here |
_downloading | variable | Declared here |
_dlconn | variable | Declared here |
_loop | variable | Declared here |
run | function | Declared here |
onStateChange | function | Declared here |
onDownloadProgress | function | Declared here |
onDownloadComplete | function | Declared here |
setProgress | function | Declared here |
Ptr | typedef | Declared here |
Runnable | function | Inherited from Runnable |
run | function | Inherited from Runnable |
cancel | function | Inherited from Runnable |
cancelled | function | Inherited from Runnable |
exit | variable | Inherited from Runnable |
StateChange | variable | Inherited from Stateful |
_state | variable | Inherited from Stateful |
Stateful | function | Inherited from Stateful |
~Stateful | function | Inherited from Stateful |
stateEquals | function | Inherited from Stateful |
stateBetween | function | Inherited from Stateful |
state | function | Inherited from Stateful |
state | function | Inherited from Stateful |
beforeStateChange | function | Inherited from Stateful |
onStateChange | function | Inherited from Stateful |
setState | function | Inherited from Stateful |
setState | function | Inherited from Stateful |
Inherited from Runnable
| Kind | Name | Description |
|---|---|---|
function | Runnable inline | |
function | run virtual | The run method will be called by the asynchronous context. |
function | cancel virtual inline | Cancel the current task. The run() method should return ASAP. |
function | cancelled virtual const inline | Returns true when the task has been cancelled. |
variable | exit |
Inherited from Stateful
| Kind | Name | Description |
|---|---|---|
variable | StateChange | Signals when the state changes. |
variable | _state | |
function | Stateful inline | |
function | ~Stateful virtual inline | |
function | stateEquals virtual const inline | Returns true if the current state ID equals the given ID. |
function | stateBetween virtual const inline | Returns true if the current state ID is in the inclusive range [lid, rid]. |
function | state virtual inline | Returns a mutable reference to the current state. |
function | state virtual const inline | Returns a copy of the current state. |
function | beforeStateChange virtual inline | Override to handle pre state change logic. Return false to prevent state change. |
function | onStateChange virtual inline | Override to handle post state change logic. |
function | setState virtual inline | Sets the state and sends the state signal if the state change was successful. |
function | setState virtual inline | Sets the state and sends the state signal if the state change was successful. |
Friends
| Name | Description |
|---|---|
PackageManager | |
InstallMonitor |
{#packagemanager}
PackageManager
friend class PackageManager
Defined in src/pacm/include/icy/pacm/installtask.h:202
{#installmonitor-4}
InstallMonitor
friend class InstallMonitor
Defined in src/pacm/include/icy/pacm/installtask.h:203
Public Attributes
| Return | Name | Description |
|---|---|---|
Signal< void(InstallTask &, int &)> | Progress | Signals on progress update [0-100]. |
Signal< void(InstallTask &)> | Complete | Signals on task completion for both success and failure cases. |
{#progress-2}
Progress
Signal< void(InstallTask &, int &)> Progress
Defined in src/pacm/include/icy/pacm/installtask.h:171
Signals on progress update [0-100].
{#complete-4}
Complete
Signal< void(InstallTask &)> Complete
Defined in src/pacm/include/icy/pacm/installtask.h:175
Signals on task completion for both success and failure cases.
Public Methods
| Return | Name | Description |
|---|---|---|
InstallTask | ||
InstallTask | Deleted constructor. | |
InstallTask | Deleted constructor. | |
void | start virtual | Validates options, resolves the install directory, and launches the background runner. |
void | cancel virtual override | Transitions the task to the Cancelled state. |
void | doDownload virtual | Downloads the package archive from the server. |
void | doExtract virtual | Extracts the downloaded package files to the intermediate directory. |
void | doFinalize virtual | Moves extracted files from the intermediate directory to the installation directory. |
void | setComplete virtual | Called when the task completes either successfully or in error. This will trigger destruction. |
Package::Asset | getRemoteAsset virtual const | Returns the remote asset selected by the current InstallOptions. Respects version and sdkVersion overrides; falls back to latestAsset(). |
LocalPackage * | local virtual const | Returns a pointer to the local package record. |
RemotePackage * | remote virtual const | Returns a pointer to the remote package record. |
const InstallOptions & | options virtual const nodiscard | Returns a read-only view of the installation options for this task. |
uv::Loop * | loop virtual const | Returns the libuv event loop used for async operations. |
bool | valid virtual const | Returns true if the task is not in a Failed state and both local and remote (if set) packages are valid. |
bool | cancelled virtual const override | Returns true if the task is in the Cancelled state. |
bool | failed virtual const | Returns true if the task is in the Failed state. |
bool | success virtual const | Returns true if the task is in the Installed (success) state. |
bool | complete virtual const | Returns true if the task has reached a terminal state (Installed, Cancelled, or Failed). |
int | progress virtual const | Returns the current progress value in the range [0, 100]. |
{#installtask-1}
InstallTask
InstallTask(PackageManager & manager, LocalPackage * local, RemotePackage * remote, const InstallOptions & options = InstallOptions(), uv::Loop * loop = uv::defaultLoop())
Defined in src/pacm/include/icy/pacm/installtask.h:101
Parameters
-
managerOwning PackageManager instance. -
localLocal package record (must not be null). -
remoteRemote package record to install from (may be null for local-only ops). -
optionsVersion and path overrides for this installation. -
looplibuv event loop to use for async HTTP downloads.
Exceptions
std::runtime_errorif the task configuration is invalid.
{#installtask-2}
InstallTask
InstallTask(const InstallTask &) = delete
Defined in src/pacm/include/icy/pacm/installtask.h:106
Deleted constructor.
{#installtask-3}
InstallTask
InstallTask(InstallTask &&) = delete
Defined in src/pacm/include/icy/pacm/installtask.h:108
Deleted constructor.
{#start-12}
start
virtual
virtual void start()
Defined in src/pacm/include/icy/pacm/installtask.h:113
Validates options, resolves the install directory, and launches the background runner.
Exceptions
std::runtime_errorif the requested version or SDK version asset is unavailable.
{#cancel-3}
cancel
virtual override
virtual void cancel(bool flag = true) override
Defined in src/pacm/include/icy/pacm/installtask.h:116
Transitions the task to the Cancelled state.
Reimplements
{#dodownload}
doDownload
virtual
virtual void doDownload()
Defined in src/pacm/include/icy/pacm/installtask.h:119
Downloads the package archive from the server.
{#doextract}
doExtract
virtual
virtual void doExtract()
Defined in src/pacm/include/icy/pacm/installtask.h:123
Extracts the downloaded package files to the intermediate directory.
{#dofinalize}
doFinalize
virtual
virtual void doFinalize()
Defined in src/pacm/include/icy/pacm/installtask.h:127
Moves extracted files from the intermediate directory to the installation directory.
{#setcomplete}
setComplete
virtual
virtual void setComplete()
Defined in src/pacm/include/icy/pacm/installtask.h:132
Called when the task completes either successfully or in error. This will trigger destruction.
{#getremoteasset}
getRemoteAsset
virtual const
virtual Package::Asset getRemoteAsset() const
Defined in src/pacm/include/icy/pacm/installtask.h:136
Returns the remote asset selected by the current InstallOptions. Respects version and sdkVersion overrides; falls back to latestAsset().
{#local}
local
virtual const
virtual LocalPackage * local() const
Defined in src/pacm/include/icy/pacm/installtask.h:139
Returns a pointer to the local package record.
{#remote}
remote
virtual const
virtual RemotePackage * remote() const
Defined in src/pacm/include/icy/pacm/installtask.h:142
Returns a pointer to the remote package record.
{#options-4}
options
virtual const nodiscard
[[nodiscard]] virtual const InstallOptions & options() const
Defined in src/pacm/include/icy/pacm/installtask.h:145
Returns a read-only view of the installation options for this task.
{#loop-7}
loop
virtual const
virtual uv::Loop * loop() const
Defined in src/pacm/include/icy/pacm/installtask.h:148
Returns the libuv event loop used for async operations.
{#valid-2}
valid
virtual const
virtual bool valid() const
Defined in src/pacm/include/icy/pacm/installtask.h:152
Returns true if the task is not in a Failed state and both local and remote (if set) packages are valid.
{#cancelled-2}
cancelled
virtual const override
virtual bool cancelled() const override
Defined in src/pacm/include/icy/pacm/installtask.h:155
Returns true if the task is in the Cancelled state.
Reimplements
{#failed}
failed
virtual const
virtual bool failed() const
Defined in src/pacm/include/icy/pacm/installtask.h:158
Returns true if the task is in the Failed state.
{#success-1}
success
virtual const
virtual bool success() const
Defined in src/pacm/include/icy/pacm/installtask.h:161
Returns true if the task is in the Installed (success) state.
{#complete-5}
complete
virtual const
virtual bool complete() const
Defined in src/pacm/include/icy/pacm/installtask.h:165
Returns true if the task has reached a terminal state (Installed, Cancelled, or Failed).
{#progress-3}
progress
virtual const
virtual int progress() const
Defined in src/pacm/include/icy/pacm/installtask.h:168
Returns the current progress value in the range [0, 100].
Protected Attributes
| Return | Name | Description |
|---|---|---|
std::mutex | _mutex | |
Idler | _runner | |
icy::Error | _error | |
PackageManager & | _manager | |
LocalPackage * | _local | |
RemotePackage * | _remote | |
InstallOptions | _options | |
int | _progress | |
bool | _downloading | |
http::ClientConnection::Ptr | _dlconn | |
uv::Loop * | _loop |
{#_mutex-11}
_mutex
std::mutex _mutex
Defined in src/pacm/include/icy/pacm/installtask.h:189
{#_runner-1}
_runner
Idler _runner
Defined in src/pacm/include/icy/pacm/installtask.h:191
{#_error-4}
_error
icy::Error _error
Defined in src/pacm/include/icy/pacm/installtask.h:192
{#_manager-3}
_manager
PackageManager & _manager
Defined in src/pacm/include/icy/pacm/installtask.h:193
{#_local}
_local
LocalPackage * _local
Defined in src/pacm/include/icy/pacm/installtask.h:194
{#_remote}
_remote
RemotePackage * _remote
Defined in src/pacm/include/icy/pacm/installtask.h:195
{#_options-1}
_options
InstallOptions _options
Defined in src/pacm/include/icy/pacm/installtask.h:196
{#_progress-1}
_progress
int _progress
Defined in src/pacm/include/icy/pacm/installtask.h:197
{#_downloading}
_downloading
bool _downloading
Defined in src/pacm/include/icy/pacm/installtask.h:198
{#_dlconn}
_dlconn
http::ClientConnection::Ptr _dlconn
Defined in src/pacm/include/icy/pacm/installtask.h:199
{#_loop-2}
_loop
uv::Loop * _loop
Defined in src/pacm/include/icy/pacm/installtask.h:200
Protected Methods
| Return | Name | Description |
|---|---|---|
void | run virtual override | Called asynchronously by the thread to do the work. |
void | onStateChange override | |
void | onDownloadProgress virtual | |
void | onDownloadComplete virtual | |
void | setProgress virtual |
{#run-5}
run
virtual override
virtual void run() override
Defined in src/pacm/include/icy/pacm/installtask.h:179
Called asynchronously by the thread to do the work.
Reimplements
{#onstatechange}
onStateChange
override
void onStateChange(InstallationState & state, const InstallationState & oldState) override
Defined in src/pacm/include/icy/pacm/installtask.h:181
{#ondownloadprogress}
onDownloadProgress
virtual
virtual void onDownloadProgress(const double & progress)
Defined in src/pacm/include/icy/pacm/installtask.h:183
{#ondownloadcomplete}
onDownloadComplete
virtual
virtual void onDownloadComplete(const http::Response & response)
Defined in src/pacm/include/icy/pacm/installtask.h:184
{#setprogress-1}
setProgress
virtual
virtual void setProgress(int value)
Defined in src/pacm/include/icy/pacm/installtask.h:186
Public Types
| Name | Description |
|---|---|
Ptr |
{#ptr-14}
Ptr
using Ptr = std::shared_ptr< InstallTask >
Defined in src/pacm/include/icy/pacm/installtask.h:93
{#packagemanager-1}
PackageManager
#include <icy/pacm/packagemanager.h>
class PackageManager
Defined in src/pacm/include/icy/pacm/packagemanager.h:62
Loads package manifests and coordinates install, update, and uninstall workflows.
List of all members
| Name | Kind | Owner |
|---|---|---|
RemotePackageResponse | variable | Declared here |
PackageUninstalled | variable | Declared here |
InstallTaskCreated | variable | Declared here |
InstallTaskComplete | variable | Declared here |
PackageManager | function | Declared here |
PackageManager | function | Declared here |
PackageManager | function | Declared here |
initialize | function | Declared here |
uninitialize | function | Declared here |
initialized | function | Declared here |
createDirectories | function | Declared here |
queryRemotePackages | function | Declared here |
loadLocalPackages | function | Declared here |
loadLocalPackages | function | Declared here |
saveLocalPackages | function | Declared here |
saveLocalPackage | function | Declared here |
parseRemotePackages | function | Declared here |
installPackage | function | Declared here |
installPackages | function | Declared here |
updatePackage | function | Declared here |
updatePackages | function | Declared here |
updateAllPackages | function | Declared here |
uninstallPackages | function | Declared here |
uninstallPackage | function | Declared here |
hasUnfinalizedPackages | function | Declared here |
finalizeInstallations | function | Declared here |
getInstallTask | function | Declared here |
tasks | function | Declared here |
cancelAllTasks | function | Declared here |
getPackagePairs | function | Declared here |
getUpdatablePackagePairs | function | Declared here |
getPackagePair | function | Declared here |
getOrCreatePackagePair | function | Declared here |
createInstallTask | function | Declared here |
installedPackageVersion | function | Declared here |
getLatestInstallableAsset | function | Declared here |
hasAvailableUpdates | function | Declared here |
clearCache | function | Declared here |
clearPackageCache | function | Declared here |
clearCacheFile | function | Declared here |
hasCachedFile | function | Declared here |
isSupportedFileType | function | Declared here |
getCacheFilePath | function | Declared here |
getPackageDataDir | function | Declared here |
mutableOptions | function | Declared here |
options | function | Declared here |
remotePackages | function | Declared here |
localPackages | function | Declared here |
_mutex | variable | Declared here |
_localPackages | variable | Declared here |
_remotePackages | variable | Declared here |
_tasks | variable | Declared here |
_options | variable | Declared here |
onPackageInstallComplete | function | Declared here |
Public Attributes
| Return | Name | Description |
|---|---|---|
Signal< void(const http::Response &)> | RemotePackageResponse | Events. |
Signal< void(LocalPackage &)> | PackageUninstalled | Signals when a package is uninstalled. |
Signal< void(InstallTask &)> | InstallTaskCreated | Signals when an installation task is created, before it is started. |
Signal< void(const InstallTask &)> | InstallTaskComplete | Signals when a package installation tasks completes, either successfully or in error. |
{#remotepackageresponse}
RemotePackageResponse
Signal< void(const http::Response &)> RemotePackageResponse
Defined in src/pacm/include/icy/pacm/packagemanager.h:311
Events.
Signals when the remote package list have been downloaded from the server.
{#packageuninstalled}
PackageUninstalled
Signal< void(LocalPackage &)> PackageUninstalled
Defined in src/pacm/include/icy/pacm/packagemanager.h:314
Signals when a package is uninstalled.
{#installtaskcreated}
InstallTaskCreated
Signal< void(InstallTask &)> InstallTaskCreated
Defined in src/pacm/include/icy/pacm/packagemanager.h:318
Signals when an installation task is created, before it is started.
{#installtaskcomplete}
InstallTaskComplete
Signal< void(const InstallTask &)> InstallTaskComplete
Defined in src/pacm/include/icy/pacm/packagemanager.h:322
Signals when a package installation tasks completes, either successfully or in error.
Public Methods
| Return | Name | Description |
|---|---|---|
PackageManager | ||
PackageManager | Deleted constructor. | |
PackageManager | Deleted constructor. | |
void | initialize virtual | Initialization Methods. |
void | uninitialize virtual | Releases resources and cancels any in-progress tasks. |
bool | initialized virtual const | Returns true if initialize() has been called successfully. |
void | createDirectories virtual | Creates the package manager directory structure if it does not already exist. |
void | queryRemotePackages virtual | Queries the server for a list of available packages. |
void | loadLocalPackages virtual | Loads all local package manifests from file system. Clears all in memory package manifests. |
void | loadLocalPackages virtual | Loads all local package manifests residing the the given directory. This method may be called multiple times for different paths because it does not clear in memory package manifests. |
bool | saveLocalPackages virtual | Saves all local package manifests to the data directory. |
bool | saveLocalPackage virtual | Saves the local package manifest to the file system. |
void | parseRemotePackages virtual | Parse the remote packages from the given JSON data string. |
InstallTask::Ptr | installPackage virtual | Package Installation Methods. |
bool | installPackages virtual | Installs multiple packages. The same options will be passed to each task. If a InstallMonitor instance was passed in the tasks will need to be started, otherwise they will be auto-started. The PackageManager does not take ownership of the InstallMonitor. |
InstallTask::Ptr | updatePackage virtual | Updates a single package. Throws an exception if the package does not exist. The returned InstallTask must be started. |
bool | updatePackages virtual | Updates multiple packages. Throws an exception if the package does not exist. If a InstallMonitor instance was passed in the tasks will need to be started, otherwise they will be auto-started. The PackageManager does not take ownership of the InstallMonitor. |
bool | updateAllPackages virtual | Updates all installed packages. |
bool | uninstallPackages virtual | Uninstalls multiple packages. |
bool | uninstallPackage virtual | Uninstalls a single package. |
bool | hasUnfinalizedPackages virtual | Returns true if there are updates available that have not yet been finalized. Packages may be unfinalized if there were files in use at the time of installation. |
bool | finalizeInstallations virtual | Finalizes active installations by moving all package files to their target destination. If files are to be overwritten they must not be in use or finalization will fail. |
InstallTask::Ptr | getInstallTask virtual const | Task Helper Methods. |
InstallTaskPtrVec | tasks virtual const | Returns a list of all tasks. |
void | cancelAllTasks virtual | Aborts all package installation tasks. All tasks must be aborted before clearing local or remote manifests. |
PackagePairVec | getPackagePairs virtual const | Package Helper Methods. |
PackagePairVec | getUpdatablePackagePairs virtual const | Returns a list of package pairs which may be updated. All pairs will have both local and remote package pointers, and the remote version will be newer than the local version. |
PackagePair | getPackagePair virtual const | Returns a local and remote package pair. An exception will be thrown if either the local or remote packages aren't available or are invalid. |
PackagePair | getOrCreatePackagePair virtual | Returns a local and remote package pair. If the local package doesn't exist it will be created from the remote package. If the remote package doesn't exist a NotFoundException will be thrown. |
InstallTask::Ptr | createInstallTask virtual | Creates a package installation task for the given pair. |
std::string | installedPackageVersion virtual const | Returns the version number of an installed package. Exceptions will be thrown if the package does not exist, or is not fully installed. |
Package::Asset | getLatestInstallableAsset virtual const | Returns the best asset to install, or throws a descriptive exception if no updates are available, or if the package is already up-to-date. This method takes version and SDK locks into consideration. |
bool | hasAvailableUpdates virtual const | Returns true if there are updates available for this package, false otherwise. |
void | clearCache | File Helper Methods. |
bool | clearPackageCache | Clears a package archive from the local cache. |
bool | clearCacheFile | Clears a file from the local cache. |
bool | hasCachedFile | Checks if a package archive exists in the local cache. |
bool | isSupportedFileType | Checks if the file type is a supported package archive. |
std::string | getCacheFilePath | Returns the full path of the cached file if it exists, or an empty path if the file doesn't exist. |
std::string | getPackageDataDir | Returns the package data directory for the given package ID. |
Options & | mutableOptions virtual | Accessors. |
const Options & | options virtual const nodiscard | Returns a read-only view of the current options. |
RemotePackageStore & | remotePackages virtual | Returns a reference to the in-memory remote package store. |
LocalPackageStore & | localPackages virtual | Returns a reference to the in-memory local package store. |
{#packagemanager-2}
PackageManager
PackageManager(const Options & options = Options())
Defined in src/pacm/include/icy/pacm/packagemanager.h:99
Parameters
optionsConfiguration for directories, endpoints, and credentials.
{#packagemanager-3}
PackageManager
PackageManager(const PackageManager &) = delete
Defined in src/pacm/include/icy/pacm/packagemanager.h:102
Deleted constructor.
{#packagemanager-4}
PackageManager
PackageManager(PackageManager &&) = delete
Defined in src/pacm/include/icy/pacm/packagemanager.h:104
Deleted constructor.
{#initialize}
initialize
virtual
virtual void initialize()
Defined in src/pacm/include/icy/pacm/packagemanager.h:112
Initialization Methods.
Initializes the package manager: creates directories, loads local manifests, and queries the remote package index.
{#uninitialize}
uninitialize
virtual
virtual void uninitialize()
Defined in src/pacm/include/icy/pacm/packagemanager.h:115
Releases resources and cancels any in-progress tasks.
{#initialized-3}
initialized
virtual const
virtual bool initialized() const
Defined in src/pacm/include/icy/pacm/packagemanager.h:118
Returns true if initialize() has been called successfully.
{#createdirectories}
createDirectories
virtual
virtual void createDirectories()
Defined in src/pacm/include/icy/pacm/packagemanager.h:122
Creates the package manager directory structure if it does not already exist.
{#queryremotepackages}
queryRemotePackages
virtual
virtual void queryRemotePackages()
Defined in src/pacm/include/icy/pacm/packagemanager.h:125
Queries the server for a list of available packages.
{#loadlocalpackages}
loadLocalPackages
virtual
virtual void loadLocalPackages()
Defined in src/pacm/include/icy/pacm/packagemanager.h:129
Loads all local package manifests from file system. Clears all in memory package manifests.
{#loadlocalpackages-1}
loadLocalPackages
virtual
virtual void loadLocalPackages(const std::string & dir)
Defined in src/pacm/include/icy/pacm/packagemanager.h:135
Loads all local package manifests residing the the given directory. This method may be called multiple times for different paths because it does not clear in memory package manifests.
{#savelocalpackages}
saveLocalPackages
virtual
virtual bool saveLocalPackages(bool whiny = false)
Defined in src/pacm/include/icy/pacm/packagemanager.h:140
Saves all local package manifests to the data directory.
Parameters
whinyIf true, re-throws on write error; otherwise returns false.
Returns
true on success.
{#savelocalpackage}
saveLocalPackage
virtual
virtual bool saveLocalPackage(LocalPackage & package, bool whiny = false)
Defined in src/pacm/include/icy/pacm/packagemanager.h:143
Saves the local package manifest to the file system.
{#parseremotepackages}
parseRemotePackages
virtual
virtual void parseRemotePackages(const std::string & data)
Defined in src/pacm/include/icy/pacm/packagemanager.h:146
Parse the remote packages from the given JSON data string.
{#installpackage}
installPackage
virtual
virtual InstallTask::Ptr installPackage(const std::string & name, const InstallOptions & options = InstallOptions())
Defined in src/pacm/include/icy/pacm/packagemanager.h:156
Package Installation Methods.
Installs a single package. The returned InstallTask must be started. If the package is already up-to-date, a nullptr will be returned. Any other error will throw a std::runtime_error.
{#installpackages}
installPackages
virtual
virtual bool installPackages(const StringVec & ids, const InstallOptions & options = InstallOptions(), InstallMonitor * monitor = nullptr, bool whiny = false)
Defined in src/pacm/include/icy/pacm/packagemanager.h:165
Installs multiple packages. The same options will be passed to each task. If a InstallMonitor instance was passed in the tasks will need to be started, otherwise they will be auto-started. The PackageManager does not take ownership of the InstallMonitor.
{#updatepackage}
updatePackage
virtual
virtual InstallTask::Ptr updatePackage(const std::string & name, const InstallOptions & options = InstallOptions())
Defined in src/pacm/include/icy/pacm/packagemanager.h:173
Updates a single package. Throws an exception if the package does not exist. The returned InstallTask must be started.
{#updatepackages}
updatePackages
virtual
virtual bool updatePackages(const StringVec & ids, const InstallOptions & options = InstallOptions(), InstallMonitor * monitor = nullptr, bool whiny = false)
Defined in src/pacm/include/icy/pacm/packagemanager.h:182
Updates multiple packages. Throws an exception if the package does not exist. If a InstallMonitor instance was passed in the tasks will need to be started, otherwise they will be auto-started. The PackageManager does not take ownership of the InstallMonitor.
{#updateallpackages}
updateAllPackages
virtual
virtual bool updateAllPackages(bool whiny = false)
Defined in src/pacm/include/icy/pacm/packagemanager.h:187
Updates all installed packages.
{#uninstallpackages}
uninstallPackages
virtual
virtual bool uninstallPackages(const StringVec & ids, bool whiny = false)
Defined in src/pacm/include/icy/pacm/packagemanager.h:190
Uninstalls multiple packages.
{#uninstallpackage}
uninstallPackage
virtual
virtual bool uninstallPackage(const std::string & id, bool whiny = false)
Defined in src/pacm/include/icy/pacm/packagemanager.h:193
Uninstalls a single package.
{#hasunfinalizedpackages}
hasUnfinalizedPackages
virtual
virtual bool hasUnfinalizedPackages()
Defined in src/pacm/include/icy/pacm/packagemanager.h:198
Returns true if there are updates available that have not yet been finalized. Packages may be unfinalized if there were files in use at the time of installation.
{#finalizeinstallations}
finalizeInstallations
virtual
virtual bool finalizeInstallations(bool whiny = false)
Defined in src/pacm/include/icy/pacm/packagemanager.h:204
Finalizes active installations by moving all package files to their target destination. If files are to be overwritten they must not be in use or finalization will fail.
{#getinstalltask}
getInstallTask
virtual const
virtual InstallTask::Ptr getInstallTask(const std::string & id) const
Defined in src/pacm/include/icy/pacm/packagemanager.h:210
Task Helper Methods.
Gets the install task for the given package ID.
{#tasks-1}
tasks
virtual const
virtual InstallTaskPtrVec tasks() const
Defined in src/pacm/include/icy/pacm/packagemanager.h:213
Returns a list of all tasks.
{#cancelalltasks}
cancelAllTasks
virtual
virtual void cancelAllTasks()
Defined in src/pacm/include/icy/pacm/packagemanager.h:217
Aborts all package installation tasks. All tasks must be aborted before clearing local or remote manifests.
{#getpackagepairs}
getPackagePairs
virtual const
virtual PackagePairVec getPackagePairs() const
Defined in src/pacm/include/icy/pacm/packagemanager.h:224
Package Helper Methods.
Returns all package pairs, valid or invalid. Some pairs may not have both local and remote package pointers.
{#getupdatablepackagepairs}
getUpdatablePackagePairs
virtual const
virtual PackagePairVec getUpdatablePackagePairs() const
Defined in src/pacm/include/icy/pacm/packagemanager.h:229
Returns a list of package pairs which may be updated. All pairs will have both local and remote package pointers, and the remote version will be newer than the local version.
{#getpackagepair}
getPackagePair
virtual const
virtual PackagePair getPackagePair(const std::string & id, bool whiny = false) const
Defined in src/pacm/include/icy/pacm/packagemanager.h:234
Returns a local and remote package pair. An exception will be thrown if either the local or remote packages aren't available or are invalid.
{#getorcreatepackagepair}
getOrCreatePackagePair
virtual
virtual PackagePair getOrCreatePackagePair(const std::string & id)
Defined in src/pacm/include/icy/pacm/packagemanager.h:242
Returns a local and remote package pair. If the local package doesn't exist it will be created from the remote package. If the remote package doesn't exist a NotFoundException will be thrown.
{#createinstalltask}
createInstallTask
virtual
virtual InstallTask::Ptr createInstallTask(PackagePair & pair, const InstallOptions & options = InstallOptions())
Defined in src/pacm/include/icy/pacm/packagemanager.h:245
Creates a package installation task for the given pair.
{#installedpackageversion}
installedPackageVersion
virtual const
virtual std::string installedPackageVersion(const std::string & id) const
Defined in src/pacm/include/icy/pacm/packagemanager.h:251
Returns the version number of an installed package. Exceptions will be thrown if the package does not exist, or is not fully installed.
{#getlatestinstallableasset}
getLatestInstallableAsset
virtual const
virtual Package::Asset getLatestInstallableAsset(const PackagePair & pair, const InstallOptions & options = InstallOptions()) const
Defined in src/pacm/include/icy/pacm/packagemanager.h:256
Returns the best asset to install, or throws a descriptive exception if no updates are available, or if the package is already up-to-date. This method takes version and SDK locks into consideration.
{#hasavailableupdates}
hasAvailableUpdates
virtual const
virtual bool hasAvailableUpdates(const PackagePair & pair) const
Defined in src/pacm/include/icy/pacm/packagemanager.h:262
Returns true if there are updates available for this package, false otherwise.
{#clearcache}
clearCache
void clearCache()
Defined in src/pacm/include/icy/pacm/packagemanager.h:268
File Helper Methods.
Clears all files in the cache directory.
{#clearpackagecache}
clearPackageCache
bool clearPackageCache(LocalPackage & package)
Defined in src/pacm/include/icy/pacm/packagemanager.h:271
Clears a package archive from the local cache.
{#clearcachefile}
clearCacheFile
bool clearCacheFile(std::string_view fileName, bool whiny = false)
Defined in src/pacm/include/icy/pacm/packagemanager.h:274
Clears a file from the local cache.
{#hascachedfile}
hasCachedFile
bool hasCachedFile(Package::Asset & asset)
Defined in src/pacm/include/icy/pacm/packagemanager.h:277
Checks if a package archive exists in the local cache.
{#issupportedfiletype}
isSupportedFileType
bool isSupportedFileType(std::string_view fileName)
Defined in src/pacm/include/icy/pacm/packagemanager.h:280
Checks if the file type is a supported package archive.
{#getcachefilepath}
getCacheFilePath
std::string getCacheFilePath(std::string_view fileName)
Defined in src/pacm/include/icy/pacm/packagemanager.h:284
Returns the full path of the cached file if it exists, or an empty path if the file doesn't exist.
{#getpackagedatadir}
getPackageDataDir
std::string getPackageDataDir(std::string_view id)
Defined in src/pacm/include/icy/pacm/packagemanager.h:288
Returns the package data directory for the given package ID.
{#mutableoptions}
mutableOptions
virtual
virtual Options & mutableOptions()
Defined in src/pacm/include/icy/pacm/packagemanager.h:295
Accessors.
Returns the mutable startup configuration for this manager. Callers should finish edits before initialize().
{#options-5}
options
virtual const nodiscard
[[nodiscard]] virtual const Options & options() const
Defined in src/pacm/include/icy/pacm/packagemanager.h:298
Returns a read-only view of the current options.
{#remotepackages}
remotePackages
virtual
virtual RemotePackageStore & remotePackages()
Defined in src/pacm/include/icy/pacm/packagemanager.h:301
Returns a reference to the in-memory remote package store.
{#localpackages}
localPackages
virtual
virtual LocalPackageStore & localPackages()
Defined in src/pacm/include/icy/pacm/packagemanager.h:304
Returns a reference to the in-memory local package store.
Protected Attributes
| Return | Name | Description |
|---|---|---|
std::mutex | _mutex | |
LocalPackageStore | _localPackages | |
RemotePackageStore | _remotePackages | |
InstallTaskPtrVec | _tasks | |
Options | _options |
{#_mutex-12}
_mutex
std::mutex _mutex
Defined in src/pacm/include/icy/pacm/packagemanager.h:331
{#_localpackages}
_localPackages
LocalPackageStore _localPackages
Defined in src/pacm/include/icy/pacm/packagemanager.h:332
{#_remotepackages}
_remotePackages
RemotePackageStore _remotePackages
Defined in src/pacm/include/icy/pacm/packagemanager.h:333
{#_tasks-1}
_tasks
InstallTaskPtrVec _tasks
Defined in src/pacm/include/icy/pacm/packagemanager.h:334
{#_options-2}
_options
Options _options
Defined in src/pacm/include/icy/pacm/packagemanager.h:335
Protected Methods
| Return | Name | Description |
|---|---|---|
void | onPackageInstallComplete | Callbacks. |
{#onpackageinstallcomplete}
onPackageInstallComplete
void onPackageInstallComplete(InstallTask & task)
Defined in src/pacm/include/icy/pacm/packagemanager.h:328
Callbacks.
{#options-6}
Options
#include <icy/pacm/packagemanager.h>
struct Options
Defined in src/pacm/include/icy/pacm/packagemanager.h:66
Startup configuration for repository endpoints, credentials, and directories.
List of all members
| Name | Kind | Owner |
|---|---|---|
endpoint | variable | Declared here |
indexURI | variable | Declared here |
httpUsername | variable | Declared here |
httpPassword | variable | Declared here |
httpOAuthToken | variable | Declared here |
tempDir | variable | Declared here |
dataDir | variable | Declared here |
installDir | variable | Declared here |
platform | variable | Declared here |
checksumAlgorithm | variable | Declared here |
clearFailedCache | variable | Declared here |
Options | function | Declared here |
Public Attributes
| Return | Name | Description |
|---|---|---|
std::string | endpoint | The HTTP server endpoint. |
std::string | indexURI | The HTTP server URI for querying packages JSON. |
std::string | httpUsername | Username for HTTP basic auth. |
std::string | httpPassword | PAssword for HTTP basic auth. |
std::string | httpOAuthToken | Will be used instead of HTTP basic if provided. |
std::string | tempDir | Directory where package files will be downloaded and extracted. |
std::string | dataDir | Directory where package manifests will be kept. |
std::string | installDir | Directory where packages will be installed. |
std::string | platform | Platform (win32, linux, mac). |
std::string | checksumAlgorithm | Checksum algorithm (MDS/SHA1). |
bool | clearFailedCache | This flag tells the package manager weather or not to clear the package cache if installation fails. |
{#endpoint}
endpoint
std::string endpoint
Defined in src/pacm/include/icy/pacm/packagemanager.h:68
The HTTP server endpoint.
{#indexuri}
indexURI
std::string indexURI
Defined in src/pacm/include/icy/pacm/packagemanager.h:69
The HTTP server URI for querying packages JSON.
{#httpusername}
httpUsername
std::string httpUsername
Defined in src/pacm/include/icy/pacm/packagemanager.h:70
Username for HTTP basic auth.
{#httppassword}
httpPassword
std::string httpPassword
Defined in src/pacm/include/icy/pacm/packagemanager.h:71
PAssword for HTTP basic auth.
{#httpoauthtoken}
httpOAuthToken
std::string httpOAuthToken
Defined in src/pacm/include/icy/pacm/packagemanager.h:72
Will be used instead of HTTP basic if provided.
{#tempdir}
tempDir
std::string tempDir
Defined in src/pacm/include/icy/pacm/packagemanager.h:74
Directory where package files will be downloaded and extracted.
{#datadir}
dataDir
std::string dataDir
Defined in src/pacm/include/icy/pacm/packagemanager.h:75
Directory where package manifests will be kept.
{#installdir-2}
installDir
std::string installDir
Defined in src/pacm/include/icy/pacm/packagemanager.h:76
Directory where packages will be installed.
{#platform}
platform
std::string platform
Defined in src/pacm/include/icy/pacm/packagemanager.h:78
Platform (win32, linux, mac).
{#checksumalgorithm}
checksumAlgorithm
std::string checksumAlgorithm
Defined in src/pacm/include/icy/pacm/packagemanager.h:79
Checksum algorithm (MDS/SHA1).
{#clearfailedcache}
clearFailedCache
bool clearFailedCache
Defined in src/pacm/include/icy/pacm/packagemanager.h:81
This flag tells the package manager weather or not to clear the package cache if installation fails.
Public Methods
| Return | Name | Description |
|---|---|---|
Options inline |
{#options-7}
Options
inline
inline Options(const std::string & root = getCwd())
Defined in src/pacm/include/icy/pacm/packagemanager.h:84
{#installationstate}
InstallationState
#include <icy/pacm/installtask.h>
struct InstallationState
Defined in src/pacm/include/icy/pacm/installtask.h:31
Inherits:
State
State machine states for package installation.
List of all members
| Name | Kind | Owner |
|---|---|---|
str | function | Declared here |
Type | enum | Declared here |
ID | typedef | Inherited from State |
_id | variable | Inherited from State |
State | function | Inherited from State |
State | function | Inherited from State |
operator= | function | Inherited from State |
~State | function | Inherited from State |
id | function | Inherited from State |
set | function | Inherited from State |
str | function | Inherited from State |
toString | function | Inherited from State |
equals | function | Inherited from State |
between | function | Inherited from State |
operator== | function | Inherited from State |
operator== | function | Inherited from State |
operator<< | friend | Inherited from State |
Inherited from State
| Kind | Name | Description |
|---|---|---|
typedef | ID | |
variable | _id | |
function | State | |
function | State | Copy constructor. |
function | operator= | Copy assignment. |
function | ~State virtual | Defaulted destructor. |
function | id const | Returns the current state ID. |
function | set | Sets the state ID. |
function | str virtual const | Returns a human-readable string for the given state ID. Override in derived classes to provide meaningful names. |
function | toString virtual const | Returns a human-readable string for the current state ID. |
function | equals const | Returns true if the current state ID equals the given ID. |
function | between const | Returns true if the current state ID is in the inclusive range [lid, rid]. |
function | operator== const inline | |
function | operator== const inline | |
friend | operator<< inline |
Public Methods
| Return | Name | Description |
|---|---|---|
std::string | str const inline | Converts a state ID to its string representation. |
{#str-2}
str
const inline
inline std::string str(unsigned int id) const
Defined in src/pacm/include/icy/pacm/installtask.h:47
Converts a state ID to its string representation.
Parameters
idOne of the Type enum values.
Returns
Human-readable state name, or "undefined" for unknown values.
Public Types
| Name | Description |
|---|---|
Type |
{#type-10}
Type
enum Type
Defined in src/pacm/include/icy/pacm/installtask.h:33
| Value | Description |
|---|---|
None | |
Downloading | |
Extracting | |
Finalizing | |
Installed | |
Cancelled | |
Failed |
{#installoptions}
InstallOptions
#include <icy/pacm/installtask.h>
struct InstallOptions
Defined in src/pacm/include/icy/pacm/installtask.h:71
Package installation options.
List of all members
| Name | Kind | Owner |
|---|---|---|
version | variable | Declared here |
sdkVersion | variable | Declared here |
installDir | variable | Declared here |
InstallOptions | function | Declared here |
Public Attributes
| Return | Name | Description |
|---|---|---|
std::string | version | If set then the given package version will be installed. |
std::string | sdkVersion | If set then the latest package version for given SDK version will be installed. |
std::string | installDir | Install to the given location, otherwise the manager default [installDir](#installdir) will be used. |
{#version-3}
version
std::string version
Defined in src/pacm/include/icy/pacm/installtask.h:73
If set then the given package version will be installed.
{#sdkversion}
sdkVersion
std::string sdkVersion
Defined in src/pacm/include/icy/pacm/installtask.h:74
If set then the latest package version for given SDK version will be installed.
{#installdir}
installDir
std::string installDir
Defined in src/pacm/include/icy/pacm/installtask.h:76
Install to the given location, otherwise the manager default [installDir](#installdir) will be used.
Public Methods
| Return | Name | Description |
|---|---|---|
InstallOptions inline |
{#installoptions-1}
InstallOptions
inline
inline InstallOptions()
Defined in src/pacm/include/icy/pacm/installtask.h:79
{#localpackage}
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
| Name | Kind | Owner |
|---|---|---|
LocalPackage | function | Declared here |
LocalPackage | function | Declared here |
LocalPackage | function | Declared here |
setState | function | Declared here |
setInstallState | function | Declared here |
setInstallDir | function | Declared here |
setInstalledAsset | function | Declared here |
setVersion | function | Declared here |
setVersionLock | function | Declared here |
setSDKVersionLock | function | Declared here |
version | function | Declared here |
state | function | Declared here |
installState | function | Declared here |
installDir | function | Declared here |
versionLock | function | Declared here |
sdkLockedVersion | function | Declared here |
asset | function | Declared here |
isInstalled | function | Declared here |
isFailed | function | Declared here |
manifest | function | Declared here |
verifyInstallManifest | function | Declared here |
getInstalledFilePath | function | Declared here |
extensionEntryPointPath | function | Declared here |
errors | function | Declared here |
addError | function | Declared here |
lastError | function | Declared here |
clearErrors | function | Declared here |
valid | function | Declared here |
Package | function | Inherited from Package |
Package | function | Inherited from Package |
id | function | Inherited from Package |
name | function | Inherited from Package |
type | function | Inherited from Package |
author | function | Inherited from Package |
description | function | Inherited from Package |
hasExtension | function | Inherited from Package |
extension | function | Inherited from Package |
valid | function | Inherited from Package |
toJson | function | Inherited from Package |
print | function | Inherited from Package |
Inherited from Package
| Kind | Name | Description |
|---|---|---|
function | Package | Constructs an empty package. |
function | Package | Constructs a package from an existing JSON value. |
function | id virtual const | Returns the package unique identifier. |
function | name virtual const | Returns the package display name. |
function | type virtual const | Returns the package type (e.g. "plugin", "asset"). |
function | author virtual const | Returns the package author string. |
function | description virtual const | Returns the package description string. |
function | hasExtension virtual const | Returns true when the package has an "extension" object. |
function | extension virtual const | Returns a read-only view of the extension metadata. Throws if no extension object is present. |
function | valid virtual const | Returns true if id, name and type are all non-empty. |
function | toJson virtual const nodiscard | Returns a plain JSON copy of this package object. |
function | print virtual const | Dumps the JSON representation of this package to ost. |
Public Methods
| 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. |
std::string | extensionEntryPointPath virtual const | Returns the install-relative extension entrypoint resolved against installDir(). Returns an empty string when no extension metadata is present. |
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-1}
LocalPackage
LocalPackage()
Defined in src/pacm/include/icy/pacm/package.h:213
Constructs an empty local package.
{#localpackage-2}
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
srcJSON object containing local package fields.
{#localpackage-3}
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-1}
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}
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}
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}
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-2}
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}
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}
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-4}
version
virtual const
virtual std::string version() const
Defined in src/pacm/include/icy/pacm/package.h:262
Returns the installed package version.
{#state-2}
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}
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-1}
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}
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}
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}
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}
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}
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}
manifest
virtual
virtual Manifest manifest()
Defined in src/pacm/include/icy/pacm/package.h:293
Returns the installation manifest.
{#verifyinstallmanifest}
verifyInstallManifest
virtual
virtual bool verifyInstallManifest(bool allowEmpty = false)
Defined in src/pacm/include/icy/pacm/package.h:295
{#getinstalledfilepath}
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}
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-2}
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}
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
messageError description to record.
{#lasterror}
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}
clearErrors
virtual
virtual void clearErrors()
Defined in src/pacm/include/icy/pacm/package.h:317
Clears all recorded error messages.
{#valid-3}
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
{#manifest-1}
Manifest
#include <icy/pacm/package.h>
struct Manifest
Defined in src/pacm/include/icy/pacm/package.h:192
Manifest of installed files recorded for a local package.
List of all members
| Name | Kind | Owner |
|---|---|---|
root | variable | Declared here |
Manifest | function | Declared here |
empty | function | Declared here |
addFile | function | Declared here |
Public Attributes
| Return | Name | Description |
|---|---|---|
json::Value & | root |
{#root-1}
root
json::Value & root
Defined in src/pacm/include/icy/pacm/package.h:206
Public Methods
| Return | Name | Description |
|---|---|---|
Manifest | ||
bool | empty virtual const | Returns true if the manifest contains no file entries. |
void | addFile virtual | Appends path to the manifest file list. |
{#manifest-2}
Manifest
Manifest(json::Value & src)
Defined in src/pacm/include/icy/pacm/package.h:195
Parameters
srcJSON array node that backs this manifest.
{#empty-1}
empty
virtual const
virtual bool empty() const
Defined in src/pacm/include/icy/pacm/package.h:199
Returns true if the manifest contains no file entries.
{#addfile}
addFile
virtual
virtual void addFile(const std::string & path)
Defined in src/pacm/include/icy/pacm/package.h:204
Appends path to the manifest file list.
Parameters
pathRelative path of an installed file.
{#package}
Package
#include <icy/pacm/package.h>
struct Package
Defined in src/pacm/include/icy/pacm/package.h:26
Inherits:
ValueSubclassed by:LocalPackage,RemotePackage
JSON-backed package metadata shared by local and remote package records.
List of all members
| Name | Kind | Owner |
|---|---|---|
Package | function | Declared here |
Package | function | Declared here |
id | function | Declared here |
name | function | Declared here |
type | function | Declared here |
author | function | Declared here |
description | function | Declared here |
hasExtension | function | Declared here |
extension | function | Declared here |
valid | function | Declared here |
toJson | function | Declared here |
print | function | Declared here |
Public Methods
| Return | Name | Description |
|---|---|---|
Package | Constructs an empty package. | |
Package | Constructs a package from an existing JSON value. | |
std::string | id virtual const | Returns the package unique identifier. |
std::string | name virtual const | Returns the package display name. |
std::string | type virtual const | Returns the package type (e.g. "plugin", "asset"). |
std::string | author virtual const | Returns the package author string. |
std::string | description virtual const | Returns the package description string. |
bool | hasExtension virtual const | Returns true when the package has an "extension" object. |
Extension | extension virtual const | Returns a read-only view of the extension metadata. Throws if no extension object is present. |
bool | valid virtual const | Returns true if id, name and type are all non-empty. |
json::Value | toJson virtual const nodiscard | Returns a plain JSON copy of this package object. |
void | print virtual const | Dumps the JSON representation of this package to ost. |
{#package-1}
Package
Package()
Defined in src/pacm/include/icy/pacm/package.h:105
Constructs an empty package.
{#package-2}
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
srcJSON object containing package fields.
{#id-2}
id
virtual const
virtual std::string id() const
Defined in src/pacm/include/icy/pacm/package.h:113
Returns the package unique identifier.
{#name-6}
name
virtual const
virtual std::string name() const
Defined in src/pacm/include/icy/pacm/package.h:116
Returns the package display name.
{#type-11}
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}
author
virtual const
virtual std::string author() const
Defined in src/pacm/include/icy/pacm/package.h:122
Returns the package author string.
{#description}
description
virtual const
virtual std::string description() const
Defined in src/pacm/include/icy/pacm/package.h:125
Returns the package description string.
{#hasextension}
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}
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-4}
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}
toJson
virtual const nodiscard
[[nodiscard]] 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-9}
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
ostOutput stream.
{#extension-1}
Extension
#include <icy/pacm/package.h>
struct Extension
Defined in src/pacm/include/icy/pacm/package.h:29
Optional extension metadata that describes how a packaged runtime unit is loaded.
List of all members
| Name | Kind | Owner |
|---|---|---|
root | variable | Declared here |
Extension | function | Declared here |
loader | function | Declared here |
runtime | function | Declared here |
entryPoint | function | Declared here |
abiVersion | function | Declared here |
capabilities | function | Declared here |
valid | function | Declared here |
hasCapability | function | Declared here |
Public Attributes
| Return | Name | Description |
|---|---|---|
const json::Value & | root |
{#root-2}
root
const json::Value & root
Defined in src/pacm/include/icy/pacm/package.h:56
Public Methods
| Return | Name | Description |
|---|---|---|
Extension | ||
std::string | loader virtual const | Returns the loader/runtime contract name (for example "graft"). |
std::string | runtime virtual const | Returns the runtime kind (for example "native" or "worker"). |
std::string | entryPoint virtual const | Returns the install-relative entrypoint path. |
int | abiVersion virtual const | Returns the extension ABI version, or 0 if not specified. |
std::vector< std::string > | capabilities virtual const | Returns the declared capabilities. |
bool | valid virtual const | Returns true when the metadata is internally consistent. |
bool | hasCapability virtual const | Returns true when capability is declared. |
{#extension-2}
Extension
Extension(const json::Value & src)
Defined in src/pacm/include/icy/pacm/package.h:32
Parameters
srcJSON object node that backs this extension metadata.
{#loader}
loader
virtual const
virtual std::string loader() const
Defined in src/pacm/include/icy/pacm/package.h:36
Returns the loader/runtime contract name (for example "graft").
{#runtime}
runtime
virtual const
virtual std::string runtime() const
Defined in src/pacm/include/icy/pacm/package.h:39
Returns the runtime kind (for example "native" or "worker").
{#entrypoint}
entryPoint
virtual const
virtual std::string entryPoint() const
Defined in src/pacm/include/icy/pacm/package.h:42
Returns the install-relative entrypoint path.
{#abiversion}
abiVersion
virtual const
virtual int abiVersion() const
Defined in src/pacm/include/icy/pacm/package.h:45
Returns the extension ABI version, or 0 if not specified.
{#capabilities}
capabilities
virtual const
virtual std::vector< std::string > capabilities() const
Defined in src/pacm/include/icy/pacm/package.h:48
Returns the declared capabilities.
{#valid-5}
valid
virtual const
virtual bool valid() const
Defined in src/pacm/include/icy/pacm/package.h:51
Returns true when the metadata is internally consistent.
{#hascapability}
hasCapability
virtual const
virtual bool hasCapability(std::string_view capability) const
Defined in src/pacm/include/icy/pacm/package.h:54
Returns true when capability is declared.
{#asset-1}
Asset
#include <icy/pacm/package.h>
struct Asset
Defined in src/pacm/include/icy/pacm/package.h:60
Archive asset metadata for a specific package build.
List of all members
| Name | Kind | Owner |
|---|---|---|
root | variable | Declared here |
Asset | function | Declared here |
Asset | function | Declared here |
fileName | function | Declared here |
version | function | Declared here |
sdkVersion | function | Declared here |
checksum | function | Declared here |
url | function | Declared here |
fileSize | function | Declared here |
valid | function | Declared here |
print | function | Declared here |
operator= | function | Declared here |
operator== | function | Declared here |
Public Attributes
| Return | Name | Description |
|---|---|---|
json::Value & | root |
{#root-3}
root
json::Value & root
Defined in src/pacm/include/icy/pacm/package.h:101
Public Methods
| Return | Name | Description |
|---|---|---|
Asset | ||
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-2}
Asset
Asset(json::Value & src)
Defined in src/pacm/include/icy/pacm/package.h:63
Parameters
srcJSON object node that backs this asset.
{#asset-3}
Asset
Asset(const Asset &) = default
Defined in src/pacm/include/icy/pacm/package.h:64
Defaulted constructor.
{#filename-2}
fileName
virtual const
virtual std::string fileName() const
Defined in src/pacm/include/icy/pacm/package.h:68
Returns the archive file name (e.g. "my-plugin-1.0.0.zip").
{#version-5}
version
virtual const
virtual std::string version() const
Defined in src/pacm/include/icy/pacm/package.h:71
Returns the package version string (e.g. "1.0.0").
{#sdkversion-1}
sdkVersion
virtual const
virtual std::string sdkVersion() const
Defined in src/pacm/include/icy/pacm/package.h:74
Returns the SDK version this asset was built against (e.g. "2.0.0").
{#checksum}
checksum
virtual const
virtual std::string checksum() const
Defined in src/pacm/include/icy/pacm/package.h:77
Returns the asset checksum string, or empty if none is set.
{#url-8}
url
virtual const
virtual std::string url(int index = 0) const
Defined in src/pacm/include/icy/pacm/package.h:81
Returns the download URL from the mirror list at index.
Parameters
indexZero-based index into the mirrors array.
{#filesize-1}
fileSize
virtual const
virtual int fileSize() const
Defined in src/pacm/include/icy/pacm/package.h:84
Returns the uncompressed file size in bytes, or 0 if not set.
{#valid-6}
valid
virtual const
virtual bool valid() const
Defined in src/pacm/include/icy/pacm/package.h:88
Returns true if the asset has the minimum required fields (file-name, version, mirrors).
{#print-10}
virtual const
virtual void print(std::ostream & ost) const
Defined in src/pacm/include/icy/pacm/package.h:92
Writes the raw JSON of this asset to ost.
Parameters
ostOutput stream.
{#operator-23}
operator=
virtual
virtual Asset & operator=(const Asset & r)
Defined in src/pacm/include/icy/pacm/package.h:96
Copies the backing JSON node from r.
Parameters
rSource asset to copy from.
{#operator-24}
operator==
virtual const
virtual bool operator==(const Asset & r) const
Defined in src/pacm/include/icy/pacm/package.h:99
Returns true if file name, version and checksum all match r.
{#packagepair}
PackagePair
#include <icy/pacm/package.h>
struct PackagePair
Defined in src/pacm/include/icy/pacm/package.h:328
Pairing of the installed and remote metadata for the same package ID.
List of all members
| Name | Kind | Owner |
|---|---|---|
local | variable | Declared here |
remote | variable | Declared here |
PackagePair | function | Declared here |
valid | function | Declared here |
id | function | Declared here |
name | function | Declared here |
type | function | Declared here |
author | function | Declared here |
hasExtension | function | Declared here |
Public Attributes
| Return | Name | Description |
|---|---|---|
LocalPackage * | local | Returns true if there are no possible updates for this package, false otherwise. |
RemotePackage * | remote |
{#local-1}
local
LocalPackage * local
Defined in src/pacm/include/icy/pacm/package.h:357
Returns true if there are no possible updates for this package, false otherwise.
{#remote-1}
remote
RemotePackage * remote
Defined in src/pacm/include/icy/pacm/package.h:358
Public Methods
| Return | Name | Description |
|---|---|---|
PackagePair | ||
bool | valid virtual const | Returns true if at least one of local/remote is set and that pointer is itself valid(). |
std::string | id const | Returns the package ID, preferring the local package if available. |
std::string | name const | Returns the package display name, preferring the local package if available. |
std::string | type const | Returns the package type, preferring the local package if available. |
std::string | author const | Returns the package author, preferring the local package if available. |
bool | hasExtension const | Returns true when either side carries extension metadata. |
{#packagepair-1}
PackagePair
PackagePair(LocalPackage * local = nullptr, RemotePackage * remote = nullptr)
Defined in src/pacm/include/icy/pacm/package.h:332
Parameters
-
localPointer to the locally installed package, or nullptr if not installed. -
remotePointer to the remote package record, or nullptr if not known.
{#valid-7}
valid
virtual const
virtual bool valid() const
Defined in src/pacm/include/icy/pacm/package.h:336
Returns true if at least one of local/remote is set and that pointer is itself valid().
{#id-3}
id
const
std::string id() const
Defined in src/pacm/include/icy/pacm/package.h:339
Returns the package ID, preferring the local package if available.
{#name-7}
name
const
std::string name() const
Defined in src/pacm/include/icy/pacm/package.h:342
Returns the package display name, preferring the local package if available.
{#type-12}
type
const
std::string type() const
Defined in src/pacm/include/icy/pacm/package.h:345
Returns the package type, preferring the local package if available.
{#author-1}
author
const
std::string author() const
Defined in src/pacm/include/icy/pacm/package.h:348
Returns the package author, preferring the local package if available.
{#hasextension-1}
hasExtension
const
bool hasExtension() const
Defined in src/pacm/include/icy/pacm/package.h:351
Returns true when either side carries extension metadata.
{#remotepackage}
RemotePackage
#include <icy/pacm/package.h>
struct RemotePackage
Defined in src/pacm/include/icy/pacm/package.h:151
Inherits:
Package
Package metadata loaded from the remote package index.
List of all members
| Name | Kind | Owner |
|---|---|---|
RemotePackage | function | Declared here |
RemotePackage | function | Declared here |
assets | function | Declared here |
latestAsset | function | Declared here |
assetVersion | function | Declared here |
latestSDKAsset | function | Declared here |
Package | function | Inherited from Package |
Package | function | Inherited from Package |
id | function | Inherited from Package |
name | function | Inherited from Package |
type | function | Inherited from Package |
author | function | Inherited from Package |
description | function | Inherited from Package |
hasExtension | function | Inherited from Package |
extension | function | Inherited from Package |
valid | function | Inherited from Package |
toJson | function | Inherited from Package |
print | function | Inherited from Package |
Inherited from Package
| Kind | Name | Description |
|---|---|---|
function | Package | Constructs an empty package. |
function | Package | Constructs a package from an existing JSON value. |
function | id virtual const | Returns the package unique identifier. |
function | name virtual const | Returns the package display name. |
function | type virtual const | Returns the package type (e.g. "plugin", "asset"). |
function | author virtual const | Returns the package author string. |
function | description virtual const | Returns the package description string. |
function | hasExtension virtual const | Returns true when the package has an "extension" object. |
function | extension virtual const | Returns a read-only view of the extension metadata. Throws if no extension object is present. |
function | valid virtual const | Returns true if id, name and type are all non-empty. |
function | toJson virtual const nodiscard | Returns a plain JSON copy of this package object. |
function | print virtual const | Dumps the JSON representation of this package to ost. |
Public Methods
| Return | Name | Description |
|---|---|---|
RemotePackage | Constructs an empty remote package. | |
RemotePackage | Constructs a remote package from an existing JSON value. | |
json::Value & | assets virtual | Returns a reference to the "assets" JSON array node. |
Asset | latestAsset virtual | Returns the latest asset for this package. For local packages this is the currently installed version. For remote packages this is the latest available version. Throws an exception if no asset exists. |
Asset | assetVersion virtual | Returns the latest asset for the given package version. Throws an exception if no asset exists. |
Asset | latestSDKAsset virtual | Returns the latest asset for the given SDK version. This method is for safely installing plug-ins which must be compiled against a specific SDK version. The package JSON must have a "sdk-version" member for this function to work as intended. Throws an exception if no asset exists. |
{#remotepackage-1}
RemotePackage
RemotePackage()
Defined in src/pacm/include/icy/pacm/package.h:154
Constructs an empty remote package.
{#remotepackage-2}
RemotePackage
RemotePackage(const json::Value & src)
Defined in src/pacm/include/icy/pacm/package.h:158
Constructs a remote package from an existing JSON value.
Parameters
srcJSON object containing remote package fields.
{#assets}
assets
virtual
virtual json::Value & assets()
Defined in src/pacm/include/icy/pacm/package.h:162
Returns a reference to the "assets" JSON array node.
{#latestasset}
latestAsset
virtual
virtual Asset latestAsset()
Defined in src/pacm/include/icy/pacm/package.h:168
Returns the latest asset for this package. For local packages this is the currently installed version. For remote packages this is the latest available version. Throws an exception if no asset exists.
{#assetversion}
assetVersion
virtual
virtual Asset assetVersion(const std::string & version)
Defined in src/pacm/include/icy/pacm/package.h:172
Returns the latest asset for the given package version. Throws an exception if no asset exists.
{#latestsdkasset}
latestSDKAsset
virtual
virtual Asset latestSDKAsset(const std::string & version)
Defined in src/pacm/include/icy/pacm/package.h:180
Returns the latest asset for the given SDK version. This method is for safely installing plug-ins which must be compiled against a specific SDK version. The package JSON must have a "sdk-version" member for this function to work as intended. Throws an exception if no asset exists.