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. using System;
  29. using System.IO;
  30. using System.Text;
  31. namespace System.Xml
  32. {
  33. internal class XmlSimpleDictionaryWriter : XmlDictionaryWriter
  34. {
  35. XmlWriter writer;
  36. // FIXME: find out how soapCompliant argument is used.
  37. public XmlSimpleDictionaryWriter (XmlWriter writer)
  38. {
  39. this.writer = writer;
  40. }
  41. public override void Close ()
  42. {
  43. writer.Close ();
  44. }
  45. public override void Flush ()
  46. {
  47. writer.Flush ();
  48. }
  49. public override string LookupPrefix (string ns)
  50. {
  51. return writer.LookupPrefix (ns);
  52. }
  53. public override void WriteBase64 (byte [] buffer, int index, int count)
  54. {
  55. writer.WriteBase64 (buffer, index, count);
  56. }
  57. public override void WriteBinHex (byte [] buffer, int index, int count)
  58. {
  59. writer.WriteBinHex (buffer, index, count);
  60. }
  61. public override void WriteCData (string text)
  62. {
  63. writer.WriteCData (text);
  64. }
  65. public override void WriteCharEntity (char ch)
  66. {
  67. writer.WriteCharEntity (ch);
  68. }
  69. public override void WriteChars (char [] buffer, int index, int count)
  70. {
  71. writer.WriteChars (buffer, index, count);
  72. }
  73. public override void WriteComment (string text)
  74. {
  75. writer.WriteComment (text);
  76. }
  77. public override void WriteDocType (string name, string pubid, string sysid, string subset)
  78. {
  79. writer.WriteDocType (name, pubid, sysid, subset);
  80. }
  81. public override void WriteEndAttribute ()
  82. {
  83. writer.WriteEndAttribute ();
  84. }
  85. public override void WriteEndDocument ()
  86. {
  87. writer.WriteEndDocument ();
  88. }
  89. public override void WriteEndElement ()
  90. {
  91. Depth--;
  92. NSIndex = 0;
  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. NSIndex = 0;
  147. writer.WriteStartElement (prefix, localName, ns);
  148. }
  149. public override void WriteString (string text)
  150. {
  151. writer.WriteString (text);
  152. }
  153. public override void WriteSurrogateCharEntity (char lowChar, char highChar)
  154. {
  155. writer.WriteSurrogateCharEntity (lowChar, highChar);
  156. }
  157. public override void WriteWhitespace (string ws)
  158. {
  159. writer.WriteWhitespace (ws);
  160. }
  161. public override WriteState WriteState {
  162. get {
  163. return writer.WriteState;
  164. }
  165. }
  166. public override string XmlLang {
  167. get {
  168. return writer.XmlLang;
  169. }
  170. }
  171. public override XmlSpace XmlSpace {
  172. get {
  173. return writer.XmlSpace;
  174. }
  175. }
  176. }
  177. }