13 #ifndef __STOUT_OS_POSIX_WHICH_HPP__ 14 #define __STOUT_OS_POSIX_WHICH_HPP__ 32 const std::string& command,
46 foreach (
const std::string& token, tokens) {
47 const std::string commandPath =
path::join(token, command);
57 if (!permissions->
owner.
x &&
72 #endif // __STOUT_OS_POSIX_WHICH_HPP__
bool exists(const std::string &path)
Definition: exists.hpp:26
struct os::Permissions::@21 group
Definition: posix_signalhandler.hpp:23
Try< Permissions > permissions(const std::string &path)
Definition: permissions.hpp:61
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
struct os::Permissions::@21 others
bool isError() const
Definition: try.hpp:78
struct os::Permissions::@21 owner
bool isNone() const
Definition: option.hpp:117
bool x
Definition: permissions.hpp:51