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