add 'nf7::' prefix to flags of File::TypeInfo
This commit is contained in:
@@ -54,7 +54,9 @@ class GenericTypeInfo : public File::TypeInfo {
|
||||
private:
|
||||
static std::unordered_set<std::string> AddFlags(
|
||||
std::unordered_set<std::string>&& flags) noexcept {
|
||||
if (std::is_constructible<T, Env&>::value) flags.insert("File_Factory");
|
||||
if (std::is_constructible<T, Env&>::value) {
|
||||
flags.insert("nf7::File::TypeInfo::Factory");
|
||||
}
|
||||
return flags;
|
||||
}
|
||||
};
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user