8 #define SCARAB_API_EXPORTS 16 using boost::filesystem::absolute;
22 string t_exp_path( a_path );
25 wordexp_t t_expansion_result;
26 wordexp( a_path.c_str(), &t_expansion_result, 0 );
27 if( t_expansion_result.we_wordc > 0 )
29 t_exp_path = string( t_expansion_result.we_wordv[0] );
32 wordfree( &t_expansion_result );
35 return absolute( t_exp_path );
38 std::vector< path >
SCARAB_API glob(
const string& a_path,
const string& a_pattern )
40 std::vector< path > t_file_paths;
42 for( fs::directory_entry& dir_entry: fs::recursive_directory_iterator(t_abs_path) )
44 path t_file_path=dir_entry.path();
45 if ( ! std::regex_search( t_file_path.string(), std::regex(a_pattern) ) )
continue;
46 t_file_paths.push_back( t_file_path );
path expand_path(const string &a_path)
std::vector< path > glob(const string &a_path, const string &a_pattern)