mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 21:00:17 +02:00
This wasn't quite wired up exactly how we wanted it. It was previously
matching against the opaque file config handle, which can be anything.
Instead compare it to the appname that now gets passed over to it for
matching.
This allows us to do the following:
```
{
"Config": {
"ProfileStats": "1",
"X87ReducedPrecision": "1",
"TSOEnabled": "1",
"VectorTSOEnabled": "0",
"MemcpySetTSOEnabled": "0",
"HalfBarrierTSOEnabled":"1",
"MaxInst": "500",
"Multiblock": "1"
},
"AppOverrides" : {
"setup*" : {
"Comment": [
"292030 - The Witcher 3: Wild Hunt"
],
"X87ReducedPrecision": "0"
}
}
}
```
Based on #121 which needs to get merged first.
Code Review
Code Review: Class deletion
24 lines
860 B
C++
24 lines
860 B
C++
// SPDX-License-Identifier: MIT
|
|
|
|
#include <FEXCore/Utils/WildcardMatcher.h>
|
|
|
|
namespace FEXCore::Utils::Wildcard {
|
|
static bool matchHelper(std::string_view pattern, std::string_view text, size_t p_idx, size_t t_idx) {
|
|
if (p_idx == pattern.size()) {
|
|
// Pattern exhausted
|
|
return (t_idx == text.size());
|
|
} else if (pattern[p_idx] == '*') {
|
|
// Wildcard: Try matching zero characters, or one or more characters
|
|
return matchHelper(pattern, text, p_idx + 1, t_idx) || (t_idx < text.size() && matchHelper(pattern, text, p_idx, t_idx + 1));
|
|
} else {
|
|
// Match normally
|
|
return (t_idx < text.size() && pattern[p_idx] == text[t_idx] && matchHelper(pattern, text, p_idx + 1, t_idx + 1));
|
|
}
|
|
}
|
|
|
|
bool Matches(std::string_view pattern, std::string_view text) {
|
|
return matchHelper(pattern, text, 0, 0);
|
|
}
|
|
|
|
} // namespace FEXCore::Utils::Wildcard
|