DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
StringReader.h
Go to the documentation of this file.
1#pragma once
2
3#include "Common.h"
5
6namespace DotNetDupe {
7 namespace System {
8 namespace IO {
15 class StringReader : public TextReader {
16 public:
19 DOTNETDUPE_API StringReader(const String& sSource);
20
22 DOTNETDUPE_API virtual ~StringReader() = default;
23
25 DOTNETDUPE_API void Close() override;
26
28 DOTNETDUPE_API void Dispose() override;
29
32 DOTNETDUPE_API int Peek() override;
33
36 DOTNETDUPE_API int Read() override;
37
43 DOTNETDUPE_API int Read(char* pBuffer, int iIndex, int nCount) override;
44
48
52
53 private:
54 String m_sSource;
55 int m_iPos;
56 int m_nLength;
57 };
58 }
59 }
60}
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
StringReader(const String &sSource)
Initializes a new instance of the StringReader class that reads from the specified string.
void Close() override
Closes the StringReader.
String ReadLine() override
Reads a line of characters from the current string and returns the data as a string.
int Peek() override
Returns the next available character but does not consume it.
virtual ~StringReader()=default
Virtual destructor ensuring proper resource cleanup.
String ReadToEnd() override
Reads all characters from the current position to the end of the string and returns them as a single ...
void Dispose() override
Releases all resources used by the StringReader.
int Read() override
Reads the next character from the input string and advances the character position by one character.
TextReader()=default
Initializes a new instance of the TextReader class.
Represents text as a sequence of UTF-8 code units with culture-invariant operations.
Definition String.h:74