NSString+FLEX.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. //
  2. // NSString+FLEX.h
  3. // FLEX
  4. //
  5. // Created by Tanner on 3/26/17.
  6. // Copyright © 2017 Tanner Bennett. All rights reserved.
  7. //
  8. #import "FLEXRuntimeConstants.h"
  9. @interface NSString (FLEXTypeEncoding)
  10. ///@return whether this type starts with the const specifier
  11. @property (nonatomic, readonly) BOOL flex_typeIsConst;
  12. /// @return the first char in the type encoding that is not the const specifier
  13. @property (nonatomic, readonly) FLEXTypeEncoding flex_firstNonConstType;
  14. /// @return the first char in the type encoding after the pointer specifier, if it is a pointer
  15. @property (nonatomic, readonly) FLEXTypeEncoding flex_pointeeType;
  16. /// @return whether this type is an objc object of any kind, even if it's const
  17. @property (nonatomic, readonly) BOOL flex_typeIsObjectOrClass;
  18. /// @return the class named in this type encoding if it is of the form \c @"MYClass"
  19. @property (nonatomic, readonly) Class flex_typeClass;
  20. /// Includes C strings and selectors as well as regular pointers
  21. @property (nonatomic, readonly) BOOL flex_typeIsNonObjcPointer;
  22. @end
  23. @interface NSString (KeyPaths)
  24. - (NSString *)flex_stringByRemovingLastKeyPathComponent;
  25. - (NSString *)flex_stringByReplacingLastKeyPathComponent:(NSString *)replacement;
  26. @end