FLEXIvar.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // FLEXIvar.h
  3. // FLEX
  4. //
  5. // Derived from MirrorKit.
  6. // Created by Tanner on 6/30/15.
  7. // Copyright (c) 2015 Tanner Bennett. All rights reserved.
  8. //
  9. #import "FLEXRuntimeConstants.h"
  10. @interface FLEXIvar : NSObject
  11. + (instancetype)ivar:(Ivar)ivar;
  12. + (instancetype)named:(NSString *)name onClass:(Class)cls;
  13. /// The underlying \c Ivar data structure.
  14. @property (nonatomic, readonly) Ivar objc_ivar;
  15. /// The name of the instance variable.
  16. @property (nonatomic, readonly) NSString *name;
  17. /// The type of the instance variable.
  18. @property (nonatomic, readonly) FLEXTypeEncoding type;
  19. /// The type encoding string of the instance variable.
  20. @property (nonatomic, readonly) NSString *typeEncoding;
  21. /// The offset of the instance variable.
  22. @property (nonatomic, readonly) NSInteger offset;
  23. /// The size of the instance variable. 0 if unknown.
  24. @property (nonatomic, readonly) NSUInteger size;
  25. /// Describes the type encoding, size, offset, and objc_ivar
  26. @property (nonatomic, readonly) NSString *details;
  27. /// For internal use
  28. @property (nonatomic) id tag;
  29. - (id)getValue:(id)target;
  30. - (void)setValue:(id)value onObject:(id)target;
  31. /// Calls into -getValue: and passes that value into
  32. /// -[FLEXRuntimeUtility potentiallyUnwrapBoxedPointer:type:]
  33. /// and returns the result
  34. - (id)getPotentiallyUnboxedValue:(id)target;
  35. @end