Struct IConfig#
Defined in File config.h
Inheritance Relationships#
Derived Type#
public CAppConfig(Class CAppConfig)
Struct Documentation#
-
struct IConfig#
Application configuration.
- Attention
This interface is available for the standalone and essential application. The main, isolated and maintenance applications cannot use this interface.
Subclassed by CAppConfig
Public Functions
-
virtual EConfigProcessResult ProcessConfig(const sdv::u8string &ssContent) = 0#
Process the provided configuration by loading modules and creating objects/stubs/proxies defined in the configuration string. Processing a configuration resets the baseline before processing.
- Attention
Configuration changes can only occur when the system is in configuration mode.
- Parameters:
ssContent – [in] The contents of the configuration file (TOML).
- Returns:
Returns a config process result enum value.
-
virtual EConfigProcessResult LoadConfig(const sdv::u8string &ssConfigPath) = 0#
Read file pointed to by the provided file path and load modules and create components as defined in the configuration file. Loading a configuration resets the baseline before processing.
- Attention
Configuration changes can only occur when the system is in configuration mode.
- Parameters:
ssConfigPath – [in] Path to the file containing the configuration (TOML). The path can be an absolute as well as a relative path. In case a relative path is provided, the executable directory is searched as well as all directories supplied through the AddConfigSearchDir function.
- Returns:
Returns a config process result enum value.
-
virtual bool SaveConfig(const sdv::u8string &ssConfigPath) const = 0#
Save a configuration file pointed to by the provided file path. All components are saved that were added after the last baseline with the configuration specific settings.
Remark
The function will only save when the configuration has changed.
- Parameters:
ssConfigPath – [in] Path to the file containing the configuration (TOML). The path can be an absolute as well as a relative path. In case a relative path is provided, the configuration is stored relative to the executable directory.
- Returns:
Returns ‘true’ on success (or no changes detected); ‘false’ otherwise.
-
virtual sdv::u8string GenerateConfigString() const = 0#
Generate the configuration TOML string.
- Returns:
The generated configuration string.
-
virtual void CloseConfig() = 0#
Close the current configuration.
This will close und unload the components and modules from the current configuration as well as dependent components that builds on top of the components being closed. Components that the current configuration depends on are not closed.
-
virtual bool AddConfigSearchDir(const sdv::u8string &ssDir) = 0#
Add a search path to a folder where a config file can be found.
- Parameters:
ssDir – [in] Relative or absolute path to an existing folder.
- Returns:
Returns ‘true’ on success; ‘false’ otherwise.
-
virtual void ResetConfigBaseline() = 0#
Reset the configuration baseline.
The configuration baseline determines what belongs to the current configuration. Any object being added after this baseline will be stored in a configuration file.
- EConfigProcessResult ProcessConfig (in u8string ssContent)
Process the provided configuration by loading modules and creating objects/stubs/proxies defined in the configuration string. Processing a configuration resets the baseline before processing.
- Attention
Configuration changes can only occur when the system is in configuration mode.
- Parameters:
ssContent – [in] The contents of the configuration file (TOML).
- Returns:
Returns a config process result enum value.
- EConfigProcessResult LoadConfig (in u8string ssConfigPath)
Read file pointed to by the provided file path and load modules and create components as defined in the configuration file. Loading a configuration resets the baseline before processing.
- Attention
Configuration changes can only occur when the system is in configuration mode.
- Parameters:
ssConfigPath – [in] Path to the file containing the configuration (TOML). The path can be an absolute as well as a relative path. In case a relative path is provided, the executable directory is searched as well as all directories supplied through the AddConfigSearchDir function.
- Returns:
Returns a config process result enum value.
- boolean SaveConfig (in u8string ssConfigPath) const
Save a configuration file pointed to by the provided file path. All components are saved that were added after the last baseline with the configuration specific settings.
Remark
The function will only save when the configuration has changed.
- Parameters:
ssConfigPath – [in] Path to the file containing the configuration (TOML). The path can be an absolute as well as a relative path. In case a relative path is provided, the configuration is stored relative to the executable directory.
- Returns:
Returns ‘true’ on success (or no changes detected); ‘false’ otherwise.
-
u8string GenerateConfigString() const
Generate the configuration TOML string.
- Returns:
The generated configuration string.
-
void CloseConfig()
Close the current configuration.
This will close und unload the components and modules from the current configuration as well as dependent components that builds on top of the components being closed. Components that the current configuration depends on are not closed.
- boolean AddConfigSearchDir (in u8string ssDir)
Add a search path to a folder where a config file can be found.
- Parameters:
ssDir – [in] Relative or absolute path to an existing folder.
- Returns:
Returns ‘true’ on success; ‘false’ otherwise.
-
void ResetConfigBaseline()
Reset the configuration baseline.
The configuration baseline determines what belongs to the current configuration. Any object being added after this baseline will be stored in a configuration file.
Public Static Attributes
-
static constexpr ::sdv::interface_id _id = 0xD357F9D74CC00EE2#
Interface ID.