add 'nf7::' prefix to flags of File::TypeInfo

This commit is contained in:
2022-08-15 00:29:03 +09:00
parent ed970d45c6
commit 0f5e3c6246
15 changed files with 40 additions and 33 deletions

View File

@@ -25,11 +25,14 @@ bool FileFactory::Update() noexcept {
for (const auto& reg : nf7::File::registry()) {
const auto& t = *reg.second;
const bool name_match =
type_filter_.empty() || t.name().find(type_filter_) != std::string::npos;
const bool match =
t.flags().contains("nf7::File::TypeInfo::Factory") &&
(type_filter_.empty() ||
t.name().find(type_filter_) != std::string::npos) &&
filter_(t);
const bool sel = (type_ == &t);
if (!name_match || !filter_(t)) {
if (!match) {
if (sel) type_ = nullptr;
continue;
}