The Labs \ Source Viewer \ SSCLI \ System.Xml \ TextUtf8RawTextWriter

  1. //------------------------------------------------------------------------------
  2. // <copyright file="TextWriterGenerator.cxx" company="Microsoft">
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. // </copyright>
  14. //------------------------------------------------------------------------------
  15. // WARNING: This file is generated and should not be modified directly. Instead,
  16. // modify TextWriterGenerator.cxx and run gen.bat in the same directory.
  17. // This batch file will execute the following commands:
  18. //
  19. // cl.exe /C /EP /D _UTF8_TEXT_WRITER TextWriterGenerator.cxx > Utf8TextWriter.cs
  20. // cl.exe /C /EP /D _ENCODED_TEXT_WRITER TextWriterGenerator.cxx > EncodedTextWriter.cs
  21. //
  22. // Because these two implementations of TextWriter are so similar, the C++ preprocessor
  23. // is used to generate each implementation from one template file, using macros and ifdefs.
  24. using System;
  25. using System.IO;
  26. using System.Text;
  27. //using System.Xml.Query;
  28. using System.Xml.Schema;
  29. using System.Diagnostics;
  30. using System.Globalization;
  31. namespace System.Xml
  32. {
  33.     // Concrete implementation of XmlRawWriter interface that serializes text events as encoded
  34.     // text. All other non-text events are ignored. The general-purpose TextEncodedRawTextWriter uses the
  35.     // Encoder class to output to any encoding. The TextUtf8RawTextWriter class combined the encoding
  36.     // operation with serialization in order to achieve better performance.
  37.     // </summary>
  38.     internal class TextUtf8RawTextWriter : XmlUtf8RawTextWriter
  39.     {
  40.        
  41.        
  42.        
  43.        
  44.        
  45.        
  46.        
  47.         // Construct an instance of this class that serializes to a Stream interface.
  48.         public TextUtf8RawTextWriter(Stream stream, Encoding encoding, XmlWriterSettings settings, bool closeOutput) : base(stream, encoding, settings, closeOutput)
  49.         {
  50.         }
  51.        
  52.        
  53.         //
  54.         // XmlRawWriter
  55.         //
  56.         // Ignore Xml declaration
  57.         internal override void WriteXmlDeclaration(XmlStandalone standalone)
  58.         {
  59.         }
  60.         internal override void WriteXmlDeclaration(string xmldecl)
  61.         {
  62.         }
  63.        
  64.         // Ignore DTD
  65.         public override void WriteDocType(string name, string pubid, string sysid, string subset)
  66.         {
  67.         }
  68.        
  69.         // Ignore Elements
  70.         public override void WriteStartElement(string prefix, string localName, string ns)
  71.         {
  72.         }
  73.        
  74.         internal override void WriteEndElement(string prefix, string localName, string ns)
  75.         {
  76.         }
  77.        
  78.         internal override void WriteFullEndElement(string prefix, string localName, string ns)
  79.         {
  80.         }
  81.        
  82.         internal override void StartElementContent()
  83.         {
  84.         }
  85.        
  86.         // Ignore attributes
  87.         public override void WriteStartAttribute(string prefix, string localName, string ns)
  88.         {
  89.             base.inAttributeValue = true;
  90.         }
  91.        
  92.         public override void WriteEndAttribute()
  93.         {
  94.             base.inAttributeValue = false;
  95.         }
  96.        
  97.         // Ignore namespace declarations
  98.         internal override void WriteNamespaceDeclaration(string prefix, string ns)
  99.         {
  100.         }
  101.        
  102.         // Output content of CDATA sections as plain text without escaping
  103.         public override void WriteCData(string text)
  104.         {
  105.             base.WriteRaw(text);
  106.         }
  107.        
  108.         // Ignore comments
  109.         public override void WriteComment(string text)
  110.         {
  111.         }
  112.        
  113.         // Ignore processing instructions
  114.         public override void WriteProcessingInstruction(string name, string text)
  115.         {
  116.         }
  117.        
  118.         // Ignore entities
  119.         public override void WriteEntityRef(string name)
  120.         {
  121.         }
  122.         public override void WriteCharEntity(char ch)
  123.         {
  124.         }
  125.         public override void WriteSurrogateCharEntity(char lowChar, char highChar)
  126.         {
  127.         }
  128.        
  129.         // Output text content without any escaping; ignore attribute values
  130.         public override void WriteWhitespace(string ws)
  131.         {
  132.             if (!base.inAttributeValue) {
  133.                 base.WriteRaw(ws);
  134.             }
  135.         }
  136.        
  137.         // Output text content without any escaping; ignore attribute values
  138.         public override void WriteString(string textBlock)
  139.         {
  140.             if (!base.inAttributeValue) {
  141.                 base.WriteRaw(textBlock);
  142.             }
  143.         }
  144.        
  145.         // Output text content without any escaping; ignore attribute values
  146.         public override void WriteChars(char[] buffer, int index, int count)
  147.         {
  148.             if (!base.inAttributeValue) {
  149.                 base.WriteRaw(buffer, index, count);
  150.             }
  151.         }
  152.        
  153.         // Output text content without any escaping; ignore attribute values
  154.         public override void WriteRaw(char[] buffer, int index, int count)
  155.         {
  156.             if (!base.inAttributeValue) {
  157.                 base.WriteRaw(buffer, index, count);
  158.             }
  159.         }
  160.        
  161.         // Output text content without any escaping; ignore attribute values
  162.         public override void WriteRaw(string data)
  163.         {
  164.             if (!base.inAttributeValue) {
  165.                 base.WriteRaw(data);
  166.             }
  167.         }
  168.     }
  169. }

Developer Fusion