DotNetDupe
4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Toggle main menu visibility
Loading...
Searching...
No Matches
TextWriter.cpp
Go to the documentation of this file.
1
#include "
pch.h
"
2
#include "
System/IO/TextWriter.h
"
3
#include "
System/Convert.h
"
4
#include "
System/Char.h
"
5
6
namespace
DotNetDupe
{
7
namespace
System
{
8
namespace
IO
{
9
void
TextWriter::Close
() {
10
Dispose
();
11
}
12
13
void
TextWriter::Dispose
() {
14
// Base implementation does nothing
15
}
16
17
void
TextWriter::Flush
() {
18
// Base implementation does nothing
19
}
20
21
void
TextWriter::Write
(
bool
bValue) {
22
Write
(
Convert::ToString
(bValue));
23
}
24
25
void
TextWriter::Write
(
char
chValue) {
26
// Base class does not know how to write, should be overridden
27
}
28
29
void
TextWriter::Write
(
const
char
* pValue) {
31
if
(pValue ==
nullptr
)
return
;
32
33
Write
(
String
(pValue));
34
}
35
36
void
TextWriter::Write
(
const
String
& sValue) {
38
for
(
int
iIdx = 0; iIdx < sValue.
GetLength
(); iIdx++) {
39
Write
((
char
)sValue[iIdx]);
40
}
41
}
42
43
void
TextWriter::Write
(
int
iValue) {
44
Write
(
Convert::ToString
(iValue));
45
}
46
47
void
TextWriter::Write
(
long
long
llValue) {
48
Write
(
Convert::ToString
(llValue));
49
}
50
51
void
TextWriter::Write
(
float
fValue) {
52
Write
(
Convert::ToString
(fValue));
53
}
54
55
void
TextWriter::Write
(
double
dValue) {
56
Write
(
Convert::ToString
(dValue));
57
}
58
59
void
TextWriter::WriteLine
() {
60
Write
(
GetNewLine
());
61
}
62
63
void
TextWriter::WriteLine
(
bool
bValue) {
64
Write
(bValue);
65
WriteLine
();
66
}
67
68
void
TextWriter::WriteLine
(
char
chValue) {
69
Write
(chValue);
70
WriteLine
();
71
}
72
73
void
TextWriter::WriteLine
(
const
char
* pValue) {
74
Write
(pValue);
75
WriteLine
();
76
}
77
78
void
TextWriter::WriteLine
(
const
String
& sValue) {
79
Write
(sValue);
80
WriteLine
();
81
}
82
83
void
TextWriter::WriteLine
(
int
iValue) {
84
Write
(iValue);
85
WriteLine
();
86
}
87
88
void
TextWriter::WriteLine
(
long
long
llValue) {
89
Write
(llValue);
90
WriteLine
();
91
}
92
93
void
TextWriter::WriteLine
(
float
fValue) {
94
Write
(fValue);
95
WriteLine
();
96
}
97
98
void
TextWriter::WriteLine
(
double
dValue) {
99
Write
(dValue);
100
WriteLine
();
101
}
102
103
const
String
&
TextWriter::GetNewLine
() {
104
static
String
sNewLine(
"\r\n"
);
105
return
sNewLine;
106
}
107
}
108
}
109
}
Char.h
Represents a Unicode character code point mirroring .NET System.Char.
Convert.h
Converts a base data type to another base data type, and encodes/decodes Base64 data.
TextWriter.h
DotNetDupe::System::Convert::ToString
static String ToString(bool value)
Definition
Convert.cpp:253
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::Flush
virtual void Flush()=0
Clears all buffers for the current writer and causes any buffered data to be written to the underlyin...
Definition
TextWriter.cpp:17
DotNetDupe::System::IO::TextWriter::GetNewLine
static const String & GetNewLine()
Gets the default line terminator string.
Definition
TextWriter.cpp:103
DotNetDupe::System::IO::TextWriter::Dispose
virtual void Dispose() override=0
Releases all resources used by the TextWriter object.
Definition
TextWriter.cpp:13
DotNetDupe::System::IO::TextWriter::Close
virtual void Close()=0
Closes the current writer and releases any system resources associated with the writer.
Definition
TextWriter.cpp:9
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::GetLength
int GetLength() const
Definition
String.cpp:247
DotNetDupe::System::String::String
String()
Initializes a new instance of the String class to an empty string.
Definition
String.cpp:64
DotNetDupe::System::IO
Definition
Console.h:17
DotNetDupe::System
Definition
Action.h:11
DotNetDupe
Definition
IServiceCollection.h:7
pch.h
DotNetDupe
TextWriter.cpp
Generated by
1.18.0