CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
string_reader.h
1
2#pragma once
3#ifndef _system_io_string_reader_h_
4#define _system_io_string_reader_h_
5
6#include <system/string.h>
7#include <system/io/text_reader.h>
8#include <system/array.h>
9
10namespace System {
11
12namespace IO {
17class ASPOSECPP_SHARED_CLASS StringReader : public System::IO::TextReader
18{
19 typedef StringReader ThisType;
21
22 ASPOSECPP_SHARED_RTTI_INFO_DECL();
23
24public:
28 ASPOSECPP_SHARED_API StringReader(const String &s);
29
31 virtual ASPOSECPP_SHARED_API void Close() override;
34 virtual ASPOSECPP_SHARED_API int Peek() override;
37 virtual ASPOSECPP_SHARED_API int Read() override;
44 virtual ASPOSECPP_SHARED_API int Read(ArrayPtr<char_t> buffer, int index, int count) override;
47 virtual ASPOSECPP_SHARED_API String ReadLine() override;
50 virtual ASPOSECPP_SHARED_API String ReadToEnd() override;
51
53 virtual ASPOSECPP_SHARED_API void Dispose() override;
55 virtual ASPOSECPP_SHARED_API void Dispose(bool disposing) override;
56
57protected:
59 static ASPOSECPP_SHARED_API void ReaderClosed();
60
61private:
63 String _s;
65 int _pos;
67 int _length;
69 bool _closed;
70
71};
72
73} // namespace IO
74} // namespace System
75
76#endif // _system_io_string_reader_h_
77
Represents a reader that reads characters from a string. Objects of this class should only be allocat...
Definition: string_reader.h:18
virtual void Dispose(bool disposing) override
Does nothing.
virtual void Close() override
Closes the stream.
virtual int Peek() override
Reads a single character from the stream without changing the stream's position.
virtual int Read(ArrayPtr< char_t > buffer, int index, int count) override
Reads the specified number of characters from the stream to the specified character array starting at...
static void ReaderClosed()
Throws ObjectDisposedException.
virtual void Dispose() override
Does nothing.
virtual String ReadLine() override
Reads characters from the stream until the end of the current line.
virtual String ReadToEnd() override
Reads characters from the stream until the end of the stream.
virtual int Read() override
Reads a single character from the stream.
StringReader(const String &s)
Constructs a new instance of StringReader class that reads characters from the specified string.
A base class for classes that represent readers that read sequences of characters from different sour...
Definition: text_reader.h:15
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
Definition: db_command.h:9