00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef CGATOOLS_UTIL_FILES_HPP_
00016 #define CGATOOLS_UTIL_FILES_HPP_ 1
00017
00020
00021 #include "cgatools/core.hpp"
00022
00023 #include <vector>
00024 #include <boost/filesystem.hpp>
00025 #include <boost/regex.hpp>
00026
00027 namespace cgatools { namespace util { namespace files {
00028
00030 bool findFiles( boost::filesystem::path const & directory,
00031 std::string const & filename,
00032 std::vector<boost::filesystem::path> & filesFound,
00033 bool recursive = false,
00034 bool includeDir = false,
00035 boost::regex_constants::syntax_option_type regExOptions = boost::regex_constants::basic);
00036
00038 std::vector<std::string> listDir(const boost::filesystem::path& dir,
00039 const std::string &pattern, size_t maxFiles = std::numeric_limits<size_t>::max());
00040
00042 void check_dir(const boost::filesystem::path& p);
00043
00046 std::string findDataFile(const boost::filesystem::path& dir, const std::string& baseName);
00047
00052 std::string findDataFileRegex(const boost::filesystem::path& dir, const std::string& baseName);
00053
00057 std::string findDataFileRegexMulti(
00058 const boost::filesystem::path& dir,
00059 const std::vector<std::string>& possibleBaseNames,
00060 bool exnOnFail);
00061
00062 } } }
00063
00064 #endif // CGATOOLS_UTIL_FILES_HPP_