15 # pragma warning( disable : 4996 ) 23 # pragma warning( disable : 279 ) 26 #include "boost/filesystem/operations.hpp" 27 #include "boost/tokenizer.hpp" 31 using boost::filesystem::exists;
32 using boost::filesystem::filesystem_error;
33 using boost::filesystem::is_directory;
35 using boost::char_separator;
36 using boost::tokenizer;
42 typedef tokenizer<char_separator<char>> Tokenizer;
44 Tokenizer tok( stringifiedPath, char_separator<char>( separator ) );
48 auto it = tok.begin();
49 while ( it != tok.end() ) {
53 }
catch ( boost::filesystem::filesystem_error& ) {}
61 bool dirExist( existsDir( dir ) );
64 if ( m_dirs.end() ==
std::find_if( m_dirs.begin(), m_dirs.end(),
eqPath( dir ) ) ) m_dirs.push_back( dir );
73 if ( (
rc =
find(
path( fileName ), fileFound ) ) ) fullFileName = fileFound.
string();
81 for (
const auto& iDir : m_dirs ) {
82 path full{iDir / file};
83 if ( exists( full ) ) {
95 for (
const auto& iDir : m_dirs ) {
96 path full{iDir / file};
97 if ( exists( full ) ) found.
push_back( full );
106 rc = is_directory(
path( dirName ) );
boost::filesystem::path path
bool add(const path &dir)
std::list< path > find_all(const path &file) const
returns lists of files found in search path.
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...
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