|
||||
File indexing completed on 2025-01-18 09:50:14
0001 // Copyright (c) 2006, 2007 Julio M. Merino Vidal 0002 // Copyright (c) 2008 Ilya Sokolov, Boris Schaeling 0003 // Copyright (c) 2009 Boris Schaeling 0004 // Copyright (c) 2010 Felipe Tanus, Boris Schaeling 0005 // Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling 0006 // 0007 // Distributed under the Boost Software License, Version 1.0. (See accompanying 0008 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 0009 0010 /** 0011 * \file boost/process/search_path.hpp 0012 * 0013 * Defines a function to search for an executable in path. 0014 */ 0015 0016 #ifndef BOOST_PROCESS_SEARCH_PATH_HPP 0017 #define BOOST_PROCESS_SEARCH_PATH_HPP 0018 0019 #include <boost/process/detail/config.hpp> 0020 #include <boost/process/environment.hpp> 0021 0022 #if defined(BOOST_POSIX_API) 0023 #include <boost/process/detail/posix/search_path.hpp> 0024 #elif defined(BOOST_WINDOWS_API) 0025 #include <boost/process/detail/windows/search_path.hpp> 0026 #endif 0027 0028 0029 namespace boost { namespace process { 0030 0031 /** 0032 * Searches for an executable in path. 0033 * 0034 * filename must be a basename including the file extension. 0035 * It must not include any directory separators (like a slash). 0036 * On Windows the file extension may be omitted. The function 0037 * will then try the various file extensions for executables on 0038 * Windows to find filename. 0039 * 0040 * \param filename The base of the filename to find 0041 * 0042 * \param path the set of paths to search, defaults to the "PATH" environment variable. 0043 * 0044 * \returns the absolute path to the executable filename or an 0045 * empty string if filename isn't found 0046 */ 0047 inline boost::process::filesystem::path search_path(const boost::process::filesystem::path &filename, 0048 const std::vector<boost::process::filesystem::path> path = ::boost::this_process::path()) 0049 { 0050 return ::boost::process::detail::api::search_path(filename, path); 0051 } 0052 }} 0053 0054 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |