18# pragma warning( disable : 279 )
21#include <boost/filesystem/operations.hpp>
22#include <boost/tokenizer.hpp>
26using boost::filesystem::exists;
27using boost::filesystem::filesystem_error;
28using boost::filesystem::is_directory;
30using boost::char_separator;
31using boost::tokenizer;
37 typedef tokenizer<char_separator<char>> Tokenizer;
39 Tokenizer tok( stringifiedPath, char_separator<char>( separator ) );
43 auto it = tok.begin();
44 while ( it != tok.end() ) {
48 }
catch ( boost::filesystem::filesystem_error& ) {}
68 if ( ( rc =
find(
path( fileName ), fileFound ) ) ) fullFileName = fileFound.string();
76 for (
const auto& iDir :
m_dirs ) {
77 path full{ iDir / file };
78 if ( exists( full ) ) {
89 std::list<path> found;
90 for (
const auto& iDir :
m_dirs ) {
91 path full{ iDir / file };
92 if ( exists( full ) ) found.push_back( full );
101 rc = is_directory(
path( dirName ) );
search for files in a list of directories
std::list< path > find_all(const path &file) const
returns lists of files found in search path.
static bool existsDir(const std::string &dirName)
check dirName is valid
boost::filesystem::path path
bool addCWD()
add current work dir (*nix pwd) to 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::vector< path > m_dirs
the dir container