12#ifndef MCRL2_UTILITIES_FILE_UTILITY_H
13#define MCRL2_UTILITIES_FILE_UTILITY_H
27bool has_extension(
const std::string& filename,
const std::string& extension)
29 assert(extension.size()>=1 && extension[0]!=
'.');
30 std::string dotted_extension=
"."+extension;
31 if (filename.size()<dotted_extension.size())
35 const std::string filename_extension = filename.substr(filename.size()-dotted_extension.size());
36 return filename_extension==dotted_extension;
68 bool matches(
const std::string& filename)
const
100 if (FILE * file = fopen(filename.c_str(),
"r"))
Exception classes for use in libraries and tools.
bool has_extension(const std::string &filename, const std::string &extension)
Returns true if the given filename has the extension ext. The extension does not start with a dot.
bool file_exists(const std::string &filename)
std::ostream & operator<<(std::ostream &ss, const big_natural_number &l)
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...