clang API Documentation
#include <DeclObjC.h>


ObjCCategoryDecl - Represents a category declaration. A category allows you to add methods to an existing class (without subclassing or modifying the original class interface or implementation:-). Categories don't allow you to add instance data. The following example adds "myMethod" to all NSView's within a process:
@interface NSView (MyViewMethods)
Categories also allow you to split the implementation of a class across several files (a feature more naturally supported in C++).
Categories were originally inspired by dynamic languages such as Common Lisp and Smalltalk. More traditional class-based languages (C++, Java) don't support this level of dynamism, which is both powerful and dangerous.
Definition at line 1715 of file DeclObjC.h.
Definition at line 1809 of file DeclObjC.h.
| typedef llvm::iterator_range<specific_decl_iterator<ObjCIvarDecl> > clang::ObjCCategoryDecl::ivar_range |
Definition at line 1810 of file DeclObjC.h.
Definition at line 1775 of file DeclObjC.h.
Definition at line 1786 of file DeclObjC.h.
| typedef llvm::iterator_range<protocol_loc_iterator> clang::ObjCCategoryDecl::protocol_loc_range |
Definition at line 1787 of file DeclObjC.h.
| typedef llvm::iterator_range<protocol_iterator> clang::ObjCCategoryDecl::protocol_range |
Definition at line 1776 of file DeclObjC.h.
| static bool clang::ObjCCategoryDecl::classof | ( | const Decl * | D | ) | [inline, static] |
Reimplemented from clang::ObjCContainerDecl.
Definition at line 1834 of file DeclObjC.h.
References classofKind(), and clang::Decl::getKind().
| static bool clang::ObjCCategoryDecl::classofKind | ( | Kind | K | ) | [inline, static] |
Reimplemented from clang::ObjCContainerDecl.
Definition at line 1835 of file DeclObjC.h.
Referenced by classof().
| ObjCCategoryDecl * ObjCCategoryDecl::Create | ( | ASTContext & | C, |
| DeclContext * | DC, | ||
| SourceLocation | AtLoc, | ||
| SourceLocation | ClassNameLoc, | ||
| SourceLocation | CategoryNameLoc, | ||
| IdentifierInfo * | Id, | ||
| ObjCInterfaceDecl * | IDecl, | ||
| SourceLocation | IvarLBraceLoc = SourceLocation(), |
||
| SourceLocation | IvarRBraceLoc = SourceLocation() |
||
| ) | [static] |
Definition at line 1652 of file DeclObjC.cpp.
References AttributeLangSupport::C, clang::ASTContext::getASTMutationListener(), clang::ObjCInterfaceDecl::getCategoryListRaw(), clang::ObjCInterfaceDecl::hasDefinition(), and clang::ObjCInterfaceDecl::setCategoryListRaw().
Referenced by clang::Sema::ActOnStartCategoryImplementation(), clang::Sema::ActOnStartCategoryInterface(), and clang::ASTNodeImporter::VisitObjCCategoryDecl().
| ObjCCategoryDecl * ObjCCategoryDecl::CreateDeserialized | ( | ASTContext & | C, |
| unsigned | ID | ||
| ) | [static] |
Definition at line 1676 of file DeclObjC.cpp.
References AttributeLangSupport::C.
| SourceLocation clang::ObjCCategoryDecl::getCategoryNameLoc | ( | ) | const [inline] |
Definition at line 1826 of file DeclObjC.h.
Referenced by clang::ASTDeclWriter::VisitObjCCategoryDecl(), and clang::ASTNodeImporter::VisitObjCCategoryDecl().
| ObjCInterfaceDecl* clang::ObjCCategoryDecl::getClassInterface | ( | ) | [inline] |
Definition at line 1758 of file DeclObjC.h.
Referenced by clang::ASTWriter::AddedObjCPropertyInClassExtension(), clang::Sema::CheckCategoryVsClassMethodMatches(), CheckProtocolMethodDefs(), clang::Sema::DiagnoseUnimplementedProperties(), clang::ObjCIvarDecl::getContainingInterface(), clang::Sema::HandlePropertyInClassExtension(), clang::ASTDeclWriter::VisitObjCCategoryDecl(), clang::ASTNodeImporter::VisitObjCCategoryDecl(), and clang::ASTNodeImporter::VisitObjCCategoryImplDecl().
| const ObjCInterfaceDecl* clang::ObjCCategoryDecl::getClassInterface | ( | ) | const [inline] |
Definition at line 1759 of file DeclObjC.h.
Definition at line 1683 of file DeclObjC.cpp.
References clang::Decl::getASTContext(), and clang::ASTContext::getObjCImplementation().
Referenced by clang::Sema::ActOnStartCategoryImplementation(), clang::ASTNodeImporter::VisitObjCCategoryDecl(), and clang::ASTNodeImporter::VisitObjCCategoryImplDecl().
| SourceLocation clang::ObjCCategoryDecl::getIvarLBraceLoc | ( | ) | const [inline] |
Definition at line 1830 of file DeclObjC.h.
Referenced by clang::ASTDeclWriter::VisitObjCCategoryDecl(), and clang::ASTNodeImporter::VisitObjCCategoryDecl().
| SourceLocation clang::ObjCCategoryDecl::getIvarRBraceLoc | ( | ) | const [inline] |
Definition at line 1832 of file DeclObjC.h.
Referenced by clang::ASTDeclWriter::VisitObjCCategoryDecl(), and clang::ASTNodeImporter::VisitObjCCategoryDecl().
| ObjCCategoryDecl* clang::ObjCCategoryDecl::getNextClassCategory | ( | ) | const [inline] |
Definition at line 1799 of file DeclObjC.h.
| ObjCCategoryDecl* clang::ObjCCategoryDecl::getNextClassCategoryRaw | ( | ) | const [inline] |
Retrieve the pointer to the next stored category (or extension), which may be hidden.
Definition at line 1803 of file DeclObjC.h.
| const ObjCProtocolList& clang::ObjCCategoryDecl::getReferencedProtocols | ( | ) | const [inline] |
Definition at line 1771 of file DeclObjC.h.
| bool clang::ObjCCategoryDecl::IsClassExtension | ( | ) | const [inline] |
Definition at line 1807 of file DeclObjC.h.
References clang::NamedDecl::getIdentifier().
Referenced by clang::Sema::ActOnStartCategoryInterface(), clang::Sema::DiagnoseUnimplementedProperties(), clang::ObjCContainerDecl::FindPropertyDeclaration(), and clang::ObjCIvarDecl::getContainingInterface().
| ivar_iterator clang::ObjCCategoryDecl::ivar_begin | ( | ) | const [inline] |
Definition at line 1813 of file DeclObjC.h.
References clang::DeclContext::decls_begin().
Referenced by ivar_empty(), ivar_size(), and ivars().
| bool clang::ObjCCategoryDecl::ivar_empty | ( | ) | const [inline] |
Definition at line 1822 of file DeclObjC.h.
References ivar_begin(), and ivar_end().
| ivar_iterator clang::ObjCCategoryDecl::ivar_end | ( | ) | const [inline] |
Definition at line 1816 of file DeclObjC.h.
References clang::DeclContext::decls_end().
Referenced by ivar_empty(), ivar_size(), and ivars().
| unsigned clang::ObjCCategoryDecl::ivar_size | ( | ) | const [inline] |
Definition at line 1819 of file DeclObjC.h.
References ivar_begin(), and ivar_end().
| ivar_range clang::ObjCCategoryDecl::ivars | ( | ) | const [inline] |
Definition at line 1812 of file DeclObjC.h.
References ivar_begin(), and ivar_end().
| protocol_iterator clang::ObjCCategoryDecl::protocol_begin | ( | ) | const [inline] |
Definition at line 1781 of file DeclObjC.h.
References clang::ObjCList< T >::begin().
Referenced by protocols(), and clang::ASTNodeImporter::VisitObjCCategoryDecl().
| protocol_iterator clang::ObjCCategoryDecl::protocol_end | ( | ) | const [inline] |
Definition at line 1784 of file DeclObjC.h.
References clang::ObjCList< T >::end().
Referenced by protocols(), and clang::ASTNodeImporter::VisitObjCCategoryDecl().
| protocol_loc_iterator clang::ObjCCategoryDecl::protocol_loc_begin | ( | ) | const [inline] |
Definition at line 1792 of file DeclObjC.h.
References clang::ObjCProtocolList::loc_begin().
Referenced by protocol_locs(), and clang::ASTNodeImporter::VisitObjCCategoryDecl().
| protocol_loc_iterator clang::ObjCCategoryDecl::protocol_loc_end | ( | ) | const [inline] |
Definition at line 1795 of file DeclObjC.h.
References clang::ObjCProtocolList::loc_end().
Referenced by protocol_locs().
| protocol_loc_range clang::ObjCCategoryDecl::protocol_locs | ( | ) | const [inline] |
Definition at line 1789 of file DeclObjC.h.
References protocol_loc_begin(), and protocol_loc_end().
Referenced by clang::ASTDeclWriter::VisitObjCCategoryDecl().
| unsigned clang::ObjCCategoryDecl::protocol_size | ( | ) | const [inline] |
Definition at line 1785 of file DeclObjC.h.
References clang::ObjCListBase::size().
Referenced by clang::ASTDeclWriter::VisitObjCCategoryDecl().
| protocol_range clang::ObjCCategoryDecl::protocols | ( | ) | const [inline] |
Definition at line 1778 of file DeclObjC.h.
References protocol_begin(), and protocol_end().
Referenced by clang::ObjCContainerDecl::FindPropertyDeclaration(), and clang::ASTDeclWriter::VisitObjCCategoryDecl().
| void clang::ObjCCategoryDecl::setCategoryNameLoc | ( | SourceLocation | Loc | ) | [inline] |
Definition at line 1827 of file DeclObjC.h.
Referenced by clang::ASTDeclReader::VisitObjCCategoryDecl().
| void ObjCCategoryDecl::setImplementation | ( | ObjCCategoryImplDecl * | ImplD | ) |
Definition at line 1688 of file DeclObjC.cpp.
References clang::Decl::getASTContext(), and clang::ASTContext::setObjCImplementation().
Referenced by clang::Sema::ActOnStartCategoryImplementation(), clang::ASTNodeImporter::VisitObjCCategoryDecl(), and clang::ASTNodeImporter::VisitObjCCategoryImplDecl().
| void clang::ObjCCategoryDecl::setIvarLBraceLoc | ( | SourceLocation | Loc | ) | [inline] |
Definition at line 1829 of file DeclObjC.h.
Referenced by clang::ASTDeclReader::VisitObjCCategoryDecl().
| void clang::ObjCCategoryDecl::setIvarRBraceLoc | ( | SourceLocation | Loc | ) | [inline] |
Definition at line 1831 of file DeclObjC.h.
Referenced by clang::ASTDeclReader::VisitObjCCategoryDecl().
| void clang::ObjCCategoryDecl::setProtocolList | ( | ObjCProtocolDecl *const * | List, |
| unsigned | Num, | ||
| const SourceLocation * | Locs, | ||
| ASTContext & | C | ||
| ) | [inline] |
setProtocolList - Set the list of protocols that this interface implements.
Definition at line 1766 of file DeclObjC.h.
References clang::ObjCProtocolList::set().
Referenced by clang::Sema::ActOnStartCategoryInterface(), clang::ASTNodeImporter::VisitObjCCategoryDecl(), and clang::ASTDeclReader::VisitObjCCategoryDecl().
friend class ASTDeclReader [friend] |
Reimplemented from clang::DeclContext.
Definition at line 1837 of file DeclObjC.h.
friend class ASTDeclWriter [friend] |
Reimplemented from clang::Decl.
Definition at line 1838 of file DeclObjC.h.