FLEXIvar.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //
  2. // FLEXIvar.h
  3. // FLEX
  4. //
  5. // Derived from MirrorKit.
  6. // Created by Tanner on 6/30/15.
  7. // Copyright (c) 2020 FLEX Team. 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. /// The full path of the image that contains this ivar definition,
  28. /// or \c nil if this ivar was probably defined at runtime.
  29. @property (nonatomic, readonly) NSString *imagePath;
  30. /// For internal use
  31. @property (nonatomic) id tag;
  32. - (id)getValue:(id)target;
  33. - (void)setValue:(id)value onObject:(id)target;
  34. /// Calls into -getValue: and passes that value into
  35. /// -[FLEXRuntimeUtility potentiallyUnwrapBoxedPointer:type:]
  36. /// and returns the result
  37. - (id)getPotentiallyUnboxedValue:(id)target;
  38. @end