Warning, file /include/boost/process/v1/detail/windows/env_init.hpp was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007 #ifndef BOOST_PROCESS_DETAIL_WINDOWS_ENV_INIT_HPP_
0008 #define BOOST_PROCESS_DETAIL_WINDOWS_ENV_INIT_HPP_
0009
0010 #include <boost/winapi/error_codes.hpp>
0011 #include <boost/winapi/process.hpp>
0012
0013
0014 #include <boost/process/v1/detail/config.hpp>
0015 #include <boost/process/v1/detail/handler_base.hpp>
0016 #include <boost/process/v1/environment.hpp>
0017
0018 namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace windows {
0019
0020 template<typename Char>
0021 struct env_init : public ::boost::process::v1::detail::handler_base
0022 {
0023 boost::process::v1::basic_environment<Char> env;
0024
0025 env_init(boost::process::v1::basic_environment<Char> && env) : env(std::move(env)) {};
0026 env_init(const boost::process::v1::basic_environment<Char> & env) : env(env) {};
0027
0028 constexpr static ::boost::winapi::DWORD_ creation_flag(char) {return 0u;}
0029 constexpr static ::boost::winapi::DWORD_ creation_flag(wchar_t)
0030 {
0031 return ::boost::winapi::CREATE_UNICODE_ENVIRONMENT_;
0032 }
0033
0034 template <class WindowsExecutor>
0035 void on_setup(WindowsExecutor &exec) const
0036 {
0037 auto e = env.native_handle();
0038 if (*e == null_char<char>())
0039 {
0040 exec.set_error(std::error_code(::boost::winapi::ERROR_BAD_ENVIRONMENT_, std::system_category()),
0041 "Empty Environment");
0042 }
0043
0044 exec.env = e;
0045 exec.creation_flags |= creation_flag(Char());
0046 }
0047
0048 };
0049
0050 }}}}}
0051
0052
0053
0054 #endif