Mercurial > projects > dstep
annotate dstep/foundation/NSXMLDTD.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.NSXMLDTD; | |
8 | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
9 import dstep.foundation.NSArray; |
14 | 10 import dstep.foundation.NSData; |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
11 import dstep.foundation.NSDictionary; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
12 import dstep.foundation.NSError; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
13 import dstep.foundation.NSObjCRuntime; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
14 import dstep.foundation.NSString; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
15 import dstep.foundation.NSURL; |
14 | 16 import dstep.foundation.NSXMLDTDNode; |
17 import dstep.foundation.NSXMLNode; | |
18 import dstep.objc.bridge.Bridge; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
19 import dstep.objc.objc; |
14 | 20 |
21 class NSXMLDTD : NSXMLNode | |
22 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
23 mixin (ObjcWrap); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
24 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
25 this () |
14 | 26 { |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
27 super(typeof(this).alloc.init.objcObject); |
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 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
30 typeof(this) init () |
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 invokeObjcSelf!(typeof(this), "init"); |
14 | 33 } |
34 | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
35 Object initWithContentsOfURL (NSURL url, NSUInteger mask, ref NSError error) |
14 | 36 { |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
37 id err = error ? new objc_object : null; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
38 Object result = invokeObjcSelf!(Object, "initWithContentsOfURL:options:error:", NSURL, NSUInteger, id*)(url, mask, &err); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
39 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
40 if (err) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
41 error = new NSError(err); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
42 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
43 return result; |
14 | 44 } |
45 | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
46 this (NSURL url, NSUInteger mask, ref NSError error) |
14 | 47 { |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
48 typeof(this).alloc.initWithContentsOfURL(url, mask, error); |
14 | 49 } |
50 | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
51 Object initWithData (NSData data, NSUInteger mask, ref NSError error) |
14 | 52 { |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
53 id err = error ? new objc_object : null; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
54 Object result = invokeObjcSelf!(Object, "initWithData:options:error:", NSData, NSUInteger, id*)(data, mask, &err); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
55 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
56 if (err) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
57 error = new NSError(err); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
58 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
59 return result; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
60 } |
14 | 61 |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
62 this (NSData data, NSUInteger mask, ref NSError error) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
63 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
64 typeof(this).alloc.initWithData(data, mask, error); |
14 | 65 } |
66 | |
67 void setPublicID (NSString publicID) | |
68 { | |
69 return invokeObjcSelf!(void, "setPublicID:", NSString)(publicID); | |
70 } | |
71 | |
72 NSString publicID () | |
73 { | |
74 return invokeObjcSelf!(NSString, "publicID"); | |
75 } | |
76 | |
77 void setSystemID (NSString systemID) | |
78 { | |
79 return invokeObjcSelf!(void, "setSystemID:", NSString)(systemID); | |
80 } | |
81 | |
82 NSString systemID () | |
83 { | |
84 return invokeObjcSelf!(NSString, "systemID"); | |
85 } | |
86 | |
87 void insertChild (NSXMLNode child, NSUInteger index) | |
88 { | |
89 return invokeObjcSelf!(void, "insertChild:atIndex:", NSXMLNode, NSUInteger)(child, index); | |
90 } | |
91 | |
92 void insertChildren (NSArray children, NSUInteger index) | |
93 { | |
94 return invokeObjcSelf!(void, "insertChildren:atIndex:", NSArray, NSUInteger)(children, index); | |
95 } | |
96 | |
97 void removeChildAtIndex (NSUInteger index) | |
98 { | |
99 return invokeObjcSelf!(void, "removeChildAtIndex:", NSUInteger)(index); | |
100 } | |
101 | |
102 void setChildren (NSArray children) | |
103 { | |
104 return invokeObjcSelf!(void, "setChildren:", NSArray)(children); | |
105 } | |
106 | |
107 void addChild (NSXMLNode child) | |
108 { | |
109 return invokeObjcSelf!(void, "addChild:", NSXMLNode)(child); | |
110 } | |
111 | |
112 void replaceChildAtIndex (NSUInteger index, NSXMLNode node) | |
113 { | |
114 return invokeObjcSelf!(void, "replaceChildAtIndex:withNode:", NSUInteger, NSXMLNode)(index, node); | |
115 } | |
116 | |
117 NSXMLDTDNode entityDeclarationForName (NSString name) | |
118 { | |
119 return invokeObjcSelf!(NSXMLDTDNode, "entityDeclarationForName:", NSString)(name); | |
120 } | |
121 | |
122 NSXMLDTDNode notationDeclarationForName (NSString name) | |
123 { | |
124 return invokeObjcSelf!(NSXMLDTDNode, "notationDeclarationForName:", NSString)(name); | |
125 } | |
126 | |
127 NSXMLDTDNode elementDeclarationForName (NSString name) | |
128 { | |
129 return invokeObjcSelf!(NSXMLDTDNode, "elementDeclarationForName:", NSString)(name); | |
130 } | |
131 | |
132 NSXMLDTDNode attributeDeclarationForName (NSString name, NSString elementName) | |
133 { | |
134 return invokeObjcSelf!(NSXMLDTDNode, "attributeDeclarationForName:elementName:", NSString, NSString)(name, elementName); | |
135 } | |
136 | |
137 static NSXMLDTDNode predefinedEntityDeclarationForName (NSString name) | |
138 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
139 return invokeObjcSuperClass!(NSXMLDTDNode, "predefinedEntityDeclarationForName:", NSString)(name); |
14 | 140 } |
141 } | |
142 |