FLEXSearchToken.h 1001 B

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // FLEXSearchToken.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. TBWildcardOptionsNone = 0,
  11. TBWildcardOptionsAny = 1,
  12. TBWildcardOptionsPrefix = 1 << 1,
  13. TBWildcardOptionsSuffix = 1 << 2,
  14. };
  15. /// A token may contain wildcards at one or either end,
  16. /// but not in the middle of the token (as of now).
  17. @interface FLEXSearchToken : NSObject
  18. + (instancetype)any;
  19. + (instancetype)string:(NSString *)string options:(TBWildcardOptions)options;
  20. /// Will not contain the wildcard (*) symbol
  21. @property (nonatomic, readonly) NSString *string;
  22. @property (nonatomic, readonly) TBWildcardOptions options;
  23. /// Opposite of "is ambiguous"
  24. @property (nonatomic, readonly) BOOL isAbsolute;
  25. @property (nonatomic, readonly) BOOL isAny;
  26. /// Still \c isAny, but checks that the string is empty
  27. @property (nonatomic, readonly) BOOL isEmpty;
  28. @end