-
Notifications
You must be signed in to change notification settings - Fork 60
/
RegexKitTemplateMatcher.h
47 lines (38 loc) · 1.42 KB
/
RegexKitTemplateMatcher.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// RegexKitTemplateMatcher.h
//
// Created by Matt Gemmell on 12/05/2008.
// Copyright 2008 Instinctive Code. All rights reserved.
//
#import "MGTemplateEngine.h"
#import <RegexKit/RegexKit.h>
/*
This is an example Matcher for MGTemplateEngine, implemented using RegexKit.
To use this matcher, you'll need to install RegexKit, link your target to it, and
ensure it's copied into your built application. The RegexKit documentations explains
how to do all this. Get RegexKit here:
http://regexkit.sourceforge.net/
Other matchers can easily be implemented using the MGTemplateEngineMatcher protocol,
if you prefer to use another regex framework, or use another matching method entirely.
*/
@interface RegexKitTemplateMatcher : NSObject <MGTemplateEngineMatcher> {
MGTemplateEngine *engine;
NSString *markerStart;
NSString *markerEnd;
NSString *exprStart;
NSString *exprEnd;
NSString *filterDelimiter;
NSString *templateString;
RKRegex *regex;
}
@property(assign) MGTemplateEngine *engine; // weak ref
@property(retain) NSString *markerStart;
@property(retain) NSString *markerEnd;
@property(retain) NSString *exprStart;
@property(retain) NSString *exprEnd;
@property(retain) NSString *filterDelimiter;
@property(retain) NSString *templateString;
@property(retain) RKRegex *regex;
+ (RegexKitTemplateMatcher *)matcherWithTemplateEngine:(MGTemplateEngine *)theEngine;
- (NSArray *)argumentsFromString:(NSString *)argString;
@end