//
// Validator.h
// GotoBus
//
// Created by haibara on 2/15/15.
//
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

typedef NS_OPTIONS (NSUInteger, CreditCardType) {
	CreditCardTypeNone = 0,
	CreditCardTypeMASTERCARD = 1 << 0,
	CreditCardTypeVISA = 1 << 1,
	CreditCardTypeAMEX = 1 << 2,
	CreditCardTypeDINERSCLUB = 1 << 3,
	CreditCardTypeENROUTE = 1 << 4,
	CreditCardTypeDISCOVER = 1 << 5,
	CreditCardTypeJCB = 1 << 6,
};

@interface Validator : NSObject
@end

@interface GenericValidator : NSObject
+ (BOOL)isEmail:(NSString *)value;
+ (BOOL)isInRange:(CGFloat)value min:(CGFloat)min max:(CGFloat)max;
+ (BOOL)matchRegexp:(NSString *)value regexp:(NSString *)regexp;
@end

@interface CreditCardValidator : NSObject
- (instancetype)initWithOptions:(CreditCardType)options;
- (BOOL)isValid:(NSString *)card;
@end
