XmlSimpleDictionaryWriter.cs 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. //
  2. // XmlDictionaryWriter.cs
  3. //
  4. // Author:
  5. // Atsushi Enomoto <[email protected]>
  6. //
  7. // Copyright (C) 2005 Novell, Inc. http://www.novell.com
  8. //
  9. // Permission is hereby granted, free of charge, to any person obtaining
  10. // a copy of this software and associated documentation files (the
  11. // "Software"), to deal in the Software without restriction, including
  12. // without limitation the rights to use, copy, modify, merge, publish,
  13. // distribute, sublicense, and/or sell copies of the Software, and to
  14. // permit persons to whom the Software is furnished to do so, subject to
  15. // the following conditions:
  16. //
  17. // The above copyright notice and this permission notice shall be
  18. // included in all copies or substantial portions of the Software.
  19. //
  20. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  21. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  22. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  23. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  24. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  25. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  26. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  27. //
  28. #if NET_2_0
  29. using System;
  30. using System.IO;
  31. using System.Text;
  32. namespace System.Xml
  33. {
  34. internal class XmlSimpleDictionaryWriter : XmlDictionaryWriter
  35. {
  36. XmlWriter writer;
  37. // FIXME: find out how soapCompliant argument is used.
  38. public XmlSimpleDictionaryWriter (XmlWriter writer)
  39. {
  40. this.writer = writer;
  41. }
  42. public override void Close ()
  43. {
  44. writer.Close ();
  45. }
  46. public override void Flush ()
  47. {
  48. writer.Flush ();
  49. }
  50. public override string LookupPrefix (string ns)
  51. {
  52. return writer.LookupPrefix (ns);
  53. }
  54. public override void WriteBase64 (byte [] buffer, int index, int count)
  55. {
  56. writer.WriteBase64 (buffer, index, count);
  57. }
  58. public override void WriteBinHex (byte [] buffer, int index, int count)
  59. {
  60. writer.WriteBinHex (buffer, index, count);
  61. }
  62. public override void WriteCData (string text)
  63. {
  64. writer.WriteCData (text);
  65. }
  66. public override void WriteCharEntity (char ch)
  67. {
  68. writer.WriteCharEntity (ch);
  69. }
  70. public override void WriteChars (char [] buffer, int index, int count)
  71. {
  72. writer.WriteChars (buffer, index, count);
  73. }
  74. public override void WriteComment (string text)
  75. {
  76. writer.WriteComment (text);
  77. }
  78. public override void WriteDocType (string name, string pubid, string sysid, string subset)
  79. {
  80. writer.WriteDocType (name, pubid, sysid, subset);
  81. }
  82. public override void WriteEndAttribute ()
  83. {
  84. writer.WriteEndAttribute ();
  85. }
  86. public override void WriteEndDocument ()
  87. {
  88. writer.WriteEndDocument ();
  89. }
  90. public override void WriteEndElement ()
  91. {
  92. Depth--;
  93. writer.WriteEndElement ();
  94. }
  95. public override void WriteEntityRef (string name)
  96. {
  97. writer.WriteEntityRef (name);
  98. }
  99. public override void WriteFullEndElement ()
  100. {
  101. writer.WriteFullEndElement ();
  102. }
  103. public override void WriteName (string name)
  104. {
  105. writer.WriteName (name);
  106. }
  107. public override void WriteNmToken (string name)
  108. {
  109. writer.WriteNmToken (name);
  110. }
  111. public override void WriteNode (XmlReader reader, bool defattr)
  112. {
  113. writer.WriteNode (reader, defattr);
  114. }
  115. public override void WriteProcessingInstruction (string name, string text)
  116. {
  117. writer.WriteProcessingInstruction (name, text);
  118. }
  119. public override void WriteQualifiedName (string localName, string ns)
  120. {
  121. writer.WriteQualifiedName (localName, ns);
  122. }
  123. public override void WriteRaw (string data)
  124. {
  125. writer.WriteRaw (data);
  126. }
  127. public override void WriteRaw (char [] buffer, int index, int count)
  128. {
  129. writer.WriteRaw (buffer, index, count);
  130. }
  131. public override void WriteStartAttribute (string prefix, string localName, string ns)
  132. {
  133. writer.WriteStartAttribute (prefix, localName, ns);
  134. }
  135. public override void WriteStartDocument (bool standalone)
  136. {
  137. writer.WriteStartDocument (standalone);
  138. }
  139. public override void WriteStartDocument ()
  140. {
  141. writer.WriteStartDocument ();
  142. }
  143. public override void WriteStartElement (string prefix, string localName, string ns)
  144. {
  145. Depth++;
  146. writer.WriteStartElement (prefix, localName, ns);
  147. }
  148. public override void WriteString (string text)
  149. {
  150. writer.WriteString (text);
  151. }
  152. public override void WriteSurrogateCharEntity (char lowChar, char highChar)
  153. {
  154. writer.WriteSurrogateCharEntity (lowChar, highChar);
  155. }
  156. public override void WriteWhitespace (string ws)
  157. {
  158. writer.WriteWhitespace (ws);
  159. }
  160. public override WriteState WriteState {
  161. get {
  162. return writer.WriteState;
  163. }
  164. }
  165. public override string XmlLang {
  166. get {
  167. return writer.XmlLang;
  168. }
  169. }
  170. public override XmlSpace XmlSpace {
  171. get {
  172. return writer.XmlSpace;
  173. }
  174. }
  175. }
  176. }
  177. #endif