2#ifndef __StreamReader_h__
3#define __StreamReader_h__
5#include "system/io/text_reader.h"
6#include "system/text/string_builder.h"
7#include "system/string.h"
12namespace System {
namespace IO {
61 bool detectEncodingFromByteOrderMarks,
int bufferSize,
bool leaveOpen);
100 void Init(
const EncodingPtr& encoding,
bool detectEncodingFromByteOrderMarks,
int bufferSize);
108 virtual ASPOSECPP_SHARED_API
int Peek()
override;
112 virtual ASPOSECPP_SHARED_API
int Read()
override;
127 virtual ASPOSECPP_SHARED_API
void Close()
override;
139 ASPOSECPP_SHARED_API
void Dispose(
bool disposing)
override;
148 int ReadBufferCore(
int cbEncoded);
152 int DoChecks(
int count);
156 bool leave_open =
false;
164 std::mutex input_buffer_recycle_lock;
197 static const int DefaultBufferSize = 1024;
199 static const int DefaultFileBufferSize = 4096;
201 static const int MinimumBufferSize = 128;
204#ifdef ASPOSE_GET_SHARED_MEMBERS
205 virtual ASPOSECPP_SHARED_API
void GetSharedMembers(System::Object::shared_members_type& result)
const override;
208#ifdef __DBG_FOR_EACH_MEMBER
210 ASPOSECPP_SHARED_API
void DBG_for_each_member(DBG::for_each_member_visitor &visitor)
const override;
211 const char* DBG_class_name()
const override {
return "StreamReader"; }
Represents a reader that reads characters from a byte stream. Objects of this class should only be al...
Definition: stream_reader.h:22
SharedPtr< Stream > get_BaseStream() const
Returns a shared pointer to an object that represents the underlying stream.
Definition: stream_reader.h:134
bool get_EndOfStream()
Returns a value that indicates if the end of of stream has been reached.
StreamReader(const SharedPtr< Stream > &stream, const EncodingPtr &encoding)
Constructs an instance of StreamReader object that reads characters from the specified underlying str...
StreamReader(const SharedPtr< Stream > &stream)
Constructs an instance of StreamReader object that reads characters from the specified underlying str...
StreamReader(const System::String &path)
Constructs an instance of StreamReader object that reads characters from the specified file using UTF...
StreamReader(const System::String &path, const EncodingPtr &encoding, bool detectEncodingFromByteOrderMarks, int bufferSize)
Constructs an instance of StreamReader object that reads characters from the specified file using the...
StreamReader(const SharedPtr< Stream > &stream, const EncodingPtr &encoding, bool detectEncodingFromByteOrderMarks, int bufferSize, bool leaveOpen)
Constructs an instance of StreamReader object that reads characters from the specified underlying str...
EncodingPtr get_CurrentEncoding()
Returns the currently used encoding.
Definition: stream_reader.h:132
StreamReader(const System::String &path, const EncodingPtr &encoding)
Constructs an instance of StreamReader object that reads characters from the specified file using the...
virtual String ReadLine() override
Reads characters from the stream until the end of the current line.
virtual int Read(ArrayPtr< char_t > buffer, int index, int count) override
Reads the specified number of characters from the stream, converts them to UTF-16 encoding and writes...
StreamReader(const SharedPtr< Stream > &stream, const EncodingPtr &encoding, bool detectEncodingFromByteOrderMarks, int bufferSize)
Constructs an instance of StreamReader object that reads characters from the specified underlying str...
virtual int Peek() override
Reads a single character from the stream without changing the stream's read cursor.
~StreamReader()
Destructor.
StreamReader(const System::String &path, const EncodingPtr &encoding, bool detectEncodingFromByteOrderMarks)
Constructs an instance of StreamReader object that reads characters from the specified underlying str...
virtual int Read() override
Reads a single character from the stream.
StreamReader(const System::String &path, bool detectEncodingFromByteOrderMarks)
Constructs an instance of StreamReader object that reads characters from the specified file using UTF...
virtual void Close() override
Closes the current and underlying streams.
StreamReader(const SharedPtr< Stream > &stream, bool detectEncodingFromByteOrderMarks)
Constructs an instance of StreamReader object that reads characters from the specified underlying str...
void Dispose(bool disposing) override
Releases all resources used by the current object and closes the undelying stream.
StreamReader(const SharedPtr< Stream > &stream, const EncodingPtr &encoding, bool detectEncodingFromByteOrderMarks)
Constructs an instance of StreamReader object that reads characters from the specified underlying str...
virtual String ReadToEnd() override
Reads characters from the stream until the end of the stream.
A base class for classes that represent readers that read sequences of characters from different sour...
Definition: text_reader.h:15
virtual void Dispose() override
Releases all resources used by the current object and closes the undelying stream.
Definition: text_reader.h:27
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:126
Buffer to accumulate string part by part. This type can be allocated either in stack as value type or...
Definition: string_builder.h:17
@ Stream
The type that supports reliable, two-way, connection-based byte streams without duplication of data a...
Definition: db_command.h:9