X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fnetradiant.git;a=blobdiff_plain;f=libs%2Fos%2Fpath.h;h=9cbbc2b1361c49a21b48acb82be6b95af3e69831;hp=a3db167cb484ad84abbff192fc9289ae3408fcc1;hb=32dc1da26645b97a5823ff22175000542225c6dd;hpb=09c7358f15264e0436c4f1b762d942e2570af831 diff --git a/libs/os/path.h b/libs/os/path.h index a3db167c..9cbbc2b1 100644 --- a/libs/os/path.h +++ b/libs/os/path.h @@ -72,6 +72,12 @@ inline bool path_equal( const char* path, const char* other ){ #endif } +/// \brief Returns true if \p path and \p other refer to the same file or directory, case insensitively. +/// O(n) +inline bool path_equal_i( const char* path, const char* other ){ + return string_equal_nocase( path, other ); +} + /// \brief Returns true if the first \p n bytes of \p path and \p other form paths that refer to the same file or directory. /// If the paths are UTF-8 encoded, [\p path, \p path + \p n) must be a complete path. /// O(n) @@ -175,6 +181,12 @@ inline bool extension_equal( const char* extension, const char* other ){ return path_equal( extension, other ); } +/// \brief Returns true if \p extension is of the same type as \p other, case insensitively. +/// O(n) +inline bool extension_equal_i( const char* extension, const char* other ){ + return path_equal_i( extension, other ); +} + template class MatchFileExtension {