irccd
3.0.3
|
Namespace for system functions. More...
Functions | |
void | set_program_name (std::string name) noexcept |
auto | name () -> std::string |
auto | version () -> std::string |
auto | uptime () -> std::uint64_t |
auto | ticks () -> std::uint64_t |
auto | env (const std::string &var) -> std::string |
auto | home () -> std::string |
auto | cachedir () -> boost::filesystem::path |
auto | datadir () -> boost::filesystem::path |
auto | sysconfdir () -> boost::filesystem::path |
auto | plugindir () -> boost::filesystem::path |
auto | username () -> std::string |
auto | config_filenames (std::string_view file) -> std::vector< std::string > |
auto | plugin_filenames (const std::string &name, const std::vector< std::string > &extensions) -> std::vector< std::string > |
Namespace for system functions.
auto irccd::sys::cachedir | ( | ) | -> boost::filesystem::path |
Get the cache directory as specified as compile time option IRCCD_INSTALL_LOCALSTATEDIR, if the value is absolute, it is returned as-is.
If the component is relative, it is evaluated using the binary executable path.
auto irccd::sys::config_filenames | ( | std::string_view | file | ) | -> std::vector< std::string > |
Construct a list of paths to read configuration files from.
This function does not test the presence of the files as a condition race may occur.
The caller is responsible of opening files for each path.
file | the filename to append for convenience |
auto irccd::sys::datadir | ( | ) | -> boost::filesystem::path |
auto irccd::sys::env | ( | const std::string & | var | ) | -> std::string |
Get an environment variable.
var | the environment variable |
auto irccd::sys::home | ( | ) | -> std::string |
Get home directory usually /home/foo
auto irccd::sys::name | ( | ) | -> std::string |
Get the system name.
auto irccd::sys::plugin_filenames | ( | const std::string & | name, |
const std::vector< std::string > & | extensions | ||
) | -> std::vector< std::string > |
Construct a list of paths for reading plugins.
name | the plugin id (without extension) |
extensions | the list of extensions supported |
auto irccd::sys::plugindir | ( | ) | -> boost::filesystem::path |
|
noexcept |
Set the program name, needed for some functions or some systems.
name | the program name |
auto irccd::sys::sysconfdir | ( | ) | -> boost::filesystem::path |
Like cachedir but for IRCCD_INSTALL_SYSCONFDIR.
auto irccd::sys::ticks | ( | ) | -> std::uint64_t |
Get the milliseconds elapsed since the application startup.
auto irccd::sys::uptime | ( | ) | -> std::uint64_t |
Get the number of seconds elapsed since the boottime.
auto irccd::sys::username | ( | ) | -> std::string |
Get user account login or empty if not available.
auto irccd::sys::version | ( | ) | -> std::string |
Get the system version.