CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
text_reader.h
1
2#ifndef __TextReader_h__
3#define __TextReader_h__
4
5#include "system/string.h"
6#include "system/array.h"
7#include "system/idisposable.h"
8
9namespace System { namespace IO {
14 class ASPOSECPP_SHARED_CLASS TextReader: public IDisposable
15 {
16 RTTI_INFO(System::IO::TextReader, ::System::BaseTypesInfo<System::IDisposable>)
17
18 protected:
23 virtual ASPOSECPP_SHARED_API void Dispose(bool disposing);
24
25 public:
27 virtual void Dispose() override { Dispose(true); }
29 virtual void Close() { Dispose(true); }
30
34 virtual int Peek() { return -1; }
38 virtual int Read() { return -1; }
45 virtual ASPOSECPP_SHARED_API int Read(ArrayPtr<char_t> buffer, int index, int count);
52 virtual ASPOSECPP_SHARED_API int ReadBlock(ArrayPtr<char_t> buffer, int index, int count);
55 virtual ASPOSECPP_SHARED_API System::String ReadLine();
58 virtual ASPOSECPP_SHARED_API System::String ReadToEnd();
59 };
60
61}}
62
63#endif
Defines method that releases resources owned by the current object. Objects of this class should only...
Definition: idisposable.h:30
A base class for classes that represent readers that read sequences of characters from different sour...
Definition: text_reader.h:15
TextReader()
Constructs a new instance of TextReader.
Definition: text_reader.h:20
virtual int Peek()
Reads a single character from the stream without changing the stream's read cursor.
Definition: text_reader.h:34
virtual void Dispose(bool disposing)
Releases all resources used by the current object and closes the undelying stream.
virtual System::String ReadLine()
Reads characters from the stream until the end of the current line.
virtual int Read(ArrayPtr< char_t > buffer, int index, int count)
Reads the specified number of characters from the stream and writes them to the specified character a...
virtual void Dispose() override
Releases all resources used by the current object and closes the undelying stream.
Definition: text_reader.h:27
virtual void Close()
Closes the stream and releases aquired resources.
Definition: text_reader.h:29
virtual int ReadBlock(ArrayPtr< char_t > buffer, int index, int count)
Reads the specified maximum number of characters from the current text reader and writes the data to ...
virtual System::String ReadToEnd()
Reads characters from the stream until the end of the stream.
virtual int Read()
Reads a single character from the stream.
Definition: text_reader.h:38
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