17 #include <deal.II/base/logstream.h> 18 #include <deal.II/base/path_search.h> 19 #include <deal.II/base/utilities.h> 25 DEAL_II_NAMESPACE_OPEN
35 std::vector<std::string> v;
46 v.emplace_back(
".prm");
59 v.emplace_back(
".inp");
60 v.emplace_back(
".xda");
61 v.emplace_back(
".dbmesh");
62 v.emplace_back(
".dat");
63 v.emplace_back(
".plt");
64 v.emplace_back(
".nc");
65 v.emplace_back(
".msh");
69 std::vector<std::string> &
86 std::vector<std::string> &
105 , my_path_list(get_path_list(cls))
106 , my_suffix_list(get_suffix_list(cls))
113 const std::string &suffix,
114 const char * open_mode)
116 std::vector<std::string>::const_iterator path;
117 const std::vector<std::string>::const_iterator endp =
my_path_list.end();
119 std::string real_name;
123 <<
" directories " << std::endl;
132 real_name = *path + filename;
134 deallog <<
"PathSearch[" <<
cls <<
"] trying " << real_name
136 FILE *fp = fopen(real_name.c_str(), open_mode);
140 deallog <<
"PathSearch[" <<
cls <<
"] opened " << real_name
151 real_name = *path + filename + suffix;
153 deallog <<
"PathSearch[" <<
cls <<
"] trying " << real_name
155 FILE *fp = fopen(real_name.c_str(), open_mode);
159 deallog <<
"PathSearch[" <<
cls <<
"] opened " << real_name
167 return std::string(
"");
173 std::vector<std::string>::const_iterator suffix;
174 const std::vector<std::string>::const_iterator ends =
my_suffix_list.end();
185 return find(filename, *suffix, open_mode);
193 return std::string(
"");
206 std::vector<std::string> v;
218 else if (pos ==
front)
222 std::vector<std::string>::iterator i =
236 else if (pos ==
front)
240 std::vector<std::string>::iterator i =
250 DEAL_II_NAMESPACE_CLOSE
Add in path list after empty element.
static std::map< std::string, std::vector< std::string > > path_lists
static void add_class(const std::string &cls)
void add_path(const std::string &path, Position pos=back)
#define AssertThrow(cond, exc)
static std::map< std::string, std::vector< std::string > > suffix_lists
static std::vector< std::string > & get_suffix_list(const std::string &cls)
Add new item at end of list.
std::vector< std::string > & my_suffix_list
std::map< std::string, std::vector< std::string > >::value_type map_type
static ::ExceptionBase & ExcFileNotFound(std::string arg1, std::string arg2)
static void initialize_classes()
std::vector< std::string > & my_path_list
#define Assert(cond, exc)
std::string find(const std::string &filename, const char *open_mode="r")
static std::vector< std::string > & get_path_list(const std::string &cls)
void add_suffix(const std::string &suffix, Position pos=back)
PathSearch(const std::string &cls, const unsigned int debug=0)
Add new item at front of list.
static ::ExceptionBase & ExcInternalError()