Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
TextOnlyOutput.cs
Go to the documentation of this file.
1using System.IO;
2
4
5internal sealed class TextOnlyOutput : IRecordOutput
6{
7 private readonly Processor _processor;
8
9 private readonly TextWriter _writer;
10
12
13 public TextWriter Writer => _writer;
14
16 {
17 if (stream == null)
18 {
19 throw new ArgumentNullException("stream");
20 }
23 }
24
26 {
27 if (writer == null)
28 {
29 throw new ArgumentNullException("writer");
30 }
33 }
34
36 {
37 BuilderInfo mainNode = record.MainNode;
38 XmlNodeType nodeType = mainNode.NodeType;
39 if (nodeType == XmlNodeType.Text || (uint)(nodeType - 13) <= 1u)
40 {
41 _writer.Write(mainNode.Value);
42 }
43 record.Reset();
44 return Processor.OutputResult.Continue;
45 }
46
47 public void TheEnd()
48 {
49 _writer.Flush();
50 }
51}
virtual void Write(char value)
virtual void Flush()
Processor.OutputResult RecordDone(RecordBuilder record)
TextOnlyOutput(Processor processor, Stream stream)
TextOnlyOutput(Processor processor, TextWriter writer)