-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathZtConfigBasicRegPieces.cls
302 lines (213 loc) · 13.7 KB
/
ZtConfigBasicRegPieces.cls
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "ZtConfigBasicRegPieces"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
' Class ZtConfigBasicRegPieces.
' It preserves a part of the basic configuration informations and methods to read them from ZtConfig.xml.
'
' Zotero Tools.
' This software is under Revised ('New') BSD license.
' Copyright © 2019, Olaf Ahrens. All rights reserved.
' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
' Private variables.
Private pvtPunctuationPattern As ZtRegPiece
Private pvtNotPunctuationPattern As ZtRegPiece
Private pvtNotSpaceWOZeroPunctuationPattern As ZtRegPiece
Private pvtNotSpaceWOZeroPunctuationBreakFieldPattern As ZtRegPiece
Private pvtNotPunctuationBreakFieldPattern As ZtRegPiece
Private pvtZeroWidthSpace As ZtRegPiece
Private pvtSpacePattern As ZtRegPiece
Private pvtSpaceWOZeroPattern As ZtRegPiece
Private pvtSpaceWOZeroChoice As ZtRegPiece
Private pvtWhiteSpaceWOZeroPattern As ZtRegPiece
Private pvtSpaceWOZeroCommaSemicolonPattern As ZtRegPiece
Private pvtSpaceDashPattern As ZtRegPiece
Private pvtNotSpaceDashPattern As ZtRegPiece
Private pvtLineBreakChoice As ZtRegPiece
Private pvtHttpDoiPrefixChoice As ZtRegPiece
Private pvtCommaSeparatedIntegerList As ZtRegPiece
Private pvtHttpElementNameChoice As ZtRegPiece
Private pvtFamilyNameSuffixChoice As ZtRegPiece
Private pvtFamilyNameTheSuffixChoice As ZtRegPiece
Private pvtNotUrlAllowedCharacters As ZtRegPiece
Private pvtNotUrlAllowedPattern As ZtRegPiece
Private pvtNotUrlEndAllowedPattern As ZtRegPiece
Private pvtNotDoiAllowedCharacters As ZtRegPiece
Private pvtNotDoiAllowedPattern As ZtRegPiece
Private pvtNotDoiEndAllowedPattern As ZtRegPiece
Private pvtShortDoiAllowedPattern As ZtRegPiece
' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
' Friend/Public procedures and properties.
' All members that should be callable by CallByName procedure must be public.
Friend Sub Initialize(ByVal valConfig As ZtConfig, ByVal valXml As MSXML2.DOMDocument60)
Dim locNode As MSXML2.IXMLDOMNode
Set locNode = valXml.SelectSingleNode("/zoteroTools/basic/regPieces")
With locNode
valConfig.RegPieceFactory valConfig.ResolveTextElement(.SelectSingleNode("punctuationPatternRegPiece")), _
"basic.regPieces.punctuationPatternRegPiece", _
pvtPunctuationPattern
valConfig.RegPieceFactory valConfig.ResolveTextElement(.SelectSingleNode("notPunctuationPatternRegPiece")), _
"regPieces.notPunctuationPatternRegPiece", _
pvtNotPunctuationPattern
valConfig.RegPieceFactory valConfig.ResolveTextElement(.SelectSingleNode("notSpaceWOZeroPunctuationPatternRegPiece")), _
"basic.regPieces.notSpaceWOZeroPunctuationPatternRegPiece", _
pvtNotSpaceWOZeroPunctuationPattern
valConfig.RegPieceFactory valConfig.ResolveTextElement(.SelectSingleNode("notSpaceWOZeroPunctuationBreakFieldPatternRegPiece")), _
"basic.regPieces.notSpaceWOZeroPunctuationBreakFieldPatternRegPiece", _
pvtNotSpaceWOZeroPunctuationBreakFieldPattern
valConfig.RegPieceFactory valConfig.ResolveTextElement(.SelectSingleNode("notPunctuationBreakFieldPatternRegPiece")), _
"basic.regPieces.notPunctuationBreakFieldPatternRegPiece", _
pvtNotPunctuationBreakFieldPattern
valConfig.RegPieceFactory valConfig.ResolveTextElement(.SelectSingleNode("zeroWidthSpaceRegPiece")), _
"basic.regPieces.zeroWidthSpaceRegPiece", _
pvtZeroWidthSpace
valConfig.RegPieceFactory valConfig.ResolveTextElement(.SelectSingleNode("spacePatternRegPiece")), _
"basic.regPieces.spacePattern", _
pvtSpacePattern
valConfig.RegPieceFactory valConfig.ResolveTextElement(.SelectSingleNode("spaceWOZeroPatternRegPiece")), _
"basic.regPieces.spaceWOZeroPatternRegPiece", _
pvtSpaceWOZeroPattern
valConfig.RegPieceFactory valConfig.ResolveTextElement(.SelectSingleNode("spaceWOZeroChoiceRegPiece")), _
"basic.regPieces.spaceWOZeroChoiceRegPiece", _
pvtSpaceWOZeroChoice
valConfig.RegPieceFactory valConfig.ResolveTextElement(.SelectSingleNode("whiteSpaceWOZeroPatternRegPiece")), _
"basic.regPieces.whiteSpaceWOZeroPatternRegPiece", _
pvtWhiteSpaceWOZeroPattern
valConfig.RegPieceFactory valConfig.ResolveTextElement(.SelectSingleNode("spaceWOZeroCommaSemicolonPatternRegPiece")), _
"basic.regPieces.spaceWOZeroCommaSemicolonPatternRegPiece", _
pvtSpaceWOZeroCommaSemicolonPattern
valConfig.RegPieceFactory valConfig.ResolveTextElement(.SelectSingleNode("spaceDashPatternRegPiece")), _
"basic.regPieces.spaceDashPatternRegPiece", _
pvtSpaceDashPattern
valConfig.RegPieceFactory valConfig.ResolveTextElement(.SelectSingleNode("notSpaceDashPatternRegPiece")), _
"basic.regPieces.notSpaceDashPatternRegPiece", _
pvtNotSpaceDashPattern
valConfig.RegPieceFactory valConfig.ResolveTextElement(.SelectSingleNode("lineBreakChoiceRegPiece")), _
"basic.regPieces.lineBreakChoiceRegPiece", _
pvtLineBreakChoice
valConfig.RegPieceFactory valConfig.ResolveTextElement(.SelectSingleNode("httpDoiPrefixChoiceRegPiece")), _
"basic.regPieces.httpDoiPrefixChoiceRegPiece", _
pvtHttpDoiPrefixChoice
valConfig.RegPieceFactory valConfig.ResolveTextElement(.SelectSingleNode("commaSeparatedIntegerListRegPiece")), _
"basic.regPieces.commaSeparatedIntegerListRegPiece", _
pvtCommaSeparatedIntegerList
valConfig.RegPieceFactory valConfig.ResolveTextElement(.SelectSingleNode("httpElementNameChoiceRegPiece")), _
"basic.regPieces.httpElementNameChoiceRegPiece", _
pvtHttpElementNameChoice
valConfig.RegPieceFactory valConfig.ResolveTextElement(.SelectSingleNode("familyNameSuffixChoiceRegPiece")), _
"basic.regPieces.familyNameSuffixChoiceRegPiece", _
pvtFamilyNameSuffixChoice
valConfig.RegPieceFactory valConfig.ResolveTextElement(.SelectSingleNode("familyNameTheSuffixChoiceRegPiece")), _
"basic.regPieces.familyNameTheSuffixChoiceRegPiece", _
pvtFamilyNameTheSuffixChoice
valConfig.RegPieceFactory valConfig.ResolveTextElement(.SelectSingleNode("notUrlAllowedCharactersRegPiece")), _
"basic.regPieces.notUrlAllowedCharactersRegPiece", _
pvtNotUrlAllowedCharacters
valConfig.RegPieceFactory valConfig.ResolveTextElement(.SelectSingleNode("notUrlAllowedPatternRegPiece")), _
"basic.regPieces.notUrlAllowedPatternRegPiece", _
pvtNotUrlAllowedPattern
valConfig.RegPieceFactory valConfig.ResolveTextElement(.SelectSingleNode("notUrlEndAllowedPatternRegPiece")), _
"basic.regPieces.notUrlEndAllowedPatternRegPiece", _
pvtNotUrlEndAllowedPattern
valConfig.RegPieceFactory valConfig.ResolveTextElement(.SelectSingleNode("notDoiAllowedCharactersRegPiece")), _
"basic.regPieces.notDoiAllowedCharactersRegPiece", _
pvtNotDoiAllowedCharacters
valConfig.RegPieceFactory valConfig.ResolveTextElement(.SelectSingleNode("notDoiAllowedPatternRegPiece")), _
"basic.regPieces.notDoiAllowedPatternRegPiece", _
pvtNotDoiAllowedPattern
valConfig.RegPieceFactory valConfig.ResolveTextElement(.SelectSingleNode("notDoiEndAllowedPatternRegPiece")), _
"basic.regPieces.notDoiEndAllowedPatternRegPiece", _
pvtNotDoiEndAllowedPattern
valConfig.RegPieceFactory valConfig.ResolveTextElement(.SelectSingleNode("shortDoiAllowedPatternRegPiece")), _
"basic.regPieces.shortDoiAllowedPatternRegPiece", _
pvtShortDoiAllowedPattern
End With
End Sub
Public Property Get PunctuationPatternRegPiece() As ZtRegPiece
Set PunctuationPatternRegPiece = pvtPunctuationPattern
End Property
Public Property Get NotPunctuationPatternRegPiece() As ZtRegPiece
Set NotPunctuationPatternRegPiece = pvtNotPunctuationPattern
End Property
Public Property Get NotSpaceWOZeroPunctuationPatternRegPiece() As ZtRegPiece
Set NotSpaceWOZeroPunctuationPatternRegPiece = pvtNotSpaceWOZeroPunctuationPattern
End Property
Public Property Get NotSpaceWOZeroPunctuationBreakFieldPatternRegPiece() As ZtRegPiece
Set NotSpaceWOZeroPunctuationBreakFieldPatternRegPiece = pvtNotSpaceWOZeroPunctuationBreakFieldPattern
End Property
Public Property Get NotPunctuationBreakFieldPatternRegPiece() As ZtRegPiece
Set NotPunctuationBreakFieldPatternRegPiece = pvtNotPunctuationBreakFieldPattern
End Property
Public Property Get ZeroWidthSpaceRegPiece() As ZtRegPiece
Set ZeroWidthSpaceRegPiece = pvtZeroWidthSpace
End Property
Public Property Get SpacePatternRegPiece() As ZtRegPiece
Set SpacePatternRegPiece = pvtSpacePattern
End Property
Public Property Get SpaceWOZeroPatternRegPiece() As ZtRegPiece
Set SpaceWOZeroPatternRegPiece = pvtSpaceWOZeroPattern
End Property
Public Property Get SpaceWOZeroChoiceRegPiece() As ZtRegPiece
Set SpaceWOZeroChoiceRegPiece = pvtSpaceWOZeroChoice
End Property
Public Property Get WhiteSpaceWOZeroPatternRegPiece() As ZtRegPiece
Set WhiteSpaceWOZeroPatternRegPiece = pvtWhiteSpaceWOZeroPattern
End Property
Public Property Get SpaceWOZeroCommaSemicolonPatternRegPiece() As ZtRegPiece
Set SpaceWOZeroCommaSemicolonPatternRegPiece = pvtSpaceWOZeroCommaSemicolonPattern
End Property
Public Property Get SpaceDashPatternRegPiece() As ZtRegPiece
Set SpaceDashPatternRegPiece = pvtSpaceDashPattern
End Property
Public Property Get NotSpaceDashPatternRegPiece() As ZtRegPiece
Set NotSpaceDashPatternRegPiece = pvtNotSpaceDashPattern
End Property
Public Property Get LineBreakChoiceRegPiece() As ZtRegPiece
Set LineBreakChoiceRegPiece = pvtLineBreakChoice
End Property
Public Property Get HttpDoiPrefixChoiceRegPiece() As ZtRegPiece
Set HttpDoiPrefixChoiceRegPiece = pvtHttpDoiPrefixChoice
End Property
Public Property Get CommaSeparatedIntegerListRegPiece() As ZtRegPiece
Set CommaSeparatedIntegerListRegPiece = pvtCommaSeparatedIntegerList
End Property
Public Property Get HttpElementNameChoiceRegPiece() As ZtRegPiece
Set HttpElementNameChoiceRegPiece = pvtHttpElementNameChoice
End Property
Public Property Get FamilyNameSuffixChoiceRegPiece() As ZtRegPiece
Set FamilyNameSuffixChoiceRegPiece = pvtFamilyNameSuffixChoice
End Property
Public Property Get FamilyNameTheSuffixChoiceRegPiece() As ZtRegPiece
Set FamilyNameTheSuffixChoiceRegPiece = pvtFamilyNameTheSuffixChoice
End Property
Public Property Get NotUrlAllowedCharactersRegPiece() As ZtRegPiece
Set NotUrlAllowedCharactersRegPiece = pvtNotUrlAllowedCharacters
End Property
Public Property Get NotUrlAllowedPatternRegPiece() As ZtRegPiece
Set NotUrlAllowedPatternRegPiece = pvtNotUrlAllowedPattern
End Property
Public Property Get NotUrlEndAllowedPatternRegPiece() As ZtRegPiece
Set NotUrlEndAllowedPatternRegPiece = pvtNotUrlEndAllowedPattern
End Property
Public Property Get NotDoiAllowedCharactersRegPiece() As ZtRegPiece
Set NotDoiAllowedCharactersRegPiece = pvtNotDoiAllowedCharacters
End Property
Public Property Get NotDoiAllowedPatternRegPiece() As ZtRegPiece
Set NotDoiAllowedPatternRegPiece = pvtNotDoiAllowedPattern
End Property
Public Property Get NotDoiEndAllowedPatternRegPiece() As ZtRegPiece
Set NotDoiEndAllowedPatternRegPiece = pvtNotDoiEndAllowedPattern
End Property
Public Property Get ShortDoiAllowedPatternRegPiece() As ZtRegPiece
Set ShortDoiAllowedPatternRegPiece = pvtShortDoiAllowedPattern
End Property
' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *