jaulib v1.3.0
Jau Support Library (C++, Java, ..)
|
Abstract byte output stream object, to write data to a sink. More...
#include <byte_stream.hpp>
Public Member Functions | |
ByteOutStream ()=default | |
ByteOutStream (const ByteOutStream &)=delete | |
~ByteOutStream () noexcept override=default | |
virtual void | close () noexcept=0 |
Close the stream if supported by the underlying mechanism. More... | |
virtual std::string | id () const noexcept |
return the id of this data source More... | |
virtual bool | is_open () const noexcept=0 |
Checks if the stream has an associated file. More... | |
ByteOutStream & | operator= (const ByteOutStream &)=delete |
virtual uint64_t | tellp () const noexcept=0 |
Returns the output position indicator. More... | |
virtual std::string | to_string () const noexcept=0 |
bool | write (const uint8_t &in) noexcept |
Write one byte. More... | |
virtual size_t | write (const void *in, size_t length) noexcept=0 |
Write to the data sink. More... | |
Public Member Functions inherited from jau::io::iostate_func | |
iostate_func () noexcept | |
iostate_func (const iostate_func &o) noexcept=default | |
iostate_func (iostate_func &&o) noexcept=default | |
virtual | ~iostate_func () noexcept=default |
bool | bad () const noexcept |
Checks if a non-recoverable error has occurred. More... | |
virtual void | clear (const iostate state=iostate::goodbit) noexcept |
Clears state flags by assignment to the given value. More... | |
bool | eof () const noexcept |
Checks if end-of-file has been reached. More... | |
bool | fail () const noexcept |
Checks if an error has occurred. More... | |
bool | good () const noexcept |
Checks if no error nor eof() has occurred i.e. More... | |
operator bool () const noexcept | |
Checks if no error has occurred, synonym of !fail(). More... | |
bool | operator! () const noexcept |
Checks if an error has occurred, synonym of fail(). More... | |
iostate_func & | operator= (const iostate_func &o) noexcept=default |
iostate_func & | operator= (iostate_func &&o) noexcept=default |
virtual iostate | rdstate () const noexcept |
Returns the current state flags. More... | |
void | setstate (const iostate state) noexcept |
Sets state flags, by keeping its previous bits. More... | |
bool | timeout () const noexcept |
Checks if a timeout (non-recoverable) has occurred. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from jau::io::iostate_func | |
constexpr iostate | rdstate_impl () const noexcept |
constexpr void | setstate_impl (iostate state) const noexcept |
Abstract byte output stream object, to write data to a sink.
All method implementations are of noexcept
.
One may use fail() to detect whether an error has occurred.
Definition at line 806 of file byte_stream.hpp.
|
default |
|
overridedefaultnoexcept |
|
delete |
|
delete |
|
pure virtualnoexcept |
Checks if the stream has an associated file.
Implemented in jau::io::ByteOutStream_File.
|
pure virtualnoexcept |
Close the stream if supported by the underlying mechanism.
Implemented in jau::io::ByteOutStream_File.
|
pure virtualnoexcept |
Write to the data sink.
Moves the internal offset so that every call to write will be appended to the sink.
This method is not blocking beyond the transfer length bytes.
in | the input bytes to write out |
length | the length of the byte array in |
Implemented in jau::io::ByteOutStream_File.
|
noexcept |
Write one byte.
in | the byte to be written |
Definition at line 630 of file byte_stream.cpp.
|
inlinevirtualnoexcept |
return the id of this data source
Reimplemented in jau::io::ByteOutStream_File.
Definition at line 845 of file byte_stream.hpp.
|
pure virtualnoexcept |
Returns the output position indicator.
Implemented in jau::io::ByteOutStream_File.
|
pure virtualnoexcept |
Implemented in jau::io::ByteOutStream_File.