add and use path_extension_is()

This commit is contained in:
Garux
2021-10-03 17:13:12 +03:00
parent a0e79e8ecd
commit b6d60fb17c
20 changed files with 50 additions and 63 deletions

View File

@@ -185,6 +185,12 @@ inline bool extension_equal( const char* extension, const char* other ){
return string_equal_nocase( extension, other );
}
/// \brief Returns true if \p extension equals one of \p path. \p extension without period.
/// O(n)
inline bool path_extension_is( const char* path, const char* extension ){
return extension_equal( path_get_extension( path ), extension );
}
template<typename Functor>
class MatchFileExtension
{