23 inline std::string extension(std::string
const &filename,
24 bool toLower =
false) {
26 std::string extension =
"";
27 if (
auto const dotPos = filename.find_last_of(
'.');
28 dotPos != std::string::npos) {
29 extension = filename.substr(dotPos + 1);
33 std::transform(begin(extension), end(extension), begin(extension), tolower);
38 template <
class Extensions>
39 bool checkExtensions(std::string
const &filename, Extensions &&extensions) {
44 auto const ext = extension(filename,
true);
46 return find_if(begin(extensions), end(extensions), [&ext](
auto const &rhs) {
47 std::string query = rhs;
48 std::transform(begin(query), end(query), begin(query), tolower);
50 }) != end(extensions);
Name namespace for CortidQCT library.
Definition: CortidQCT.h:23