comparison dwt/internal/cocoa/NSXMLParser.d @ 0:380af2bdd8e5

Upload of whole dwt tree
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Sat, 09 Aug 2008 17:00:02 +0200
parents
children 8b48be5454ce
comparison
equal deleted inserted replaced
-1:000000000000 0:380af2bdd8e5
1 /*******************************************************************************
2 * Copyright (c) 2007 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * IBM Corporation - initial API and implementation
10 *
11 * Port to the D Programming language:
12 * Jacob Carlborg <jacob.carlborg@gmail.com>
13 *******************************************************************************/
14 module dwt.internal.cocoa.NSXMLParser;
15
16 import dwt.internal.cocoa.NSData;
17 import dwt.internal.cocoa.NSError;
18 import dwt.internal.cocoa.NSInteger;
19 import dwt.internal.cocoa.NSObject;
20 import dwt.internal.cocoa.NSString;
21 import dwt.internal.cocoa.NSURL;
22 import dwt.internal.cocoa.OS;
23 import objc = dwt.internal.objc.runtime;
24
25 public class NSXMLParser : NSObject
26 {
27
28 public this ()
29 {
30 super();
31 }
32
33 public this (objc.id id)
34 {
35 super(id);
36 }
37
38 public void abortParsing ()
39 {
40 OS.objc_msgSend(this.id, OS.sel_abortParsing);
41 }
42
43 public NSInteger columnNumber ()
44 {
45 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_columnNumber);
46 }
47
48 public id delegatee ()
49 {
50 objc.id result = OS.objc_msgSend(this.id, OS.sel_delegate);
51 return result !is null ? new id(result) : null;
52 }
53
54 public id initWithContentsOfURL (NSURL url)
55 {
56 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfURL_1, url !is null ? url.id : null);
57 return result !is null ? new id(result) : null;
58 }
59
60 public id initWithData (NSData data)
61 {
62 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithData_1, data !is null ? data.id : null);
63 return result !is null ? new id(result) : null;
64 }
65
66 public NSInteger lineNumber ()
67 {
68 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_lineNumber);
69 }
70
71 public bool parse ()
72 {
73 return OS.objc_msgSend(this.id, OS.sel_parse) !is null;
74 }
75
76 public NSError parserError ()
77 {
78 objc.id result = OS.objc_msgSend(this.id, OS.sel_parserError);
79 return result !is null ? new NSError(result) : null;
80 }
81
82 public NSString publicID ()
83 {
84 objc.id result = OS.objc_msgSend(this.id, OS.sel_publicID);
85 return result !is null ? new NSString(result) : null;
86 }
87
88 public void setDelegate (id delegatee)
89 {
90 OS.objc_msgSend(this.id, OS.sel_setDelegate_1, delegatee !is null ? delegatee.id : null);
91 }
92
93 public void setShouldProcessNamespaces (bool shouldProcessNamespaces)
94 {
95 OS.objc_msgSend(this.id, OS.sel_setShouldProcessNamespaces_1, shouldProcessNamespaces);
96 }
97
98 public void setShouldReportNamespacePrefixes (bool shouldReportNamespacePrefixes)
99 {
100 OS.objc_msgSend(this.id, OS.sel_setShouldReportNamespacePrefixes_1, shouldReportNamespacePrefixes);
101 }
102
103 public void setShouldResolveExternalEntities (bool shouldResolveExternalEntities)
104 {
105 OS.objc_msgSend(this.id, OS.sel_setShouldResolveExternalEntities_1, shouldResolveExternalEntities);
106 }
107
108 public bool shouldProcessNamespaces ()
109 {
110 return OS.objc_msgSend(this.id, OS.sel_shouldProcessNamespaces) !is null;
111 }
112
113 public bool shouldReportNamespacePrefixes ()
114 {
115 return OS.objc_msgSend(this.id, OS.sel_shouldReportNamespacePrefixes) !is null;
116 }
117
118 public bool shouldResolveExternalEntities ()
119 {
120 return OS.objc_msgSend(this.id, OS.sel_shouldResolveExternalEntities) !is null;
121 }
122
123 public NSString systemID ()
124 {
125 objc.id result = OS.objc_msgSend(this.id, OS.sel_systemID);
126 return result !is null ? new NSString(result) : null;
127 }
128
129 }