| 1738 | } |
| 1739 | |
| 1740 | BfTypeOptions* BfModule::GetTypeOptions(BfTypeDef* typeDef) |
| 1741 | { |
| 1742 | if (mContext->mSystem->mTypeOptions.size() == 0) |
| 1743 | { |
| 1744 | return NULL; |
| 1745 | } |
| 1746 | |
| 1747 | Array<int> matchedIndices; |
| 1748 | |
| 1749 | if (!mCompiler->mAttributeTypeOptionMap.IsEmpty()) |
| 1750 | { |
| 1751 | auto customAttributes = typeDef->mTypeDeclaration->mAttributes; |
| 1752 | |
| 1753 | while (customAttributes != NULL) |
| 1754 | { |
| 1755 | if (!mCompiler->mAttributeTypeOptionMap.IsEmpty()) |
| 1756 | { |
| 1757 | SetAndRestoreValue<bool> prevIgnoreErrors(mIgnoreErrors, true); |
| 1758 | |
| 1759 | auto typeRef = customAttributes->mAttributeTypeRef; |
| 1760 | |
| 1761 | // StringT<128> attrName; |
| 1762 | // for (auto& customAttrs : customAttributes->mAttributeTypeRef) |
| 1763 | // { |
| 1764 | // attrName.Clear(); |
| 1765 | // customAttrs.mType->mTypeDef->mFullName.ToString(attrName); |
| 1766 | // Array<int>* arrPtr; |
| 1767 | // if (mCompiler->mAttributeTypeOptionMap.TryGetValue(attrName, &arrPtr)) |
| 1768 | // { |
| 1769 | // for (auto optionsIdx : *arrPtr) |
| 1770 | // { |
| 1771 | // matchedIndices.Add(optionsIdx); |
| 1772 | // } |
| 1773 | // } |
| 1774 | // } |
| 1775 | } |
| 1776 | |
| 1777 | customAttributes = customAttributes->mNextAttribute; |
| 1778 | } |
| 1779 | } |
| 1780 | |
| 1781 | int typeOptionsCount = (int)mContext->mSystem->mTypeOptions.size(); |
| 1782 | |
| 1783 | auto _CheckTypeName = [&](const StringImpl& typeName) |
| 1784 | { |
| 1785 | for (int optionIdx = 0; optionIdx < (int)mContext->mSystem->mTypeOptions.size(); optionIdx++) |
| 1786 | { |
| 1787 | auto& typeOptions = mContext->mSystem->mTypeOptions[optionIdx]; |
| 1788 | |
| 1789 | bool matched = false; |
| 1790 | for (auto& filter : typeOptions.mTypeFilters) |
| 1791 | { |
| 1792 | int filterIdx = 0; |
| 1793 | int typeNameIdx = 0; |
| 1794 | |
| 1795 | const char* filterPtr = filter.c_str(); |
| 1796 | const char* namePtr = typeName.c_str(); |
| 1797 |
no test coverage detected