7#include "../threading/manual_reset_event.hpp"
8#include "../abstract_object.hpp"
9#include "../async_callback.hpp"
10#include "../core_export.hpp"
11#include "../iasync_result.hpp"
13#include "../string.hpp"
43 explicit async_result_stream(std::any async_state) : async_state_(async_state) {}
44 std::any 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_;};
49 std::any async_state_;
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_);
83 inline static constexpr int32 eof = EOF;
95 virtual
bool can_seek() const noexcept = 0;
100 virtual
bool can_timeout() const noexcept;
104 virtual
bool can_write() const noexcept = 0;
108 virtual
bool is_closed() const noexcept;
139 virtual
void read_timeout(
int32 value);
146 virtual
int32 write_timeout() const;
153 virtual
void write_timeout(
int32 value);
161 void copy_to(std::ostream& destination);
166 void copy_to(std::ostream& destination,
xtd::
size buffer_size);
170 virtual
void flush() = 0;
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;
Represent an abstract class.
Definition abstract_object.hpp:27
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:59
Represents the status of an asynchronous operation.
Definition iasync_result.hpp:25
Provides a generic view of a sequence of bytes. This is an abstract class.
Definition stream.hpp:40
static xtd::io::null_stream null_stream
A Stream with no backing store.
Definition stream.hpp:79
virtual bool can_read() const noexcept=0
When overridden in a derived class, gets a value indicating whether the current stream supports readi...
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
#define core_export_
Define shared library export.
Definition core_export.hpp:13
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
uint8_t byte
Represents a 8-bit unsigned integer.
Definition byte.hpp:23
Contains xtd::io::io_exception exception.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
Contains xtd::io::seek_origin enum class.