DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
LoggerTextWriter.h
Go to the documentation of this file.
1#pragma once
2#include "Common.h"
4#include "System/String.h"
7
8namespace DotNetDupe {
9 namespace Extensions {
10 namespace Logging {
11
17 private:
19 LogLevel m_logLevel;
20
21 public:
26 const DotNetDupe::System::String& sCategoryName = "Console",
28
35
37 DOTNETDUPE_API virtual ~LoggerTextWriter() override = default;
38
40 DOTNETDUPE_API void Close() override;
42 DOTNETDUPE_API void Dispose() override;
44 DOTNETDUPE_API void Flush() override;
45
48
50 DOTNETDUPE_API void Write(bool bValue) override;
52 DOTNETDUPE_API void Write(char chValue) override;
54 DOTNETDUPE_API void Write(const char* pValue) override;
56 DOTNETDUPE_API void Write(const DotNetDupe::System::String& sValue) override;
58 DOTNETDUPE_API void Write(int iValue) override;
60 DOTNETDUPE_API void Write(long long llValue) override;
62 DOTNETDUPE_API void Write(float fValue) override;
64 DOTNETDUPE_API void Write(double dValue) override;
65
67 DOTNETDUPE_API void WriteLine() override;
69 DOTNETDUPE_API void WriteLine(bool bValue) override;
71 DOTNETDUPE_API void WriteLine(char chValue) override;
73 DOTNETDUPE_API void WriteLine(const char* pValue) override;
75 DOTNETDUPE_API void WriteLine(const DotNetDupe::System::String& sValue) override;
77 DOTNETDUPE_API void WriteLine(int iValue) override;
79 DOTNETDUPE_API void WriteLine(long long llValue) override;
81 DOTNETDUPE_API void WriteLine(float fValue) override;
83 DOTNETDUPE_API void WriteLine(double dValue) override;
84 };
85
86 }
87 }
88}
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
Provides reference-counted and weak pointer memory management primitives ensuring zero raw ownership.
High-performance UTF-8 / UTF-16 string manipulation class mirroring .NET System.String.
void Dispose() override
Disposes the writer resources.
void Flush() override
Flushes any buffered text to the logger.
void Close() override
Closes the writer and flushes buffered content.
void Write(bool bValue) override
Writes a boolean value to the logger buffer.
LoggerTextWriter(const DotNetDupe::System::String &sCategoryName="Console", LogLevel logLevel=LogLevel::Information)
Initializes a LoggerTextWriter with category name and log level.
void WriteLine() override
Writes a line terminator, emitting the accumulated buffer to the logger.
virtual System::Text::EncodingPtr GetEncoding() const override
Gets the character encoding for text output (UTF-8).
virtual ~LoggerTextWriter() override=default
Virtual destructor.
Represents a writer that can write a sequential series of characters.
Definition TextWriter.h:18
A unified smart pointer that supports both unique and shared ownership semantics.
Represents text as a sequence of UTF-8 code units with culture-invariant operations.
Definition String.h:74
LogLevel
Defines logging severity levels.
Definition ILogger.h:15
@ Information
Logs that track the general flow of the application.
Definition ILogger.h:21
SmartPointer< Encoding > EncodingPtr
SmartPointer alias for Encoding instances.