CommonLib
Toggle main menu visibility
Loading...
Searching...
No Matches
environment.h
Go to the documentation of this file.
1
#
pragma
once
2
3
#
include
<
filesystem
>
4
#
include
<
optional
>
5
6
#
include
"ut/expr/string_expr.h"
7
8
namespace
hedgedev::csl::host::
environment
9
{
10
///
11
/// Gets a file in the host environment.
12
///
13
/// \param in_filename The file to search for.
14
///
15
/// \returns The path to the file, if found.
16
///
17
inline
std
::
optional
<
std
::
filesystem
::
path
>
get_file
(
const
std
::
filesystem
::
path
&
in_filename
);
18
19
///
20
/// Gets a variable in the host environment.
21
///
22
/// \tparam T_result The value type to parse.
23
/// \tparam T_name The name string type.
24
///
25
/// \param in_name The variable to search for.
26
/// \param in_default_value The default value to use, if the variable could not
27
/// be found.
28
///
29
/// \returns The value of the variable, if found.
30
///
31
template
<
typename
T_result, ut::expr::any_string T_name>
32
inline
std
::
optional
<
T_result
>
get_variable
(
const
T_name
&
in_name
,
std
::
optional
<
T_result
>
in_default_value
=
std
::
nullopt
);
33
}
34
35
#
ifdef
WIN32
36
#
include
"os/environment_win32.inl"
37
#
endif
38
39
__CMNLIB_INTERNAL_MAKE_NAMESPACE_ALIAS(hedgedev::csl::host, environment, env);
hedgedev::csl::host::environment
Definition
environment_win32.inl:10
hedgedev::csl::host::environment::get_variable
std::optional< T_result > get_variable(const T_name &in_name, std::optional< T_result > in_default_value)
Definition
environment_win32.inl:24
hedgedev::csl::host::environment::get_file
std::optional< std::filesystem::path > get_file(const std::filesystem::path &in_filename)
Definition
environment_win32.inl:11
include
host
environment.h
Generated by
1.18.0