Mercurial > projects > dstep
annotate dstep/foundation/NSXMLParser.d @ 16:19885b43130e
Huge update, the bridge actually works now
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Sun, 03 Jan 2010 22:06:11 +0100 |
parents | 89f3c3ef1fd2 |
children | b9de51448c6b |
rev | line source |
---|---|
14 | 1 /** |
2 * Copyright: Copyright (c) 2009 Jacob Carlborg. | |
3 * Authors: Jacob Carlborg | |
4 * Version: Initial created: Aug 3, 2009 | |
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) | |
6 */ | |
7 module dstep.foundation.NSXMLParser; | |
8 | |
9 import dstep.foundation.NSData; | |
10 import dstep.foundation.NSDictionary; | |
11 import dstep.foundation.NSError; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
12 import dstep.foundation.NSObjCRuntime; |
14 | 13 import dstep.foundation.NSObject; |
14 import dstep.foundation.NSString; | |
15 import dstep.foundation.NSURL; | |
16 import dstep.objc.bridge.Bridge; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
17 import dstep.objc.objc; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
18 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
19 |
14 | 20 |
21 import bindings = dstep.foundation.NSXMLParser_bindings; | |
22 | |
23 alias NSInteger NSXMLParserError; | |
24 | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
25 private NSString NSXMLParserErrorDomain_; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
26 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
27 NSString NSXMLParserErrorDomain () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
28 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
29 if (NSXMLParserErrorDomain_) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
30 return NSXMLParserErrorDomain_; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
31 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
32 return NSXMLParserErrorDomain_ = new NSString(bindings.NSXMLParserErrorDomain); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
33 } |
14 | 34 |
35 enum | |
36 { | |
37 NSXMLParserInternalError = 1, | |
38 NSXMLParserOutOfMemoryError = 2, | |
39 NSXMLParserDocumentStartError = 3, | |
40 NSXMLParserEmptyDocumentError = 4, | |
41 NSXMLParserPrematureDocumentEndError = 5, | |
42 NSXMLParserInvalidHexCharacterRefError = 6, | |
43 NSXMLParserInvalidDecimalCharacterRefError = 7, | |
44 NSXMLParserInvalidCharacterRefError = 8, | |
45 NSXMLParserInvalidCharacterError = 9, | |
46 NSXMLParserCharacterRefAtEOFError = 10, | |
47 NSXMLParserCharacterRefInPrologError = 11, | |
48 NSXMLParserCharacterRefInEpilogError = 12, | |
49 NSXMLParserCharacterRefInDTDError = 13, | |
50 NSXMLParserEntityRefAtEOFError = 14, | |
51 NSXMLParserEntityRefInPrologError = 15, | |
52 NSXMLParserEntityRefInEpilogError = 16, | |
53 NSXMLParserEntityRefInDTDError = 17, | |
54 NSXMLParserParsedEntityRefAtEOFError = 18, | |
55 NSXMLParserParsedEntityRefInPrologError = 19, | |
56 NSXMLParserParsedEntityRefInEpilogError = 20, | |
57 NSXMLParserParsedEntityRefInInternalSubsetError = 21, | |
58 NSXMLParserEntityReferenceWithoutNameError = 22, | |
59 NSXMLParserEntityReferenceMissingSemiError = 23, | |
60 NSXMLParserParsedEntityRefNoNameError = 24, | |
61 NSXMLParserParsedEntityRefMissingSemiError = 25, | |
62 NSXMLParserUndeclaredEntityError = 26, | |
63 NSXMLParserUnparsedEntityError = 28, | |
64 NSXMLParserEntityIsExternalError = 29, | |
65 NSXMLParserEntityIsParameterError = 30, | |
66 NSXMLParserUnknownEncodingError = 31, | |
67 NSXMLParserEncodingNotSupportedError = 32, | |
68 NSXMLParserStringNotStartedError = 33, | |
69 NSXMLParserStringNotClosedError = 34, | |
70 NSXMLParserNamespaceDeclarationError = 35, | |
71 NSXMLParserEntityNotStartedError = 36, | |
72 NSXMLParserEntityNotFinishedError = 37, | |
73 NSXMLParserLessThanSymbolInAttributeError = 38, | |
74 NSXMLParserAttributeNotStartedError = 39, | |
75 NSXMLParserAttributeNotFinishedError = 40, | |
76 NSXMLParserAttributeHasNoValueError = 41, | |
77 NSXMLParserAttributeRedefinedError = 42, | |
78 NSXMLParserLiteralNotStartedError = 43, | |
79 NSXMLParserLiteralNotFinishedError = 44, | |
80 NSXMLParserCommentNotFinishedError = 45, | |
81 NSXMLParserProcessingInstructionNotStartedError = 46, | |
82 NSXMLParserProcessingInstructionNotFinishedError = 47, | |
83 NSXMLParserNotationNotStartedError = 48, | |
84 NSXMLParserNotationNotFinishedError = 49, | |
85 NSXMLParserAttributeListNotStartedError = 50, | |
86 NSXMLParserAttributeListNotFinishedError = 51, | |
87 NSXMLParserMixedContentDeclNotStartedError = 52, | |
88 NSXMLParserMixedContentDeclNotFinishedError = 53, | |
89 NSXMLParserElementContentDeclNotStartedError = 54, | |
90 NSXMLParserElementContentDeclNotFinishedError = 55, | |
91 NSXMLParserXMLDeclNotStartedError = 56, | |
92 NSXMLParserXMLDeclNotFinishedError = 57, | |
93 NSXMLParserConditionalSectionNotStartedError = 58, | |
94 NSXMLParserConditionalSectionNotFinishedError = 59, | |
95 NSXMLParserExternalSubsetNotFinishedError = 60, | |
96 NSXMLParserDOCTYPEDeclNotFinishedError = 61, | |
97 NSXMLParserMisplacedCDATAEndStringError = 62, | |
98 NSXMLParserCDATANotFinishedError = 63, | |
99 NSXMLParserMisplacedXMLDeclarationError = 64, | |
100 NSXMLParserSpaceRequiredError = 65, | |
101 NSXMLParserSeparatorRequiredError = 66, | |
102 NSXMLParserNMTOKENRequiredError = 67, | |
103 NSXMLParserNAMERequiredError = 68, | |
104 NSXMLParserPCDATARequiredError = 69, | |
105 NSXMLParserURIRequiredError = 70, | |
106 NSXMLParserPublicIdentifierRequiredError = 71, | |
107 NSXMLParserLTRequiredError = 72, | |
108 NSXMLParserGTRequiredError = 73, | |
109 NSXMLParserLTSlashRequiredError = 74, | |
110 NSXMLParserEqualExpectedError = 75, | |
111 NSXMLParserTagNameMismatchError = 76, | |
112 NSXMLParserUnfinishedTagError = 77, | |
113 NSXMLParserStandaloneValueError = 78, | |
114 NSXMLParserInvalidEncodingNameError = 79, | |
115 NSXMLParserCommentContainsDoubleHyphenError = 80, | |
116 NSXMLParserInvalidEncodingError = 81, | |
117 NSXMLParserExternalStandaloneEntityError = 82, | |
118 NSXMLParserInvalidConditionalSectionError = 83, | |
119 NSXMLParserEntityValueRequiredError = 84, | |
120 NSXMLParserNotWellBalancedError = 85, | |
121 NSXMLParserExtraContentError = 86, | |
122 NSXMLParserInvalidCharacterInEntityError = 87, | |
123 NSXMLParserParsedEntityRefInInternalError = 88, | |
124 NSXMLParserEntityRefLoopError = 89, | |
125 NSXMLParserEntityBoundaryError = 90, | |
126 NSXMLParserInvalidURIError = 91, | |
127 NSXMLParserURIFragmentError = 92, | |
128 NSXMLParserNoDTDError = 94, | |
129 NSXMLParserDelegateAbortedParseError = 512 | |
130 } | |
131 | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
132 const TNSXMLParserDelegateEventAdditions = ` |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
133 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
134 void parserDidStartDocument (NSXMLParser parser) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
135 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
136 return invokeObjcSelf!(void, "parserDidStartDocument:", NSXMLParser)(parser); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
137 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
138 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
139 void parserDidEndDocument (NSXMLParser parser) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
140 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
141 return invokeObjcSelf!(void, "parserDidEndDocument:", NSXMLParser)(parser); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
142 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
143 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
144 void parser (NSXMLParser parser, NSString name, NSString publicID, NSString systemID) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
145 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
146 return invokeObjcSelf!(void, "parser:foundNotationDeclarationWithName:publicID:systemID:", NSXMLParser, NSString, NSString, NSString)(parser, name, publicID, systemID); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
147 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
148 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
149 void parser (NSXMLParser parser, NSString name, NSString publicID, NSString systemID, NSString notationName) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
150 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
151 return invokeObjcSelf!(void, "parser:foundUnparsedEntityDeclarationWithName:publicID:systemID:notationName:", NSXMLParser, NSString, NSString, NSString, NSString)(parser, name, publicID, systemID, notationName); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
152 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
153 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
154 void parser_foundAttributeDeclarationWithName_forElement_type_defaultValue (NSXMLParser parser, NSString attributeName, NSString elementName, NSString type, NSString defaultValue) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
155 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
156 return invokeObjcSelf!(void, "parser:foundAttributeDeclarationWithName:forElement:type:defaultValue:", NSXMLParser, NSString, NSString, NSString, NSString)(parser, attributeName, elementName, type, defaultValue); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
157 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
158 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
159 void parser (NSXMLParser parser, NSString elementName, NSString model) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
160 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
161 return invokeObjcSelf!(void, "parser:foundElementDeclarationWithName:model:", NSXMLParser, NSString, NSString)(parser, elementName, model); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
162 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
163 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
164 void parser_foundInternalEntityDeclarationWithName_value (NSXMLParser parser, NSString name, NSString value) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
165 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
166 return invokeObjcSelf!(void, "parser:foundInternalEntityDeclarationWithName:value:", NSXMLParser, NSString, NSString)(parser, name, value); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
167 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
168 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
169 void parser_foundExternalEntityDeclarationWithName_publicID_systemID (NSXMLParser parser, NSString name, NSString publicID, NSString systemID) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
170 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
171 return invokeObjcSelf!(void, "parser:foundExternalEntityDeclarationWithName:publicID:systemID:", NSXMLParser, NSString, NSString, NSString)(parser, name, publicID, systemID); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
172 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
173 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
174 void parser (NSXMLParser parser, NSString elementName, NSString namespaceURI, NSString qName, NSDictionary attributeDict) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
175 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
176 return invokeObjcSelf!(void, "parser:didStartElement:namespaceURI:qualifiedName:attributes:", NSXMLParser, NSString, NSString, NSString, NSDictionary)(parser, elementName, namespaceURI, qName, attributeDict); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
177 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
178 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
179 void parser_didEndElement_namespaceURI_qualifiedName (NSXMLParser parser, NSString elementName, NSString namespaceURI, NSString qName) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
180 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
181 return invokeObjcSelf!(void, "parser:didEndElement:namespaceURI:qualifiedName:", NSXMLParser, NSString, NSString, NSString)(parser, elementName, namespaceURI, qName); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
182 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
183 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
184 void parser_didStartMappingPrefix_toURI (NSXMLParser parser, NSString prefix, NSString namespaceURI) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
185 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
186 return invokeObjcSelf!(void, "parser:didStartMappingPrefix:toURI:", NSXMLParser, NSString, NSString)(parser, prefix, namespaceURI); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
187 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
188 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
189 void parser (NSXMLParser parser, NSString prefix) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
190 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
191 return invokeObjcSelf!(void, "parser:didEndMappingPrefix:", NSXMLParser, NSString)(parser, prefix); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
192 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
193 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
194 void parser (NSXMLParser parser, NSString string) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
195 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
196 return invokeObjcSelf!(void, "parser:foundCharacters:", NSXMLParser, NSString)(parser, string); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
197 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
198 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
199 void parser (NSXMLParser parser, NSString whitespaceString) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
200 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
201 return invokeObjcSelf!(void, "parser:foundIgnorableWhitespace:", NSXMLParser, NSString)(parser, whitespaceString); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
202 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
203 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
204 void parser_foundProcessingInstructionWithTarget_data (NSXMLParser parser, NSString target, NSString data) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
205 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
206 return invokeObjcSelf!(void, "parser:foundProcessingInstructionWithTarget:data", NSXMLParser, NSString, NSString)(parser, target, data); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
207 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
208 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
209 void parser (NSXMLParser parser, NSString comment) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
210 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
211 return invokeObjcSelf!(void, "parser:foundComment:", NSXMLParser, NSString)(parser, comment); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
212 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
213 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
214 void parser (NSXMLParser parser, NSData CDATABlock) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
215 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
216 return invokeObjcSelf!(void, "parser:foundCDATA:", NSXMLParser, NSData)(parser, CDATABlock); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
217 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
218 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
219 NSData parser_resolveExternalEntityName_systemID (NSXMLParser parser, NSString name, NSString systemID) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
220 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
221 return invokeObjcSelf!(NSData, "parser:resolveExternalEntityName:systemID:", NSXMLParser, NSString, NSString)(parser, name, systemID); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
222 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
223 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
224 void parser (NSXMLParser parser, NSError parseError) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
225 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
226 return invokeObjcSelf!(void, "parser:parseErrorOccurred:", NSXMLParser, NSError)(parser, parseError); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
227 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
228 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
229 void parser_validationErrorOccurred (NSXMLParser parser, NSError validationError) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
230 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
231 return invokeObjcSelf!(void, "parser:validationErrorOccurred:", NSXMLParser, NSError)(parser, validationError); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
232 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
233 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
234 //mixin ObjcBindMethod!(parserDidStartDocument, "parserDidStartDocument:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
235 //mixin ObjcBindMethod!(parserDidEndDocument, "parserDidEndDocument:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
236 //mixin ObjcBindMethod!(parser, "parser:foundNotationDeclarationWithName:publicID:systemID:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
237 //mixin ObjcBindMethod!(parser, "parser:foundUnparsedEntityDeclarationWithName:publicID:systemID:notationName:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
238 //mixin ObjcBindMethod!(parser_foundAttributeDeclarationWithName_forElement_type_defaultValue, "parser:foundAttributeDeclarationWithName:forElement:type:defaultValue:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
239 //mixin ObjcBindMethod!(parser, "parser:foundElementDeclarationWithName:model:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
240 //mixin ObjcBindMethod!(parser_foundInternalEntityDeclarationWithName_value, "parser:foundInternalEntityDeclarationWithName:value:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
241 //mixin ObjcBindMethod!(parser_foundExternalEntityDeclarationWithName_publicID_systemID, "parser:foundExternalEntityDeclarationWithName:publicID:systemID:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
242 //mixin ObjcBindMethod!(parser, "parser:didStartElement:namespaceURI:qualifiedName:attributes:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
243 //mixin ObjcBindMethod!(parser_didEndElement_namespaceURI_qualifiedName, "parser:didEndElement:namespaceURI:qualifiedName:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
244 //mixin ObjcBindMethod!(parser_didStartMappingPrefix_toURI, "parser:didStartMappingPrefix:toURI:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
245 //mixin ObjcBindMethod!(parser, "parser:didEndMappingPrefix:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
246 //mixin ObjcBindMethod!(parser, "parser:foundCharacters:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
247 //mixin ObjcBindMethod!(parser, "parser:foundIgnorableWhitespace:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
248 //mixin ObjcBindMethod!(parser_foundProcessingInstructionWithTarget_data, "parser:foundProcessingInstructionWithTarget:data"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
249 //mixin ObjcBindMethod!(parser, "parser:foundComment:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
250 //mixin ObjcBindMethod!(parser, "parser:foundCDATA:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
251 //mixin ObjcBindMethod!(parser_resolveExternalEntityName_systemID, "parser:resolveExternalEntityName:systemID:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
252 //mixin ObjcBindMethod!(parser, "parser:parseErrorOccurred:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
253 //mixin ObjcBindMethod!(parser, "parser:validationErrorOccurred:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
254 `; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
255 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
256 const TNSXMLParserLocatorAdditions = ` |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
257 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
258 NSString publicID () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
259 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
260 return invokeObjcSelf!(NSString, "publicID"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
261 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
262 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
263 NSString systemID () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
264 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
265 return invokeObjcSelf!(NSString, "systemID"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
266 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
267 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
268 NSInteger lineNumber () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
269 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
270 return invokeObjcSelf!(NSInteger, "lineNumber"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
271 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
272 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
273 NSInteger columnNumber () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
274 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
275 return invokeObjcSelf!(NSInteger, "columnNumber"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
276 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
277 `; |
14 | 278 |
279 class NSXMLParser : NSObject | |
280 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
281 mixin (ObjcWrap); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
282 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
283 this () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
284 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
285 super(typeof(this).alloc.init.objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
286 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
287 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
288 typeof(this) init () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
289 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
290 return invokeObjcSelf!(typeof(this), "init"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
291 } |
14 | 292 |
293 Object initWithContentsOfURL (NSURL url) | |
294 { | |
295 return invokeObjcSelf!(Object, "initWithContentsOfURL:", NSURL)(url); | |
296 } | |
297 | |
298 this (NSURL url) | |
299 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
300 typeof(this).alloc.initWithContentsOfURL(url); |
14 | 301 } |
302 | |
303 Object initWithData (NSData data) | |
304 { | |
305 return invokeObjcSelf!(Object, "initWithData:", NSData)(data); | |
306 } | |
307 | |
308 this (NSData data) | |
309 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
310 typeof(this).alloc.initWithData(data); |
14 | 311 } |
312 | |
313 Object delegate_ () | |
314 { | |
315 return invokeObjcSelf!(Object, "delegate"); | |
316 } | |
317 | |
318 void setDelegate (Object delegate_) | |
319 { | |
320 return invokeObjcSelf!(void, "setDelegate:", Object)(delegate_); | |
321 } | |
322 | |
323 void setShouldProcessNamespaces (bool shouldProcessNamespaces) | |
324 { | |
325 return invokeObjcSelf!(void, "setShouldProcessNamespaces:", bool)(shouldProcessNamespaces); | |
326 } | |
327 | |
328 void setShouldReportNamespacePrefixes (bool shouldReportNamespacePrefixes) | |
329 { | |
330 return invokeObjcSelf!(void, "setShouldReportNamespacePrefixes:", bool)(shouldReportNamespacePrefixes); | |
331 } | |
332 | |
333 void setShouldResolveExternalEntities (bool shouldResolveExternalEntities) | |
334 { | |
335 return invokeObjcSelf!(void, "setShouldResolveExternalEntities:", bool)(shouldResolveExternalEntities); | |
336 } | |
337 | |
338 bool shouldProcessNamespaces () | |
339 { | |
340 return invokeObjcSelf!(bool, "shouldProcessNamespaces"); | |
341 } | |
342 | |
343 bool shouldReportNamespacePrefixes () | |
344 { | |
345 return invokeObjcSelf!(bool, "shouldReportNamespacePrefixes"); | |
346 } | |
347 | |
348 bool shouldResolveExternalEntities () | |
349 { | |
350 return invokeObjcSelf!(bool, "shouldResolveExternalEntities"); | |
351 } | |
352 | |
353 bool parse () | |
354 { | |
355 return invokeObjcSelf!(bool, "parse"); | |
356 } | |
357 | |
358 void abortParsing () | |
359 { | |
360 return invokeObjcSelf!(void, "abortParsing"); | |
361 } | |
362 | |
363 NSError parserError () | |
364 { | |
365 return invokeObjcSelf!(NSError, "parserError"); | |
366 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
367 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
368 // TNSXMLParserLocatorAdditions |
14 | 369 NSString publicID () |
370 { | |
371 return invokeObjcSelf!(NSString, "publicID"); | |
372 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
373 |
14 | 374 NSString systemID () |
375 { | |
376 return invokeObjcSelf!(NSString, "systemID"); | |
377 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
378 |
14 | 379 NSInteger lineNumber () |
380 { | |
381 return invokeObjcSelf!(NSInteger, "lineNumber"); | |
382 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
383 |
14 | 384 NSInteger columnNumber () |
385 { | |
386 return invokeObjcSelf!(NSInteger, "columnNumber"); | |
387 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
388 } |