DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
TextReader.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"
7
8namespace DotNetDupe {
9 namespace System {
10 namespace IO {
17 class TextReader : public Object, public IDisposable {
18 public:
20 virtual ~TextReader() = default;
21
23 DOTNETDUPE_API virtual void Close() = 0;
24
26 DOTNETDUPE_API virtual void Dispose() override = 0;
27
30 DOTNETDUPE_API virtual int Peek() = 0;
31
34 DOTNETDUPE_API virtual int Read() = 0;
35
41 DOTNETDUPE_API virtual int Read(char* pBuffer, int iIndex, int nCount) = 0;
42
45 DOTNETDUPE_API virtual String ReadLine() = 0;
46
49 DOTNETDUPE_API virtual String ReadToEnd() = 0;
50
51 protected:
53 TextReader() = default;
54 };
55 }
56 }
57}
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.
Provides a mechanism for releasing unmanaged resources.
Definition IDisposable.h:13
virtual ~TextReader()=default
Virtual destructor ensuring proper polymorphic cleanup.
virtual void Close()=0
Closes the TextReader and releases any system resources associated with the reader.
virtual int Read()=0
Reads the next character from the text reader and advances the character position by one character.
virtual int Peek()=0
Reads the next character without changing the state of the reader or the character source.
virtual String ReadLine()=0
Reads a line of characters from the text reader and returns the data as a string.
TextReader()=default
Initializes a new instance of the TextReader class.
virtual void Dispose() override=0
Releases all resources used by the TextReader.
virtual String ReadToEnd()=0
Reads all characters from the current position to the end of the text reader and returns them as one ...
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