13 #ifndef __STOUT_OS_WINDOWS_WHICH_HPP__ 14 #define __STOUT_OS_WINDOWS_WHICH_HPP__ 42 const std::string& command,
58 pathext =
".COM;.EXE;.BAT;.CMD";
67 exts.insert(exts.begin(),
"");
73 foreach (
const std::string& ext, exts) {
74 foreach (
const std::string& token, tokens) {
75 const std::string commandPath =
path::join(token, command + ext);
90 #endif // __STOUT_OS_WINDOWS_WHICH_HPP__
bool exists(const std::string &path)
Definition: exists.hpp:26
Definition: posix_signalhandler.hpp:23
std::string join(const std::string &path1, const std::string &path2, const char _separator=os::PATH_SEPARATOR)
Definition: path.hpp:116
Option< std::string > which(const std::string &command, const Option< std::string > &_path=None())
Definition: which.hpp:31
std::vector< std::string > tokenize(const std::string &s, const std::string &delims, const Option< size_t > &maxTokens=None())
Definition: strings.hpp:139
const T & get() const &
Definition: option.hpp:119
Option< std::string > getenv(const std::string &key)
Definition: getenv.hpp:29
bool isNone() const
Definition: option.hpp:117