ObjFW
src/OFIntrospection.h
00001 /*
00002  * Copyright (c) 2008, 2009, 2010, 2011, 2012
00003  *   Jonathan Schleifer <js@webkeks.org>
00004  *
00005  * All rights reserved.
00006  *
00007  * This file is part of ObjFW. It may be distributed under the terms of the
00008  * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
00009  * the packaging of this file.
00010  *
00011  * Alternatively, it may be distributed under the terms of the GNU General
00012  * Public License, either version 2 or 3, which can be found in the file
00013  * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
00014  * file.
00015  */
00016 
00017 #import "OFObject.h"
00018 
00019 @class OFString;
00020 @class OFArray;
00021 @class OFMutableArray;
00022 
00026 @interface OFMethod: OFObject
00027 {
00028         SEL selector;
00029         OFString *name;
00030         const char *typeEncoding;
00031 }
00032 
00033 #ifdef OF_HAVE_PROPERTIES
00034 @property (readonly) SEL selector;
00035 @property (readonly, copy) OFString *name;
00036 @property (readonly) const char *typeEncoding;
00037 #endif
00038 
00044 - (SEL)selector;
00045 
00051 - (OFString*)name;
00052 
00058 - (const char*)typeEncoding;
00059 @end
00060 
00064 @interface OFInstanceVariable: OFObject
00065 {
00066         OFString *name;
00067         ptrdiff_t offset;
00068         const char *typeEncoding;
00069 }
00070 
00071 #ifdef OF_HAVE_PROPERTIES
00072 @property (readonly, copy) OFString *name;
00073 @property (readonly) ptrdiff_t offset;
00074 @property (readonly) const char *typeEncoding;
00075 #endif
00076 
00082 - (OFString*)name;
00083 
00089 - (ptrdiff_t)offset;
00090 
00096 - (const char*)typeEncoding;
00097 @end
00098 
00099 #ifdef OF_HAVE_PROPERTIES
00100 
00103 @interface OFProperty: OFObject
00104 {
00105         OFString *name;
00106         const char *attributes;
00107 }
00108 
00110 @property (readonly, copy) OFString *name;
00112 @property (readonly) const char *attributes;
00113 @end
00114 #endif
00115 
00119 @interface OFIntrospection: OFObject
00120 {
00121         OFMutableArray *classMethods;
00122         OFMutableArray *instanceMethods;
00123         OFMutableArray *instanceVariables;
00124 #ifdef OF_HAVE_PROPERTIES
00125         OFMutableArray *properties;
00126 #endif
00127 }
00128 
00129 #ifdef OF_HAVE_PROPERTIES
00130 @property (readonly, copy) OFArray *classMethods;
00131 @property (readonly, copy) OFArray *instanceMethods;
00132 @property (readonly, copy) OFArray *instanceVariables;
00133 
00139 @property (readonly, copy) OFArray *properties;
00140 #endif
00141 
00147 + introspectionWithClass: (Class)class_;
00148 
00155 - initWithClass: (Class)class_;
00156 
00162 - (OFArray*)classMethods;
00163 
00169 - (OFArray*)instanceMethods;
00170 
00176 - (OFArray*)instanceVariables;
00177 
00178 /* TODO: protocols */
00179 @end
 All Classes Functions Variables Properties