6#include "system/io/stream.h"
7#include "system/bit_converter.h"
8#include "system/details/is_template_base_of.h"
10namespace System {
namespace IO {
12using System::Details::IsTemplateBaseOf;
42template <typename T, typename = std::enable_if_t<IsTemplateBaseOf<std::basic_ios, T>::value>>
75 throw ArgumentException(u
"Invalid SeekOrigin enum value", u
"origin");
78 throw NotSupportedException(u
"Can't seek stream.");
97 throw ArgumentOutOfRangeException(u
"Seeking is attempted before the beginning of the stream.");
120 throw ArgumentOutOfRangeException(u
"Seeking is attempted before the beginning of the stream.");
125 bool has_new_byte_pos_shift = new_pos %
m_elem_size != 0;
127 if (new_elem_pos != -1)
130 if (has_new_byte_pos_shift)
150 throw NotSupportedException(u
"Can't seek stream.");
153 throw ArgumentOutOfRangeException(u
"value must be non-negative");
167 int64_t new_byte_pos = value;
168 bool has_new_byte_pos_shift = new_byte_pos %
m_elem_size != 0;
170 if (new_elem_pos != -1)
173 if (has_new_byte_pos_shift)
191 throw NotSupportedException(u
"Can't seek stream.");
209 throw NotSupportedException(u
"Can't seek stream.");
249 bool can_write =
false,
bool can_seek =
false,
254 can_read ? int64_t(
m_stream.rdbuf()->pubseekoff(0, std::ios_base::cur, std::ios_base::in)) : int64_t(0);
256 can_write ? int64_t(
m_stream.rdbuf()->pubseekoff(0, std::ios_base::cur, std::ios_base::out)) : int64_t(0);
287 int64_t end =
m_stream.rdbuf()->pubseekoff(0, std::ios_base::end, std::ios_base::in);
288 int64_t beg =
m_stream.rdbuf()->pubseekoff(0, std::ios_base::beg, std::ios_base::in);
296 int64_t end =
m_stream.rdbuf()->pubseekoff(0, std::ios_base::end, std::ios_base::in);
297 int64_t beg =
m_stream.rdbuf()->pubseekoff(0, std::ios_base::beg, std::ios_base::in);
305 int64_t end =
m_stream.rdbuf()->pubseekoff(0, std::ios_base::end, std::ios_base::out);
306 int64_t beg =
m_stream.rdbuf()->pubseekoff(0, std::ios_base::beg, std::ios_base::out);
327 throw NotSupportedException(u
"Wrapper does not support current wrapping mode.");
345 if (traits_type::eq_int_type(meta, traits_type::eof()))
377 auto dst = (uint8_t*)destination;
384 std::reverse_copy(source, source +
m_elem_size, dst);
420template <typename T, typename = std::enable_if_t<IsTemplateBaseOf<std::basic_istream, T>::value>>
439 :
BaseType(str, mode, true, false, (std::ios_base*)&str != &std::cin && (std::ios_base*)&str != &std::wcin)
456 throw NotSupportedException(u
"Can't read from stream.");
460 auto meta =
m_stream.rdbuf()->sbumpc();
461 if (traits_type::eq_int_type(meta, traits_type::eof()))
468 return uint8_t(meta);
475 auto meta =
m_stream.rdbuf()->sgetc();
476 if (traits_type::eq_int_type(meta, traits_type::eof()))
491 if (byte_pos_shift == 0)
506 throw NotSupportedException(ASPOSE_CURRENT_FUNCTION);
518 return Read(
static_cast<System::Details::ArrayView<uint8_t>
>(buffer), offset, count);
529 Write(
static_cast<System::Details::ArrayView<uint8_t>
>(buffer), offset, count);
537 virtual int32_t
Read(
const System::Details::ArrayView<uint8_t>& buffer, int32_t offset, int32_t count)
override
542 throw NotSupportedException(u
"Can't read from stream.");
543 if (buffer ==
nullptr)
544 throw ArgumentNullException(u
"buffer");
546 throw ArgumentOutOfRangeException(u
"offset", u
"Value is less than zero");
548 throw ArgumentOutOfRangeException(u
"count", u
"Value is less than zero");
549 if (buffer.get_Length() - offset < count)
550 throw ArgumentException(u
"Invalid buffer length");
557 int readed_count = int(
m_stream.rdbuf()->sgetn((
char_type*)&buffer[offset], count));
569 std::vector<char_type> tempbuff(count, 0);
570 int readed_count = int(
m_stream.rdbuf()->sgetn(tempbuff.data(), count));
571 auto dst = &buffer[offset];
572 std::for_each(tempbuff.begin(), tempbuff.end(),
573 [&dst,
this](
char_type& elem) { *(dst++) = uint8_t(elem); });
581 int new_byte_count = byte_pos_shift + count;
582 bool has_new_byte_pos_shift = new_byte_count %
m_elem_size != 0;
583 int elem_count = new_byte_count /
m_elem_size + int(has_new_byte_pos_shift);
585 std::vector<char_type> tempbuff(elem_count, 0);
586 int readed_elem_count = int(
m_stream.rdbuf()->sgetn(tempbuff.data(), elem_count));
587 int readed_byte_count;
588 if (readed_elem_count != elem_count)
590 readed_byte_count = readed_elem_count *
m_elem_size - byte_pos_shift;
594 readed_byte_count = count;
595 if (has_new_byte_pos_shift)
597 m_stream.rdbuf()->pubseekoff(-1, std::ios_base::cur, std::ios_base::in);
603 const char_type* source = &tempbuff[byte_pos_shift];
604 uint8_t* destination = &buffer[offset];
607 DecodeElem(traits_type::to_int_type(*source));
612 return readed_byte_count;
620 virtual void Write(
const System::Details::ArrayView<uint8_t>& buffer, int32_t offset, int32_t count)
override
622 throw NotSupportedException(ASPOSE_CURRENT_FUNCTION);
629 throw NotSupportedException(ASPOSE_CURRENT_FUNCTION);
635 throw NotSupportedException(ASPOSE_CURRENT_FUNCTION);
644 return m_stream.rdbuf()->pubseekpos(value, std::ios_base::in);
651 auto elem_gpos =
m_stream.rdbuf()->pubseekoff(0, std::ios_base::cur, std::ios_base::in);
656 m_stream.setstate(std::ios_base::failbit);
659 throw IOException(u
"The stream has been modified outside the wrapper.");
666 auto elem_gpos =
m_stream.rdbuf()->pubseekoff(0, std::ios_base::cur, std::ios_base::in);
691template <typename T, typename = std::enable_if_t<IsTemplateBaseOf<std::basic_ostream, T>::value>>
710 :
BaseType(str, mode, false, true, (std::ios_base*)&str != &std::cout && (std::ios_base*)&str != &std::wcout)
724 throw NotSupportedException(ASPOSE_CURRENT_FUNCTION);
735 throw NotSupportedException(u
"Can't write to stream.");
754 if (byte_pos_shift != 0)
756 m_stream.rdbuf()->pubseekoff(-1, std::ios_base::cur, std::ios_base::in);
776 return Read(
static_cast<System::Details::ArrayView<uint8_t>
>(buffer), offset, count);
787 Write(
static_cast<System::Details::ArrayView<uint8_t>
>(buffer), offset, count);
795 virtual int32_t
Read(
const System::Details::ArrayView<uint8_t>& buffer, int32_t offset, int32_t count)
override
797 throw NotSupportedException(ASPOSE_CURRENT_FUNCTION);
804 virtual void Write(
const System::Details::ArrayView<uint8_t>& buffer, int32_t offset, int32_t count)
override
809 throw NotSupportedException(u
"Can't write to stream.");
810 if (buffer ==
nullptr)
811 throw ArgumentNullException(u
"buffer");
813 throw ArgumentOutOfRangeException(u
"offset", u
"Value is less than zero");
815 throw ArgumentOutOfRangeException(u
"count", u
"Value is less than zero");
816 if (buffer.get_Length() - offset < count)
817 throw ArgumentException(u
"Invalid buffer length");
836 std::vector<char_type> tempbuff(count, 0);
837 auto dst = tempbuff.data();
838 std::for_each(buffer.begin() + offset, buffer.begin() + offset + count,
839 [&dst,
this](uint8_t&
byte) { *(dst++) = char_type(byte); });
840 m_stream.rdbuf()->sputn(tempbuff.data(), count);
851 uint8_t* source = &buffer[offset];
855 if (byte_pos_shift != 0)
857 for (; count > 0 && byte_pos_shift != 0; ++source, --count, ++byte_pos_shift %=
m_elem_size)
864 if (byte_pos_shift != 0)
866 m_stream.rdbuf()->pubseekoff(-1, std::ios_base::cur, std::ios_base::out);
876 std::vector<char_type> tempbuff(elem_count, 0);
877 char_type* destination = tempbuff.data();
883 m_stream.rdbuf()->sputn(tempbuff.data(), elem_count);
895 for (; count > 0; ++source, --count, ++byte_pos_shift %=
m_elem_size)
901 m_stream.rdbuf()->pubseekoff(-1, std::ios_base::cur, std::ios_base::out);
912 throw NotSupportedException(ASPOSE_CURRENT_FUNCTION);
921 throw NotSupportedException(u
"Can't write to stream.");
932 return m_stream.rdbuf()->pubseekpos(value, std::ios_base::out);
939 auto elem_ppos =
m_stream.rdbuf()->pubseekoff(0, std::ios_base::cur, std::ios_base::out);
944 m_stream.setstate(std::ios_base::failbit);
947 throw IOException(u
"The stream has been modified outside the wrapper.");
954 auto elem_ppos =
m_stream.rdbuf()->pubseekoff(0, std::ios_base::cur, std::ios_base::out);
985template <typename T, typename = std::enable_if_t<IsTemplateBaseOf<std::basic_iostream, T>::value>>
1042 return Read(
static_cast<System::Details::ArrayView<uint8_t>
>(buffer), offset, count);
1053 Write(
static_cast<System::Details::ArrayView<uint8_t>
>(buffer), offset, count);
1061 virtual int32_t
Read(
const System::Details::ArrayView<uint8_t>& buffer, int32_t offset, int32_t count)
override
1070 virtual void Write(
const System::Details::ArrayView<uint8_t>& buffer, int32_t offset, int32_t count)
override
1094 m_stream.rdbuf()->pubseekpos(value, std::ios_base::in);
1095 return m_stream.rdbuf()->pubseekpos(value, std::ios_base::out);
1102 auto elem_gpos =
m_stream.rdbuf()->pubseekoff(0, std::ios_base::cur, std::ios_base::in);
1103 auto elem_ppos =
m_stream.rdbuf()->pubseekoff(0, std::ios_base::cur, std::ios_base::out);
1108 m_stream.setstate(std::ios_base::failbit);
1111 throw IOException(u
"The stream has been modified outside the wrapper.");
1118 auto elem_gpos =
m_stream.rdbuf()->pubseekoff(0, std::ios_base::cur, std::ios_base::in);
1119 auto elem_ppos =
m_stream.rdbuf()->pubseekoff(0, std::ios_base::cur, std::ios_base::out);
1125 if (elem_ppos != elem_gpos)
1139 if (elem_gpos != elem_ppos)
1169template <
typename char_type,
typename traits_type>
1173 return MakeObject<BasicSTDIStreamWrapper<std::basic_istream<char_type, traits_type>>>(stream, mode);
1180template <
typename char_type,
typename traits_type>
1184 return MakeObject<BasicSTDOStreamWrapper<std::basic_ostream<char_type, traits_type>>>(stream, mode);
1192template <
typename char_type,
typename traits_type>
1197 return MakeObject<BasicSTDIOStreamWrapper<std::basic_iostream<char_type, traits_type>>>(stream, mode);
static bool _IsLittleEndian()
Indicates the endianness of the current architecture.
static System::ArrayPtr< uint8_t > GetBytes(bool value)
Converts the specified boolean value into an array of bytes.
Represents a System.IO.Stream-like wrapper for std::basic_iostream and its derived objects....
Definition: std_stream_wrappers.h:987
virtual void Sync()
Syncronize read and write positions.
Definition: std_stream_wrappers.h:1116
virtual int64_t Pubseekpos(int64_t value)
Seeks positions of read or write or both on value.
Definition: std_stream_wrappers.h:1092
BasicSTDIOStreamWrapper & operator=(const BasicSTDIOStreamWrapper &)=delete
Copy assignment operator. Deleted.
virtual void Write(const System::Details::ArrayView< uint8_t > &buffer, int32_t offset, int32_t count) override
Writes the specified subrange of bytes from the specified byte array to the stream.
Definition: std_stream_wrappers.h:1070
virtual int32_t Read(const ArrayPtr< uint8_t > &buffer, int32_t offset, int32_t count) override
If wrapping mode is binary, reads the specified number of bytes from the stream, otherwise read the s...
Definition: std_stream_wrappers.h:1040
virtual void Flush() override
Clears this stream's buffers and writes all buffered data to the underlying storage.
Definition: std_stream_wrappers.h:1083
virtual int ReadByte() override
If wrapping mode is binary, reads a single byte from the last decoded character storage,...
Definition: std_stream_wrappers.h:1020
virtual void Write(const ArrayPtr< uint8_t > &buffer, int32_t offset, int32_t count) override
If wrapping mode is binary, writes to the stream the specified subrange of bytes from the specified b...
Definition: std_stream_wrappers.h:1051
BasicSTDIOStreamWrapper(const BasicSTDIOStreamWrapper &)=delete
Copy constructor. Deleted.
virtual void WriteByte(uint8_t value) override
If wrapping mode is binary, writes to the stream the specified unsigned 8-bit integer value,...
Definition: std_stream_wrappers.h:1028
BasicSTDIOStreamWrapper(std::basic_iostream< char_type, traits_type > &str, STDIOStreamWrappingMode mode=STDIOStreamWrappingMode::Binary, STDIOStreamPositionPreference pref_pos=STDIOStreamPositionPreference::Zero)
Constructs a new instance of the BasicSTDIOStreamWrapper.
Definition: std_stream_wrappers.h:1005
virtual int32_t Read(const System::Details::ArrayView< uint8_t > &buffer, int32_t offset, int32_t count) override
Reads the specified number of bytes from the stream and writes them to the specified byte array.
Definition: std_stream_wrappers.h:1061
virtual void SetLength(int64_t value) override
Sets the length of the stream represented by the current object.
Definition: std_stream_wrappers.h:1077
RTTI_INFO_TEMPLATE_CLASS(ThisType, ThisTypeBaseTypesInfo)
RTTI information.
virtual void Check() const
Check if the stream has been modified outside the wrapper.
Definition: std_stream_wrappers.h:1099
Represents a System.IO.Stream-like wrapper for std::basic_istream and its derived objects....
Definition: std_stream_wrappers.h:422
virtual void Flush() override
Clears this stream's buffers and writes all buffered data to the underlying storage....
Definition: std_stream_wrappers.h:633
virtual void SetLength(int64_t value) override
Sets the length of the stream represented by the current object. Not supported!
Definition: std_stream_wrappers.h:627
virtual void Check() const override
Check if the stream has been modified outside the wrapper.
Definition: std_stream_wrappers.h:648
virtual int32_t Read(const System::Details::ArrayView< uint8_t > &buffer, int32_t offset, int32_t count) override
Reads the specified number of bytes from the stream and writes them to the specified byte array.
Definition: std_stream_wrappers.h:537
virtual int32_t Read(const ArrayPtr< uint8_t > &buffer, int32_t offset, int32_t count) override
If wrapping mode is binary, reads the specified number of bytes from the stream, otherwise read the s...
Definition: std_stream_wrappers.h:516
virtual bool get_CanRead() const=0
Determines if the stream is readable.
virtual void WriteByte(uint8_t value) override
If wrapping mode is binary, writes to the stream the specified unsigned 8-bit integer value,...
Definition: std_stream_wrappers.h:504
BasicSTDIStreamWrapper & operator=(const BasicSTDIStreamWrapper &)=delete
Copy assignment operator. Deleted.
RTTI_INFO_TEMPLATE_CLASS(ThisType, ThisTypeBaseTypesInfo)
RTTI information.
virtual void Write(const System::Details::ArrayView< uint8_t > &buffer, int32_t offset, int32_t count) override
Writes the specified subrange of bytes from the specified byte array to the stream.
Definition: std_stream_wrappers.h:620
virtual void Write(const ArrayPtr< uint8_t > &buffer, int32_t offset, int32_t count) override
If wrapping mode is binary, writes to the stream the specified subrange of bytes from the specified b...
Definition: std_stream_wrappers.h:527
BasicSTDIStreamWrapper(const BasicSTDIStreamWrapper &)=delete
Copy constructor. Deleted.
virtual void Sync() override
Syncronize read position.
Definition: std_stream_wrappers.h:664
virtual int64_t Pubseekpos(int64_t value) override
Seeks positions of read or write or both on value.
Definition: std_stream_wrappers.h:642
BasicSTDIStreamWrapper(std::basic_istream< char_type, traits_type > &str, STDIOStreamWrappingMode mode=STDIOStreamWrappingMode::Binary)
Constructs a new instance of the BasicSTDIStreamWrapper.
Definition: std_stream_wrappers.h:437
virtual int ReadByte() override
If wrapping mode is binary, reads a single byte from the last decoded character storage,...
Definition: std_stream_wrappers.h:451
Represents a System.IO.Stream-like wrapper for std::basic_ostream and its derived objects....
Definition: std_stream_wrappers.h:693
virtual void Write(const ArrayPtr< uint8_t > &buffer, int32_t offset, int32_t count) override
If wrapping mode is binary, writes to the stream the specified subrange of bytes from the specified b...
Definition: std_stream_wrappers.h:785
RTTI_INFO_TEMPLATE_CLASS(ThisType, ThisTypeBaseTypesInfo)
RTTI information.
virtual int32_t Read(const ArrayPtr< uint8_t > &buffer, int32_t offset, int32_t count) override
If wrapping mode is binary, reads the specified number of bytes from the stream, otherwise read the s...
Definition: std_stream_wrappers.h:774
BasicSTDOStreamWrapper(const BasicSTDOStreamWrapper &)=delete
Copy constructor. Deleted.
virtual void Flush() override
Clears this stream's buffers and writes all buffered data to the underlying storage.
Definition: std_stream_wrappers.h:916
virtual int32_t Read(const System::Details::ArrayView< uint8_t > &buffer, int32_t offset, int32_t count) override
Reads the specified number of bytes from the stream and writes them to the specified byte array.
Definition: std_stream_wrappers.h:795
virtual void Check() const override
Check if the stream has been modified outside the wrapper.
Definition: std_stream_wrappers.h:936
virtual void WriteByte(uint8_t value) override
If wrapping mode is binary, writes to the stream the specified unsigned 8-bit integer value,...
Definition: std_stream_wrappers.h:730
virtual bool get_CanWrite() const=0
Determines if the stream is writable.
virtual void Sync() override
Syncronize write position.
Definition: std_stream_wrappers.h:952
typename BaseType::char_type char_type
Definition: std_stream_wrappers.h:702
virtual int64_t Pubseekpos(int64_t value) override
Seeks positions of read or write or both on value.
Definition: std_stream_wrappers.h:930
virtual int ReadByte() override
If wrapping mode is binary, reads a single byte from the last decoded character storage,...
Definition: std_stream_wrappers.h:722
virtual void Write(const System::Details::ArrayView< uint8_t > &buffer, int32_t offset, int32_t count) override
Writes the specified subrange of bytes from the specified byte array to the stream.
Definition: std_stream_wrappers.h:804
BasicSTDOStreamWrapper(std::basic_ostream< char_type, traits_type > &str, STDIOStreamWrappingMode mode=STDIOStreamWrappingMode::Binary)
Constructs a new instance of the BasicSTDOStreamWrapper.
Definition: std_stream_wrappers.h:708
virtual void SetLength(int64_t value) override
Sets the length of the stream represented by the current object.
Definition: std_stream_wrappers.h:910
BasicSTDOStreamWrapper & operator=(const BasicSTDOStreamWrapper &)=delete
Copy assignment operator. Deleted.
Represents a base class for System.IO.Stream-like wrappers. Objects of this class should only be allo...
Definition: std_stream_wrappers.h:44
virtual bool get_CanWrite() const override
Determines if the stream supports writing.
Definition: std_stream_wrappers.h:234
int64_t m_byte_pos
Read/write position in bytes.
Definition: std_stream_wrappers.h:407
typename T::off_type off_type
Definition: std_stream_wrappers.h:58
int64_t m_elem_pos
Read/write position.
Definition: std_stream_wrappers.h:405
STDIOStreamWrapperBase & operator=(const STDIOStreamWrapperBase &)=delete
Copy assignment operator. Deleted.
int64_t m_length
Stream's length.
Definition: std_stream_wrappers.h:409
STDIOStreamWrapperBase(const STDIOStreamWrapperBase &)=delete
Copy constructor. Deleted.
virtual void set_Position(int64_t value) override
Sets the stream's position.
Definition: std_stream_wrappers.h:145
virtual bool get_CanRead() const override
Determines if the stream supports reading.
Definition: std_stream_wrappers.h:222
void DecodeElem(int_type meta, ArrayPtr< uint8_t > &destination)
Decodes meta and store result in the destination.
Definition: std_stream_wrappers.h:343
char_type EncodeElem(uint8_t *source)
Encodes source.
Definition: std_stream_wrappers.h:365
const bool m_can_read
CanRead flag.
Definition: std_stream_wrappers.h:393
RTTI_INFO_TEMPLATE_CLASS(ThisType, ThisTypeBaseTypesInfo)
RTTI information.
ArrayPtr< uint8_t > m_decoded_elem
The last decoded element storage.
Definition: std_stream_wrappers.h:412
std::basic_ios< char_type, traits_type > & m_stream
Reference to the stream.
Definition: std_stream_wrappers.h:389
typename T::pos_type pos_type
Definition: std_stream_wrappers.h:57
virtual bool get_CanSeek() const override
Determines if the stream supports seeking.
Definition: std_stream_wrappers.h:228
virtual void Sync()=0
Synchronizes positions of read or write or both.
typename T::int_type int_type
Definition: std_stream_wrappers.h:56
virtual int64_t get_Position() const override
Returns current position of the stream.
Definition: std_stream_wrappers.h:186
void DecodeElem(int_type meta)
Decodes meta and store result in the last decoded element storage.
Definition: std_stream_wrappers.h:335
int64_t m_last_elem_ppos
Last write position.
Definition: std_stream_wrappers.h:403
const STDIOStreamWrappingMode m_wrapping_mode
Wrapping mode.
Definition: std_stream_wrappers.h:391
STDIOStreamWrapperBase(std::basic_ios< char_type, traits_type > &str, STDIOStreamWrappingMode mode=STDIOStreamWrappingMode::Binary, bool can_read=false, bool can_write=false, bool can_seek=false, STDIOStreamPositionPreference pref_pos=STDIOStreamPositionPreference::Zero)
Constructs a new instance of the STDIOStreamWrapperBase.
Definition: std_stream_wrappers.h:247
virtual int64_t Seek(int64_t offset, SeekOrigin origin) override
Sets the position of the stream represented by the current object.
Definition: std_stream_wrappers.h:70
const bool m_can_write
CanWrite flag.
Definition: std_stream_wrappers.h:395
const bool m_can_seek
CanSeek flag.
Definition: std_stream_wrappers.h:397
static constexpr uint8_t m_elem_size
char_type size = sizeof(char_type).
Definition: std_stream_wrappers.h:399
virtual int64_t get_Length() const override
Returns length of the stream.
Definition: std_stream_wrappers.h:204
BaseTypesInfo< BaseType > ThisTypeBaseTypesInfo
Definition: std_stream_wrappers.h:48
int64_t m_last_elem_gpos
Last read position.
Definition: std_stream_wrappers.h:401
typename T::char_type char_type
Definition: std_stream_wrappers.h:53
typename T::traits_type traits_type
Definition: std_stream_wrappers.h:54
virtual int64_t Pubseekpos(int64_t value)=0
Seeks positions of read or write or both on value.
char_type EncodeElem()
Encodes the last decoded element storage.
Definition: std_stream_wrappers.h:357
virtual void Check() const
Check if the stream has been modified outside the wrapper.
Definition: std_stream_wrappers.h:324
void EncodeElem(uint8_t *source, char_type *destination)
Encodes source to destination.
Definition: std_stream_wrappers.h:375
A base class for a variety of stream implementations. Objects of this class should only be allocated ...
Definition: stream.h:24
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
void reset(Pointee_ *ptr)
Sets pointed object.
Definition: smart_ptr.h:530
STDIOStreamPositionPreference
Determines which position in the stream is preferable as a common read and write position when std::b...
Definition: std_stream_wrappers.h:28
@ WritePosition
pptr position will sets as a read and write position.
@ ReadPosition
gptr position will sets as a read and write position.
@ Zero
Zero position will sets as a read and write position.
SharedPtr< Stream > WrapSTDIOStream(std::basic_istream< char_type, traits_type > &stream, STDIOStreamWrappingMode mode=STDIOStreamWrappingMode::Binary)
Wrapper function for std::basic_istream-like streams.
Definition: std_stream_wrappers.h:1170
STDIOStreamWrappingMode
Specifies the mode of I/O operations that wrappers will perform on std::iostreams-like streams.
Definition: std_stream_wrappers.h:16
@ Conversion
A mode that allows input operations to convert stream data from char_type type to uint8_t type and vi...
@ Binary
A mode that allows input operations to decode stream data of char_type type into bytes,...
SeekOrigin
Specifies the reference position in the stream relative to which the position to seek to is specified...
Definition: seekorigin.h:11
@ Begin
Beginning of the stream.
@ Current
Current stream position.
Definition: db_command.h:9