Merge
[mono.git] / mcs / class / PlayScript.Core / XML.play
1 // Copyright 2013 Zynga Inc.
2 //      
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //      http://www.apache.org/licenses/LICENSE-2.0
8 //              
9 //      Unless required by applicable law or agreed to in writing, software
10 //      distributed under the License is distributed on an "AS IS" BASIS,
11 //      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 //      See the License for the specific language governing permissions and
13 //      limitations under the License.
14
15 package {
16         import System.*;
17         import System.Xml.*;
18
19         public class XML {
20         
21                 var mElement:XmlElement;
22
23                 //
24                 // Properties
25                 //
26                 
27                 public static property ignoreComments : Boolean {
28                         get { throw new System.NotImplementedException(); }
29                         set { throw new System.NotImplementedException(); }
30                 }
31
32                 public static property ignoreProcessingInstructions : Boolean {
33                         get { throw new System.NotImplementedException(); } 
34                         set { throw new System.NotImplementedException(); } 
35                 }
36
37                 public static property ignoreWhitespace : Boolean { 
38                         get { throw new System.NotImplementedException(); } 
39                         set { throw new System.NotImplementedException(); } 
40                 }
41
42                 public static property prettyIndent : int { 
43                         get { throw new System.NotImplementedException(); } 
44                         set { throw new System.NotImplementedException(); } 
45                 }
46
47                 public static property prettyPrinting : Boolean { 
48                         get { throw new System.NotImplementedException(); } 
49                         set { throw new System.NotImplementedException(); } 
50                 }
51
52                 //
53                 // Methods
54                 // 
55                 
56                 public function XML(value:Object) {
57 /*              
58                         if (value is XmlElement) 
59                         {
60                                 mElement = value as XmlElement;
61                         } else if (value is flash.utils.ByteArray) 
62                         {
63                                 var ba:flash.utils.ByteArray = value as flash.utils.ByteArray;
64
65                                 // read string from byte array
66                                 ba.position = 0;
67                                 var xmlString:String = ba.readAllUTF();
68
69                                 // parse xml document from string
70                                 var doc:XmlDocument = new XmlDocument();
71                                 doc.LoadXml(xmlString);
72                                 mElement = doc.DocumentElement;
73                         } else if (value is String)
74                         {
75                                 // parse xml document from string
76                                 var doc:XmlDocument = new XmlDocument();
77                                 doc.LoadXml(value as String);
78                                 mElement = doc.DocumentElement;
79                         }
80                         else
81                         {
82                                 throw new System.NotImplementedException();
83                         }
84 */
85                 }
86
87                 internal function XML(value:XmlNode)
88                 {
89                         // TODO: mElement = value;
90                 }
91                 
92                 public function addNamespace(ns:Object):XML {
93                         throw new System.NotImplementedException();
94                 }
95                 
96                 public function appendChild(child:Object):XML {
97                         throw new System.NotImplementedException();
98                 }
99                 
100                 /*
101                 public function attribute(attributeName:String):XMLList {
102                         throw new System.NotImplementedException();
103                 }*/
104
105                 public function attribute(attributeName:String):String {
106                         return mElement.HasAttribute(attributeName) ? mElement.GetAttribute(attributeName) : null;
107                 }
108
109                 public function attributes():XMLList {
110                         throw new System.NotImplementedException();
111                 }
112                 
113                 public function child(propertyName:Object):XMLList {
114                         throw new System.NotImplementedException();
115                 }
116                 
117                 public function childIndex():int {
118                         throw new System.NotImplementedException();
119                 }
120                 
121                 public function children():XMLList {
122                         throw new System.NotImplementedException();
123                 }
124                 
125                 public function comments():XMLList {
126                         throw new System.NotImplementedException();
127                 }
128                 
129                 public function contains(value:XML):Boolean {
130                         throw new System.NotImplementedException();
131                 }
132                 
133                 public function copy():XML {
134                         throw new System.NotImplementedException();
135                 }
136                 
137                 public static function defaultSettings():Object {
138                         throw new System.NotImplementedException();
139                 }
140                 
141                 public function descendants():XMLList {
142                         throw new System.NotImplementedException();
143                 }               
144                 
145                 public function descendants(name:Object):XMLList {
146                         throw new System.NotImplementedException();
147                 }
148                 
149                 public function elements():XMLList {
150                         return new XMLList(mElement.GetElementsByTagName("*"));
151                 }               
152                 
153                 public function elements(name:String):XMLList {
154                         return new XMLList(mElement.GetElementsByTagName(name));
155                 }
156                 
157                 public function hasComplexContent():Boolean {
158                         throw new System.NotImplementedException();
159                 }
160                 
161                 public function hasOwnProperty(p:String):Boolean {
162                         throw new System.NotImplementedException();
163                 }
164                 
165                 public function hasSimpleContent():Boolean {
166                         throw new System.NotImplementedException();
167                 }
168                 
169                 public function inScopeNamespaces():Array {
170                         throw new System.NotImplementedException();
171                 }
172                 
173                 public function insertChildAfter(child1:Object, child2:Object):* {
174                         throw new System.NotImplementedException();
175                 }
176                 
177                 public function insertChildBefore(child1:Object, child2:Object):* {
178                         throw new System.NotImplementedException();
179                 }
180                 
181                 public function length():int {
182                         throw new System.NotImplementedException();
183                 }
184                 
185                 public function localName():String {
186                         return mElement.LocalName;
187                 }
188                 
189                 public function name():QName {
190                         return new QName(mElement.NamespaceURI, mElement.Name);
191                 }
192                 
193                 public function @namespace(prefix:String = null):* {
194                         throw new System.NotImplementedException();
195                 }
196                 
197                 public function namespaceDeclarations():Array {
198                         throw new System.NotImplementedException();
199                 }
200                 
201                 public function nodeKind():String {
202                         throw new System.NotImplementedException();
203                 }
204                 
205                 public function normalize():XML {
206                         throw new System.NotImplementedException();
207                 }
208                 
209                 public function parent():* {
210                         throw new System.NotImplementedException();
211                 }
212                 
213                 public function prependChild(value:Object):XML {
214                         throw new System.NotImplementedException();
215                 }
216                 
217                 public function processingInstructions(name:String):XMLList {
218                         throw new System.NotImplementedException();
219                 }
220                 
221                 public function propertyIsEnumerable(p:String):Boolean {
222                         throw new System.NotImplementedException();
223                 }
224                 
225                 public function removeNamespace(ns:Namespace):XML {
226                         throw new System.NotImplementedException();
227                 }
228                 
229                 public function replace(propertyName:Object, value:XML):XML {
230                         throw new System.NotImplementedException();
231                 }
232                 
233                 public function setChildren(value:Object):XML {
234                         throw new System.NotImplementedException();
235                 }
236                 
237                 public function setLocalName(name:String):void {
238                         throw new System.NotImplementedException();             
239                 }
240                 
241                 public function setName(name:String):void {
242                         throw new System.NotImplementedException();
243                 }
244                 
245                 public function setNamespace(ns:Namespace):void {
246                         throw new System.NotImplementedException();
247                 }
248                 
249                 public function setSettings(... rest):void {
250                         throw new System.NotImplementedException();
251                 }
252                 
253                 public function settings():Object {
254                         throw new System.NotImplementedException();
255                 }
256                 
257                 public function text():XMLList {
258                         throw new System.NotImplementedException();
259                 }
260                 
261                 public function toJSON(k:String):* {
262                         throw new System.NotImplementedException();
263                 }
264                 
265                 public function toString():String {
266             throw new System.NotImplementedException();
267                 }
268                 
269                 public function toXMLString():String {
270                         throw new System.NotImplementedException();
271                 }
272                 
273                 public function valueOf():Object {
274                         throw new System.NotImplementedException();
275                 }
276         
277                 public static implicit operator String (xml:XML) {
278                         throw new System.NotImplementedException();
279                 }       
280         }
281
282 }