5 #pragma warning(disable:4996) 13 #pragma warning(disable:279) 15 #include "boost/filesystem/operations.hpp" 16 #include "boost/tokenizer.hpp" 21 using boost::filesystem::filesystem_error;
22 using boost::filesystem::exists;
23 using boost::filesystem::is_directory;
25 using boost::tokenizer;
26 using boost::char_separator;
32 typedef tokenizer<char_separator<char> > Tokenizer;
34 Tokenizer tok(stringifiedPath, char_separator<char>(separator));
38 auto it = tok.begin();
39 while(it != tok.end()) {
44 catch (boost::filesystem::filesystem_error &) {
51 return add(boost::filesystem::current_path());
55 bool dirExist(existsDir(dir));
59 m_dirs.push_back(dir);
68 if ( (rc =
find(
path(fileName), fileFound)) )
69 fullFileName = fileFound.
string();
77 for (
const auto& iDir : m_dirs ) {
78 path full{iDir / file};
92 for (
const auto& iDir : m_dirs ) {
93 path full{iDir / file};
103 rc=is_directory(
path(dirName));
108 return (exists(dir) && is_directory(dir));
boost::filesystem::path path
bool add(const path &dir)
bool find(const std::string &fileName, std::string &fullFileName) const
returns a flag if fileName found in search path, and sets ref to fully qualified file name (in native...
std::list< path > find_all(const path &file) const
returns lists of files found in search path.
bool addCWD()
add current work dir (*nix pwd) to path
search for files in a list of directories
static bool existsDir(const std::string &dirName)
check dirName is valid