OovStringVec ComponentTypesFile::getComponentFiles(OovStringRef const compName, OovStringRef const tagStr, bool getNested) const { OovStringVec files; OovStringVec names = getComponentNames(); OovString parentName = compName; for(auto const &name : names) { bool match = false; if(getNested) { if(strcmp(compName, Project::getRootComponentName()) == 0) { match = true; } else { match = compareComponentNames(parentName, name); } } else { match = (parentName == name); } if(match) { OovString tag = ComponentTypesFile::getCompTagName(name, tagStr); OovString val = mCompSourceListFile.getValue(tag); OovStringVec newFiles = CompoundValueRef::parseString(val); files.insert(files.end(), newFiles.begin(), newFiles.end()); } } return files; }
bool ComponentTypesFile::anyComponentsDefined() const { auto const &names = getComponentNames(); return std::any_of(names.begin(), names.end(), [=](std::string const &name) {return(getComponentType(name) != CT_Unknown);} ); }
void ComponentTypesFile::coerceChildComponents(OovStringRef const compName) { OovStringVec names = getComponentNames(); OovString parentName = compName; for(auto const &name : names) { if(name != parentName) { if(compareComponentNames(parentName, name)) { setComponentType(name, CT_Unknown); } } } }
void Matcher::setComponentNames(const std::shared_ptr<Matcher> &matcher, std::vector<IMatcher> &matchers) { auto componentNames = getComponentNames(matchers); if(componentNames.size() > 0) matcher->componentNames = componentNames; }