|
lintel 0.2.0
|
#include <EnvironmentConfiguration.h>
Public Types | |
| enum | Environment : std::uint8_t { ConfigDirectory , BootstrapConfigName , Home , Path } |
Public Member Functions | |
| EnvironmentConfiguration () | |
| ~EnvironmentConfiguration ()=default | |
| const std::string & | of (Environment environment) |
| std::vector< std::filesystem::path > | pathsOf () |
| std::optional< std::filesystem::path > | pathOf (const std::string &fileName) |
| void | overrides (Environment environment, const std::string &value) |
Static Public Member Functions | |
| static std::string | expand (const std::string &value) |
Provides environment-specific configuration values and file path resolution
| enum lintel::EnvironmentConfiguration::Environment : std::uint8_t |
Environment configuration keys
| Enumerator | |
|---|---|
| ConfigDirectory | Configuration directory |
| BootstrapConfigName | Bootstrap configuration file name |
| Home | Home directory |
| Path | Search path |
| lintel::EnvironmentConfiguration::EnvironmentConfiguration | ( | ) |
Construct an environment configuration from the current process environment
|
default |
Destructor
Expand environment variables in the given string.
Expands every occurrence of ${NAME} where NAME matches [A-Za-z_][A-Za-z0-9_]*.
Note: This is a simple expansion and may expand ${...} inside XML comments when the variable is set (this is acceptable for bootstrap configuration).
| value | The string to expand |
| const std::string & lintel::EnvironmentConfiguration::of | ( | Environment | environment | ) |
Get the value for the given environment key
| environment | The environment key |
| void lintel::EnvironmentConfiguration::overrides | ( | Environment | environment, |
| const std::string & | value | ||
| ) |
Override an environment value
| environment | The environment key to override |
| value | The new value |
| std::optional< std::filesystem::path > lintel::EnvironmentConfiguration::pathOf | ( | const std::string & | fileName | ) |
Find a file by name in the configured search paths
| fileName | The file name to search for |
| std::vector< std::filesystem::path > lintel::EnvironmentConfiguration::pathsOf | ( | ) |
Get all configured search paths