COMMON: Add case-insensitive comparator and hash for Common::Path
This commit is contained in:
parent
43d7259ff9
commit
ab517cc577
2 changed files with 26 additions and 0 deletions
|
@ -22,6 +22,7 @@
|
|||
#include "common/path.h"
|
||||
#include "common/tokenizer.h"
|
||||
#include "common/punycode.h"
|
||||
#include "common/hash-str.h"
|
||||
|
||||
namespace Common {
|
||||
|
||||
|
@ -232,4 +233,12 @@ bool Path::matchPattern(const Path& pattern) const {
|
|||
return punycodeDecode()._str.matchString(pattern.punycodeDecode()._str, true, wildcardExclusions);
|
||||
}
|
||||
|
||||
bool Path::IgnoreCaseAndMac_EqualsTo::operator()(const Path& x, const Path& y) const {
|
||||
return x.punycodeDecode()._str.equalsIgnoreCase(y.punycodeDecode()._str);
|
||||
}
|
||||
|
||||
uint Path::IgnoreCaseAndMac_Hash::operator()(const Path& x) const {
|
||||
return hashit_lower(x.punycodeDecode()._str.c_str());
|
||||
}
|
||||
|
||||
} // End of namespace Common
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue