forked from rentzsch/mogenerator
-
Notifications
You must be signed in to change notification settings - Fork 1
/
MiscMergeTemplate.h
executable file
·91 lines (73 loc) · 2.74 KB
/
MiscMergeTemplate.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
//
// MiscMergeTemplate.h
//
// Written by Don Yacktman and Carl Lindberg
//
// Copyright 2001-2004 by Don Yacktman and Carl Lindberg.
// All rights reserved.
//
// This notice may not be removed from this source code.
//
// This header is included in the MiscKit by permission from the author
// and its use is governed by the MiscKit license, found in the file
// "License.rtf" in the MiscKit distribution. Please refer to that file
// for a list of all applicable permissions and restrictions.
//
#import <Foundation/NSObject.h>
@class NSMutableArray, NSCharacterSet;
@class MiscMergeCommandBlock;
typedef enum _MiscMergeTrimWhitespaceBehavior {
MiscMergeKeepWhitespace,
MiscMergeKeepNonBlankWhitespace,
MiscMergeTrimWhitespace,
MiscMergeIgnoreCommandSpaces
} MiscMergeTrimWhitespaceBehavior;
@interface MiscMergeTemplate : NSObject
{
MiscMergeCommandBlock *topLevelCommands;
NSMutableArray *commandStack;
NSString *startDelimiter;
NSString *endDelimiter;
int _lineNumber;
NSString *_filename;
NSCharacterSet *_parseStopChars;
MiscMergeTrimWhitespaceBehavior _trimWhitespaceBehavior;
id _delegate;
}
/*" Creating a MiscMergeTemplate "*/
+ template;
+ templateWithString:(NSString *)aString;
/*" Initializing a MiscMergeTemplate "*/
- init;
- initWithString:(NSString *)string;
- initWithContentsOfFile:(NSString *)filename;
- (id)delegate;
- (void)setDelegate:(id)anObject;
- (NSString *)resolveTemplateFilename:(NSString *)resolveName;
/*" Accessing/setting the delimiters "*/
+ (NSString *)defaultStartDelimiter;
+ (NSString *)defaultEndDelimiter;
- (NSString *)startDelimiter;
- (NSString *)endDelimiter;
- (void)setStartDelimiter:(NSString *)startDelim endDelimiter:(NSString *)endDelim;
/*" Change behavior of blank space between commands "*/
- (MiscMergeTrimWhitespaceBehavior)trimWhitespaceBehavior;
- (void)setTrimWhitespaceBehavior:(MiscMergeTrimWhitespaceBehavior)flag;
/*" Command block manipulation "*/
- (void)pushCommandBlock:(MiscMergeCommandBlock *)aBlock;
- (void)popCommandBlock:(MiscMergeCommandBlock *)aBlock;
- (void)popCommandBlock;
- (MiscMergeCommandBlock *)currentCommandBlock;
- (MiscMergeCommandBlock *)topLevelCommandBlock;
/*" Loading the template "*/
- (void)parseContentsOfFile:(NSString *)filename;
- (void)parseString:(NSString *)string;
- (void)reportParseError:(NSString *)format, ...;
- (void)setFilename:(NSString *)filename;
- (NSString *)filename;
/*" Deriving the class for a command string "*/
- (Class)classForCommand:(NSString *)aCommand;
@end
@interface MiscMergeTemplateDelegate
- (NSString *)mergeTemplate:(MiscMergeTemplate *)template resolveTemplateFilename:(NSString *)filename;
@end