DotNetDupe
4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Toggle main menu visibility
Loading...
Searching...
No Matches
StringWriter.cpp
Go to the documentation of this file.
1
#include "
pch.h
"
2
#include "
System/IO/StringWriter.h
"
3
4
namespace
DotNetDupe
{
5
namespace
System
{
6
namespace
IO
{
7
StringWriter::StringWriter
()
8
: m_pSb(new
Text
::StringBuilder()), m_bIsOpen(true) {
10
}
11
12
StringWriter::StringWriter
(
Text::StringBuilder
& sbOutput)
13
: m_pSb(&sbOutput), m_bIsOpen(true) {
15
}
16
17
void
StringWriter::Close
() {
19
m_bIsOpen =
false
;
20
}
21
22
void
StringWriter::Dispose
() {
24
m_bIsOpen =
false
;
25
}
26
27
void
StringWriter::Flush
() {
29
}
30
31
Text::EncodingPtr
StringWriter::GetEncoding
()
const
{
33
return
Text::TextEncoding::UTF8
();
34
}
35
36
String
StringWriter::ToString
()
const
{
38
return
m_pSb->
ToString
();
39
}
40
41
void
StringWriter::Write
(
bool
bValue) {
43
TextWriter::Write
(bValue);
44
}
45
46
void
StringWriter::Write
(
char
chValue) {
48
if
(!m_bIsOpen)
return
;
50
m_pSb->Append(chValue);
51
}
52
53
void
StringWriter::Write
(
const
String
& sValue) {
55
if
(!m_bIsOpen)
return
;
57
m_pSb->Append(sValue);
58
}
59
60
void
StringWriter::Write
(
const
char
* pValue) {
62
if
(!m_bIsOpen)
return
;
64
m_pSb->Append(pValue);
65
}
66
67
void
StringWriter::Write
(
int
iValue) {
69
TextWriter::Write
(iValue);
70
}
71
72
void
StringWriter::Write
(
long
long
llValue) {
74
TextWriter::Write
(llValue);
75
}
76
77
void
StringWriter::Write
(
float
fValue) {
79
TextWriter::Write
(fValue);
80
}
81
82
void
StringWriter::Write
(
double
dValue) {
84
TextWriter::Write
(dValue);
85
}
86
87
void
StringWriter::WriteLine
() {
89
TextWriter::WriteLine
();
90
}
91
92
void
StringWriter::WriteLine
(
bool
bValue) {
94
TextWriter::WriteLine
(bValue);
95
}
96
97
void
StringWriter::WriteLine
(
char
chValue) {
99
TextWriter::WriteLine
(chValue);
100
}
101
102
void
StringWriter::WriteLine
(
const
char
* pValue) {
104
TextWriter::WriteLine
(pValue);
105
}
106
107
void
StringWriter::WriteLine
(
const
String
& sValue) {
109
TextWriter::WriteLine
(sValue);
110
}
111
112
void
StringWriter::WriteLine
(
int
iValue) {
114
TextWriter::WriteLine
(iValue);
115
}
116
117
void
StringWriter::WriteLine
(
long
long
llValue) {
119
TextWriter::WriteLine
(llValue);
120
}
121
122
void
StringWriter::WriteLine
(
float
fValue) {
124
TextWriter::WriteLine
(fValue);
125
}
126
127
void
StringWriter::WriteLine
(
double
dValue) {
129
TextWriter::WriteLine
(dValue);
130
}
131
}
132
}
133
}
StringWriter.h
DotNetDupe::System::IO::StringWriter::ToString
virtual String ToString() const
Returns a string containing the characters written to the current StringWriter so far.
Definition
StringWriter.cpp:36
DotNetDupe::System::IO::StringWriter::Close
void Close() override
Closes the current StringWriter.
Definition
StringWriter.cpp:17
DotNetDupe::System::IO::StringWriter::Dispose
void Dispose() override
Releases all resources used by the StringWriter.
Definition
StringWriter.cpp:22
DotNetDupe::System::IO::StringWriter::WriteLine
void WriteLine() override
Writes a line terminator to the text string.
Definition
StringWriter.cpp:87
DotNetDupe::System::IO::StringWriter::Flush
void Flush() override
Clears all buffers for the current writer.
Definition
StringWriter.cpp:27
DotNetDupe::System::IO::StringWriter::Write
void Write(bool bValue) override
Writes the text representation of a Boolean value to the text string.
Definition
StringWriter.cpp:41
DotNetDupe::System::IO::StringWriter::StringWriter
StringWriter()
Initializes a new instance of the StringWriter class.
Definition
StringWriter.cpp:7
DotNetDupe::System::IO::StringWriter::GetEncoding
virtual Text::EncodingPtr GetEncoding() const override
Gets the Encoding in which the output is written.
Definition
StringWriter.cpp:31
DotNetDupe::System::IO::TextWriter::Write
virtual void Write(bool bValue)=0
Writes the text representation of a Boolean value to the text string or stream.
Definition
TextWriter.cpp:21
DotNetDupe::System::IO::TextWriter::WriteLine
virtual void WriteLine()=0
Writes a line terminator to the text stream.
Definition
TextWriter.cpp:59
DotNetDupe::System::String
Represents text as a sequence of UTF-8 code units with culture-invariant operations.
Definition
String.h:74
DotNetDupe::System::String::ToString
static String ToString(int iValue)
Definition
String.cpp:643
DotNetDupe::System::Text::StringBuilder
Represents a mutable string of characters.
Definition
StringBuilder.h:21
DotNetDupe::System::Text::TextEncoding::UTF8
static EncodingPtr UTF8()
Gets an encoding for the UTF-8 format.
Definition
TextEncoding.cpp:44
DotNetDupe::System::IO
Definition
Console.h:17
DotNetDupe::System::Text
Definition
JsonElement.h:16
DotNetDupe::System::Text::EncodingPtr
SmartPointer< Encoding > EncodingPtr
SmartPointer alias for Encoding instances.
Definition
TextEncoding.h:20
DotNetDupe::System
Definition
Action.h:11
DotNetDupe
Definition
IServiceCollection.h:7
pch.h
DotNetDupe
StringWriter.cpp
Generated by
1.18.0