DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
TextWriter.h
Go to the documentation of this file.
1#pragma once
2
3#include "Common.h"
4#include "System/Object.h"
5#include "System/String.h"
8
9namespace DotNetDupe {
10 namespace System {
11 namespace IO {
18 class TextWriter : public Object, public IDisposable {
19 public:
21 virtual ~TextWriter() = default;
22
24 DOTNETDUPE_API virtual void Close() = 0;
25
27 DOTNETDUPE_API virtual void Dispose() override = 0;
28
30 DOTNETDUPE_API virtual void Flush() = 0;
31
35
38 DOTNETDUPE_API virtual void Write(bool bValue) = 0;
39
42 DOTNETDUPE_API virtual void Write(char chValue) = 0;
43
46 DOTNETDUPE_API virtual void Write(const char* pValue) = 0;
47
50 DOTNETDUPE_API virtual void Write(const String& sValue) = 0;
51
54 DOTNETDUPE_API virtual void Write(int iValue) = 0;
55
58 DOTNETDUPE_API virtual void Write(long long llValue) = 0;
59
62 DOTNETDUPE_API virtual void Write(float fValue) = 0;
63
66 DOTNETDUPE_API virtual void Write(double dValue) = 0;
67
69 DOTNETDUPE_API virtual void WriteLine() = 0;
70
73 DOTNETDUPE_API virtual void WriteLine(bool bValue) = 0;
74
77 DOTNETDUPE_API virtual void WriteLine(char chValue) = 0;
78
81 DOTNETDUPE_API virtual void WriteLine(const char* pValue) = 0;
82
85 DOTNETDUPE_API virtual void WriteLine(const String& sValue) = 0;
86
89 DOTNETDUPE_API virtual void WriteLine(int iValue) = 0;
90
93 DOTNETDUPE_API virtual void WriteLine(long long llValue) = 0;
94
97 DOTNETDUPE_API virtual void WriteLine(float fValue) = 0;
98
101 DOTNETDUPE_API virtual void WriteLine(double dValue) = 0;
102
103 protected:
105 TextWriter() = default;
106
109 DOTNETDUPE_API static const String& GetNewLine();
110 };
111 }
112 }
113}
Defines common cross-platform macros, export decorators, and fundamental types.
#define DOTNETDUPE_API
Platform-specific linkage decoration for exporting or importing library symbols.
Definition Common.h:20
Base object class for DotNetDupe mirroring .NET System.Object.
High-performance UTF-8 / UTF-16 string manipulation class mirroring .NET System.String.
Represents character encodings and code page conversions.
Provides a mechanism for releasing unmanaged resources.
Definition IDisposable.h:13
virtual Text::EncodingPtr GetEncoding() const =0
When overridden in a derived class, returns the character encoding in which the output is written.
virtual void Write(bool bValue)=0
Writes the text representation of a Boolean value to the text string or stream.
virtual void Flush()=0
Clears all buffers for the current writer and causes any buffered data to be written to the underlyin...
virtual ~TextWriter()=default
Virtual destructor ensuring proper polymorphic cleanup.
static const String & GetNewLine()
Gets the default line terminator string.
virtual void Dispose() override=0
Releases all resources used by the TextWriter object.
TextWriter()=default
Initializes a new instance of the TextWriter class.
virtual void Close()=0
Closes the current writer and releases any system resources associated with the writer.
Definition TextWriter.cpp:9
virtual void WriteLine()=0
Writes a line terminator to the text stream.
Supports all classes in the DotNetDupe class hierarchy.
Definition Object.h:18
Represents text as a sequence of UTF-8 code units with culture-invariant operations.
Definition String.h:74
SmartPointer< Encoding > EncodingPtr
SmartPointer alias for Encoding instances.