System::IO::TextReader class

TextReader class

A base class for classes that represent readers that read sequences of characters from different sources. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument.

class TextReader : public System::IDisposable

Methods

MethodDescription
virtual Close()Closes the stream and releases aquired resources.
Dispose() overrideReleases all resources used by the current object and closes the undelying stream.
virtual Peek()Reads a single character from the stream without changing the stream’s read cursor.
virtual Read()Reads a single character from the stream.
virtual Read(ArrayPtr<char_t>, int, int)Reads the specified number of characters from the stream and writes them to the specified character array starting at the specified position.
virtual ReadBlock(ArrayPtr<char_t>, int, int)Reads the specified maximum number of characters from the current text reader and writes the data to a buffer, starting at the specified index.
virtual ReadLine()Reads characters from the stream until the end of the current line.
virtual ReadToEnd()Reads characters from the stream until the end of the stream.

See Also