TBToken.h 886 B

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // FLEXToken.h
  3. // FLEX
  4. //
  5. // Created by Tanner on 3/22/17.
  6. // Copyright © 2017 Tanner Bennett. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. typedef NS_OPTIONS(NSUInteger, TBWildcardOptions)
  10. {
  11. TBWildcardOptionsNone = 0,
  12. TBWildcardOptionsAny = 1,
  13. TBWildcardOptionsPrefix = 1 << 1,
  14. TBWildcardOptionsSuffix = 1 << 2,
  15. };
  16. /// A token may contain wildcards at one or either end,
  17. /// but not in the middle of the token (as of now).
  18. @interface TBToken : NSObject
  19. + (instancetype)any;
  20. + (instancetype)string:(NSString *)string options:(TBWildcardOptions)options;
  21. /// Will not contain the wildcard (*) symbol
  22. @property (nonatomic, readonly) NSString *string;
  23. @property (nonatomic, readonly) TBWildcardOptions options;
  24. /// Opposite of "is ambiguous"
  25. @property (nonatomic, readonly) BOOL isAbsolute;
  26. @property (nonatomic, readonly) BOOL isAny;
  27. @end