Class CInstallManifest#
Defined in File installation_manifest.h
Nested Relationships#
Nested Types#
Class Documentation#
-
class CInstallManifest#
Class managing the installation manifest.
The installation manifest is a TOML file with the name “install_manifest.toml” and the following format:
[Installation] Version = 100 # Installation manifest version. Name = "Duck" # Name of the installation. This typically is identical to the installation directory name. [Properties] Product = "Wild goose components" # Product name Description = "Mallard installation" # Description Author = "Nils Holgerson" # Author Address = """Vildgåsvägen 7 Skanör med Falsterbo Skåne län, 123 45 Sverige""" # Address Copyrights = "(C) 2025 Wild goose" # Copyrights Version = "0.1.2.3" # Package version [[Module]] Path = "mallard.sdv # Relative path to the module [[Module.Component]] # Component manifest Class = "Mallard class" # The name of the class Aliases = ["Duck", "Pont duck"] # Optional list of aliases DefaultName = "Duck" # Optional default name for the class instance Type = "Complex service" # Component type (Device, BasicService, ComplexService, App, Proxy, Stub, Utility) Singleton = false # Optional singleton flag Dependencies = ["Bird", "Animal"] # Optional list of dependencies [[Module.Component]] # Another component manifest #... [[Module]] # Another module Path = "large/greylag_goose.sdv # Relative path to the module
Remark
The installation directory path is used to create relative paths to the modules. It is not stored in the manifest itself allowing the manifest to be copied from one location to another as long as the relative path to the modules is maintained (meaning copying the modules along with the manifest).
Public Functions
-
CInstallManifest() = default#
Default constructor.
-
bool IsValid() const#
Is this a valid installation manifest (installation directory path is known and a name is given)?
- Returns:
Returns whether the installation manifest is valid.
-
void Clear()#
Clear the current manifest to start a new manifest.
-
const std::string &InstallName() const#
Get the installation name.
- Returns:
Reference to the string holding the installation name.
-
sdv::installation::SPackageVersion Version() const#
Get the package version from the version property.
Remark
The version property can hold additional information, which is not available through this function.
- Returns:
Structure containing the version information.
-
const std::filesystem::path &InstallDir() const#
Get the installation directory path.
- Returns:
Reference to the path to the installation.
-
bool Create(const std::string &rssInstallName)#
Create a new manifest.
- Parameters:
rssInstallName – [in] Reference to the string containing the installaltion name.
- Returns:
Returns whether manifest creation was successful.
-
bool Load(const std::filesystem::path &rpathInstallDir, bool bBlockSystemObjects = false)#
Load a manifest TOML file.
- Parameters:
rpathInstallDir – [in] Reference to the installation directory.
bBlockSystemObjects – [in] When set, system objects are not stored in the repository.
- Returns:
Returns whether loading the TOML file was successful.
-
bool Save(const std::filesystem::path &rpathInstallDir) const#
Save a manifest TOML file.
- Parameters:
rpathInstallDir – [in] Reference to the installation directory.
- Returns:
Returns whether saving the TOML file was successful.
-
bool Read(const std::string &rssManifest, bool bBlockSystemObjects = false)#
Read a manifest TOML string.
- Parameters:
rssManifest – [in] Reference to the string containing the manifest.
bBlockSystemObjects – [in] When set, system objects are not stored in the repository.
- Returns:
Returns whether reading the TOML string was successful.
-
std::string Write() const#
Write a manifest TOML string.
- Returns:
The manifest TOML string when successful or an empty string when not.
-
bool AddModule(const std::filesystem::path &rpathModulePath, const std::filesystem::path &rpathRelTargetDir = ".")#
Add a module to the installation manifest (if the module contains components).
- Attention
This function should not be called by the core application, since it imposes a security risk!
- Parameters:
rpathModulePath – [in] Reference to the module path.
rpathRelTargetDir – [in] The relative target directory the module should be stored at.
- Returns:
Returns ‘true’ when successful; ‘false’ when not.
-
std::filesystem::path FindModule(const std::filesystem::path &rpathRelModule) const#
Find the module stored in the installation manifest.
- Parameters:
rpathRelModule – [in] Reference to the path containing the relative path to a module.
- Pre:
Only successful for manifests having an installation directory.
- Returns:
Returns the full path if the module was found or an empty path when not.
-
std::string FindModuleManifest(const std::filesystem::path &rpathRelModule) const#
Find the module manifest.
- Parameters:
rpathRelModule – [in] Reference to the path containing the relative path to a module.
- Pre:
Only successful for manifests having an installation directory.
- Returns:
Returns the string containing the module manifest.
-
std::optional<SComponent> FindComponentByClass(const std::string &rssClass) const#
Find the component stored in this installation manifest.
- Parameters:
rssClass – [in] Reference to the class name of the component.
- Returns:
The component manifest information.
-
std::vector<SComponent> ComponentList() const#
Get a vector of all components stored in this installation manifest.
- Returns:
The component manifest vector.
-
std::vector<std::filesystem::path> ModuleList() const#
Get the module list.
- Returns:
Returns a vector with paths to all modules relative to the installation directory.
-
std::vector<std::pair<std::string, std::string>> PropertyList() const#
Get the property list.
- Returns:
Returns a vector with properties and the corresponding values.
-
void Property(const std::string &rssName, const std::string &rssValue)#
Set a property value.
Set a property value, which will be included in the installation manifest. The properties “Description” and “Version” are used during package management.
Remark
Adding a property with the same name as a previously added property will replace the previous property value.
- Parameters:
rssName – [in] Name of the property. Spaces are allowed. Quotes are not allowed.
rssValue – [in] Property value.
-
std::optional<std::string> Property(const std::string &rssName) const#
Get a property value.
- Parameters:
rssName – [in] Name of the property. Spaces are allowed. Quotes are not allowed.
- Returns:
Returns the property value if existing.
-
struct SComponent#
Manifest information belonging to the component.
Public Types
Public Members
-
std::filesystem::path pathRelModule#
Relative module path (relative to the installation directory).
-
std::string ssManifest#
Component manifest.
-
std::string ssClassName#
String representing the class name.
-
std::string ssDefaultObjectName#
The default object name.
-
sdv::EObjectType eType#
Type of object.
-
uint32_t uiFlags#
Zero or more object flags from EObjectFlags.
-
std::filesystem::path pathRelModule#
-
CInstallManifest() = default#