本文整理汇总了C++中ObjCCategoryDecl::FindPropertyDeclaration方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjCCategoryDecl::FindPropertyDeclaration方法的具体用法?C++ ObjCCategoryDecl::FindPropertyDeclaration怎么用?C++ ObjCCategoryDecl::FindPropertyDeclaration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjCCategoryDecl
的用法示例。
在下文中一共展示了ObjCCategoryDecl::FindPropertyDeclaration方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
/// FindPropertyDeclaration - Finds declaration of the property given its name
/// in 'PropertyId' and returns it. It returns 0, if not found.
ObjCPropertyDecl *
ObjCContainerDecl::FindPropertyDeclaration(IdentifierInfo *PropertyId) const {
if (ObjCPropertyDecl *PD =
ObjCPropertyDecl::findPropertyDecl(cast<DeclContext>(this), PropertyId))
return PD;
switch (getKind()) {
default:
break;
case Decl::ObjCProtocol: {
const ObjCProtocolDecl *PID = cast<ObjCProtocolDecl>(this);
for (ObjCProtocolDecl::protocol_iterator I = PID->protocol_begin(),
E = PID->protocol_end(); I != E; ++I)
if (ObjCPropertyDecl *P = (*I)->FindPropertyDeclaration(PropertyId))
return P;
break;
}
case Decl::ObjCInterface: {
const ObjCInterfaceDecl *OID = cast<ObjCInterfaceDecl>(this);
// Look through categories.
for (ObjCCategoryDecl *Cat = OID->getCategoryList();
Cat; Cat = Cat->getNextClassCategory())
if (!Cat->IsClassExtension())
if (ObjCPropertyDecl *P = Cat->FindPropertyDeclaration(PropertyId))
return P;
// Look through protocols.
for (ObjCInterfaceDecl::all_protocol_iterator
I = OID->all_referenced_protocol_begin(),
E = OID->all_referenced_protocol_end(); I != E; ++I)
if (ObjCPropertyDecl *P = (*I)->FindPropertyDeclaration(PropertyId))
return P;
// Finally, check the super class.
if (const ObjCInterfaceDecl *superClass = OID->getSuperClass())
return superClass->FindPropertyDeclaration(PropertyId);
break;
}
case Decl::ObjCCategory: {
const ObjCCategoryDecl *OCD = cast<ObjCCategoryDecl>(this);
// Look through protocols.
if (!OCD->IsClassExtension())
for (ObjCCategoryDecl::protocol_iterator
I = OCD->protocol_begin(), E = OCD->protocol_end(); I != E; ++I)
if (ObjCPropertyDecl *P = (*I)->FindPropertyDeclaration(PropertyId))
return P;
break;
}
}
return 0;
}