43 explicit async_result_stream(
const xtd::any_object& async_state) : async_state_(async_state) {}
44 xtd::any_object async_state()
const noexcept override {
return async_state_;}
46 bool completed_synchronously()
const noexcept override {
return false;}
47 bool is_completed()
const noexcept override {
return is_completed_;};
50 bool is_completed_ =
false;
52 std::exception_ptr exception_;
55 class streambuf :
public std::streambuf {
57 explicit streambuf(
stream& owner);
59 int_type underflow()
override;
60 int_type overflow(int_type value)
override;
65 char_type* value_ptr_ =
reinterpret_cast<char_type*
>(&value_);
172 using std::iostream::
read;
188 virtual
int32 read_byte();
204 virtual
void set_length(
xtd::
size value) = 0;
206 using std::iostream::write;
207 virtual
void write(
xtd::
span<const
xtd::
byte> buffer);
210 virtual
void write_byte(
xtd::
byte value);
225 streambuf streambuf_ {*
this};
226 bool closed_ =
false;
Contains xtd::abstract_object class.
Contains xtd::async_callback delegate.
Represent an abstract class.
Definition abstract_object.hpp:27
Represent a polymorphic wrapper capable of holding any type.
Definition any_object.hpp:29
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:61
Represents the status of an asynchronous operation.
Definition iasync_result.hpp:25
virtual int32 write_timeout() const
Gets a value, in milliseconds, that determines how long the stream will attempt to write before timin...
virtual bool is_closed() const noexcept
Indicates if the stream is closed.
virtual int32 read_timeout() const
Gets a value, in milliseconds, that determines how long the stream will attempt to read before timing...
static xtd::io::null_stream null_stream
A Stream with no backing store.
Definition stream.hpp:79
stream()
Initializes a new instance of the xtd::io::stream class.
virtual bool can_read() const noexcept=0
When overridden in a derived class, gets a value indicating whether the current stream supports readi...
static constexpr int32 eof
Represnets an eof value.
Definition stream.hpp:83
void read_exactly(xtd::array< xtd::byte > &buffer)
Reads bytes from the current stream and advances the position within the stream until the buffer is f...
virtual bool can_seek() const noexcept=0
When overridden in a derived class, gets a value indicating whether the current stream supports seeki...
virtual void flush()=0
When overridden in a derived class, clears all buffers for this stream and causes any buffered data t...
void copy_to(std::ostream &destination)
Reads the bytes from the current memory stream and writes them to another stream.
virtual bool can_write() const noexcept=0
Gets a value indicating whether the current stream supports writing.
virtual xtd::size length() const =0
When overridden in a derived class, gets the length in bytes of the stream.
virtual xtd::size read(xtd::span< xtd::byte > &buffer)
When overridden in a derived class, reads a sequence of bytes from the current stream and advances th...
virtual bool can_timeout() const noexcept
Gets a value that determines whether the current stream can time out.
virtual xtd::size position() const =0
When overridden in a derived class, gets the position within the current stream.
xtd::size read_at_least(xtd::array< xtd::byte > &buffer, xtd::size minimum_bytes, bool throw_on_end_of_stream=true)
Reads at least a minimum number of bytes from the current stream and advances the position within the...
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:44
Represents a non-owning view over a contiguous sequence of objects.
Definition span.hpp:58
Represents a thread synchronization event that, when signaled, must be reset manually....
Definition manual_reset_event.hpp:35
Encapsulates operating system specific objects that wait for exclusive access to shared resources.
Definition wait_handle.hpp:52
Contains core_export_ keyword.
#define core_export_
Define shared library export.
Definition core_export.hpp:13
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
uint8_t byte
Represents a 8-bit unsigned integer.
Definition byte.hpp:23
Contains xtd::iasync_result interface.
Contains xtd::io::io_exception exception.
Contains xtd::threading::manual_reset_event exception.
The xtd::io namespace contains types that allow reading and writing to files and data streams,...
Definition binary_reader.hpp:17
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Contains xtd::io::seek_origin enum class.
Contains xtd::span class.
Contains xtd::string alias.