|
@@ -78,55 +78,77 @@ YYEncodingType YYEncodingGetType(const char *typeEncoding);
|
|
|
Instance variable information.
|
|
|
*/
|
|
|
@interface YYClassIvarInfo : NSObject
|
|
|
-@property (nonatomic, assign, readonly) Ivar ivar;
|
|
|
-@property (nonatomic, strong, readonly) NSString *name; ///< Ivar's name
|
|
|
-@property (nonatomic, assign, readonly) ptrdiff_t offset; ///< Ivar's offset
|
|
|
+@property (nonatomic, assign, readonly) Ivar ivar; ///< ivar opaque struct
|
|
|
+@property (nonatomic, strong, readonly) NSString *name; ///< Ivar's name
|
|
|
+@property (nonatomic, assign, readonly) ptrdiff_t offset; ///< Ivar's offset
|
|
|
@property (nonatomic, strong, readonly) NSString *typeEncoding; ///< Ivar's type encoding
|
|
|
-@property (nonatomic, assign, readonly) YYEncodingType type; ///< Ivar's type
|
|
|
+@property (nonatomic, assign, readonly) YYEncodingType type; ///< Ivar's type
|
|
|
+
|
|
|
+/**
|
|
|
+ Creates and returns an ivar info object.
|
|
|
+
|
|
|
+ @param ivar ivar opaque struct
|
|
|
+ @return A new object, or nil if an error occurs.
|
|
|
+ */
|
|
|
- (instancetype)initWithIvar:(Ivar)ivar;
|
|
|
@end
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
Method information.
|
|
|
*/
|
|
|
@interface YYClassMethodInfo : NSObject
|
|
|
-@property (nonatomic, assign, readonly) Method method;
|
|
|
-@property (nonatomic, strong, readonly) NSString *name; ///< method name
|
|
|
-@property (nonatomic, assign, readonly) SEL sel; ///< method's selector
|
|
|
-@property (nonatomic, assign, readonly) IMP imp; ///< method's implementation
|
|
|
-@property (nonatomic, strong, readonly) NSString *typeEncoding; ///< method's parameter and return types
|
|
|
-@property (nonatomic, strong, readonly) NSString *returnTypeEncoding; ///< return value's type
|
|
|
+@property (nonatomic, assign, readonly) Method method; ///< method opaque struct
|
|
|
+@property (nonatomic, strong, readonly) NSString *name; ///< method name
|
|
|
+@property (nonatomic, assign, readonly) SEL sel; ///< method's selector
|
|
|
+@property (nonatomic, assign, readonly) IMP imp; ///< method's implementation
|
|
|
+@property (nonatomic, strong, readonly) NSString *typeEncoding; ///< method's parameter and return types
|
|
|
+@property (nonatomic, strong, readonly) NSString *returnTypeEncoding; ///< return value's type
|
|
|
@property (nonatomic, strong, readonly) NSArray *argumentTypeEncodings; ///< array of arguments' type
|
|
|
+
|
|
|
+/**
|
|
|
+ Creates and returns a method info object.
|
|
|
+
|
|
|
+ @param method method opaque struct
|
|
|
+ @return A new object, or nil if an error occurs.
|
|
|
+ */
|
|
|
- (instancetype)initWithMethod:(Method)method;
|
|
|
@end
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
Property information.
|
|
|
*/
|
|
|
@interface YYClassPropertyInfo : NSObject
|
|
|
-@property (nonatomic, assign, readonly) objc_property_t property;
|
|
|
-@property (nonatomic, strong, readonly) NSString *name; ///< property's name
|
|
|
-@property (nonatomic, assign, readonly) YYEncodingType type; ///< property's type
|
|
|
-@property (nonatomic, strong, readonly) NSString *typeEncoding; ///< property's encoding value
|
|
|
-@property (nonatomic, strong, readonly) NSString *ivarName; ///< property's ivar name
|
|
|
-@property (nonatomic, assign, readonly) Class cls; ///< may be nil
|
|
|
-@property (nonatomic, strong, readonly) NSString *getter; ///< getter (nonnull)
|
|
|
-@property (nonatomic, strong, readonly) NSString *setter; ///< setter (nonnull)
|
|
|
+@property (nonatomic, assign, readonly) objc_property_t property; ///< property's opaque struct
|
|
|
+@property (nonatomic, strong, readonly) NSString *name; ///< property's name
|
|
|
+@property (nonatomic, assign, readonly) YYEncodingType type; ///< property's type
|
|
|
+@property (nonatomic, strong, readonly) NSString *typeEncoding; ///< property's encoding value
|
|
|
+@property (nonatomic, strong, readonly) NSString *ivarName; ///< property's ivar name
|
|
|
+@property (nonatomic, assign, readonly) Class cls; ///< may be nil
|
|
|
+@property (nonatomic, strong, readonly) NSString *getter; ///< getter (nonnull)
|
|
|
+@property (nonatomic, strong, readonly) NSString *setter; ///< setter (nonnull)
|
|
|
+
|
|
|
+/**
|
|
|
+ Creates and returns a property info object.
|
|
|
+
|
|
|
+ @param property property opaque struct
|
|
|
+ @return A new object, or nil if an error occurs.
|
|
|
+ */
|
|
|
- (instancetype)initWithProperty:(objc_property_t)property;
|
|
|
@end
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
Class information for a class.
|
|
|
*/
|
|
|
@interface YYClassInfo : NSObject
|
|
|
-
|
|
|
-@property (nonatomic, assign, readonly) Class cls;
|
|
|
-@property (nonatomic, assign, readonly) Class superCls;
|
|
|
-@property (nonatomic, assign, readonly) Class metaCls;
|
|
|
-@property (nonatomic, assign, readonly) BOOL isMeta;
|
|
|
-@property (nonatomic, strong, readonly) NSString *name;
|
|
|
-@property (nonatomic, strong, readonly) YYClassInfo *superClassInfo;
|
|
|
-
|
|
|
+@property (nonatomic, assign, readonly) Class cls; ///< class object
|
|
|
+@property (nonatomic, assign, readonly) Class superCls; ///< super class object
|
|
|
+@property (nonatomic, assign, readonly) Class metaCls; ///< class's meta class object
|
|
|
+@property (nonatomic, assign, readonly) BOOL isMeta; ///< whether this class is meta class
|
|
|
+@property (nonatomic, strong, readonly) NSString *name; ///< class name
|
|
|
+@property (nonatomic, strong, readonly) YYClassInfo *superClassInfo; ///< super class's class info
|
|
|
@property (nonatomic, strong, readonly) NSDictionary *ivarInfos; ///< key:NSString(ivar), value:YYClassIvarInfo
|
|
|
@property (nonatomic, strong, readonly) NSDictionary *methodInfos; ///< key:NSString(selector), value:YYClassMethodInfo
|
|
|
@property (nonatomic, strong, readonly) NSDictionary *propertyInfos; ///< key:NSString(property), value:YYClassPropertyInfo
|