94 auto
pop() -> std::streampos;
98 auto
push(std::streampos pos = 0) ->
void;
264 virtual auto
seek(std::streamoff off, std::ios_base::seekdir dir = std::ios_base::cur) ->
void;
268 [[nodiscard]] auto
tell() -> std::streampos;
274 auto operator >>(
char& value) -> binary_reader& {value = read_char();
return *
this;}
275 auto operator >>(
double& value) -> binary_reader& {value = read_double();
return *
this;}
276 auto operator >>(int16& value) -> binary_reader& {value = read_int16();
return *
this;}
277 auto operator >>(int32& value) -> binary_reader& {value = read_int32();
return *
this;}
278 auto operator >>(int64& value) -> binary_reader& {value = read_int64();
return *
this;}
279 auto operator >>(sbyte& value) -> binary_reader& {value = read_sbyte();
return *
this;}
280 auto operator >>(
float& value) -> binary_reader& {value = read_single();
return *
this;}
281 auto operator >>(
string& value) -> binary_reader& {value = read_string();
return *
this;}
282 auto operator >>(uint16& value) -> binary_reader& {value = read_uint16();
return *
this;}
283 auto operator >>(uint32& value) -> binary_reader& {value = read_uint32();
return *
this;}
284 auto operator >>(uint64& value) -> binary_reader& {value = read_uint64();
return *
this;}
288 [[nodiscard]]
auto read_7bit_encoded_int() ->
int32;
289 std::istream* stream_ =
nullptr;
290 std::stack<std::streampos> pos_stack_;
291 bool delete_when_destroy_ =
false;
Contains xtd::array class.
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:64
Reads primitive data types as binary values in a specific encoding.
Definition binary_reader.hpp:43
binary_reader(const xtd::string &path)
Initializes a new instance of the xtd::io::binary_reader class for the specified file name.
auto pop() -> std::streampos
Pop the current top position.
virtual auto read_uint32() -> xtd::uint32
Reads a 4-byte unsigned integer from the current stream and advances the current position of the stre...
auto peek_char() const -> xtd::int32
Returns the next available character and does not advance the byte or character position.
virtual auto read() -> xtd::int32
Reads characters from the underlying stream and advances the current position of the stream in accord...
binary_reader(std::istream &stream)
Initializes a new instance of the xtd::io::binary_reader class for the specified stream.
virtual auto read_byte() -> xtd::byte
Reads the next byte from the current stream and advances the current position of the stream by one by...
virtual auto read_sbyte() -> xtd::sbyte
Reads the a signed byte from the current stream and advances the current position of the stream by on...
virtual auto read_chars(xtd::size count) -> xtd::array< char >
Reads the specified number of characters from the current stream into a byte array and advances the c...
virtual auto read_int16() -> xtd::int16
Reads a 2-byte signed integer from the current stream and advances the current position of the stream...
virtual auto read_char() -> char
Reads the next character from the current stream and advances the current position of the stream by o...
virtual auto read_single() -> float
Reads an 4-byte floating point value from the current stream and advances the current position of the...
auto rewind() -> void
Rewind stream.
virtual auto read_int64() -> xtd::int64
Reads a 8-byte signed integer from the current stream and advances the current position of the stream...
virtual auto read_string() -> xtd::string
Reads a string from the current stream. The string is prefixed with the length.
virtual auto read_uint64() -> xtd::uint64
Reads a 8-byte unsigned integer from the current stream and advances the current position of the stre...
auto base_stream() const -> std::optional< xtd::ref< std::istream > >
Returns the underlying stream.
auto close() -> void
Closes the xtd::io::binary_reader object and the underlying stream, and releases any system resources...
virtual auto read_int32() -> xtd::int32
Reads a 4-byte signed integer from the current stream and advances the current position of the stream...
auto tell() -> std::streampos
Tell the current seek position of the readers stream;.
virtual auto read_uint16() -> xtd::uint16
Reads a 2-byte unsigned integer from the current stream and advances the current position of the stre...
virtual auto read_double() -> double
Reads an 8-byte floating point value from the current stream and advances the current position of the...
auto end_of_stream() const -> bool
Gets a value that indicates whether the current stream position is at the end of the stream.
virtual auto seek(std::streamoff off, std::ios_base::seekdir dir=std::ios_base::cur) -> void
Change the position of the readers stream.
virtual auto read_boolean() -> bool
Reads a boolean value from the current stream and advances the current position of the stream by one ...
auto push(std::streampos pos=0) -> void
Push the current position.
virtual auto read_size() -> xtd::size
Reads a xtd::size from the current stream and advances the current position of the stream by eight by...
virtual auto read_bytes(xtd::size count) -> xtd::array< xtd::byte >
Reads the specified number of bytes from the current stream into a byte array and advances the curren...
Performs operations on std::basic_string instances that contain file or directory path information....
Definition path.hpp:37
Provides a generic view of a sequence of bytes. This is an abstract class.
Definition stream.hpp:40
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:45
#define core_export_
Define shared library export.
Definition core_export.hpp:13
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
std::int64_t int64
Represents a 64-bit signed integer.
Definition int64.hpp:23
std::uint32_t uint32
Represents a 32-bit unsigned integer.
Definition uint32.hpp:23
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
std::int8_t sbyte
Represents a 8-bit signed integer.
Definition sbyte.hpp:23
std::uint16_t uint16
Represents a 16-bit unsigned integer.
Definition uint16.hpp:23
std::int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
xtd::reference_wrapper_object< type_t > ref
The xtd::ref object is a reference wrapper.
Definition ref.hpp:25
std::int16_t int16
Represents a 16-bit signed integer.
Definition int16.hpp:23
std::optional< type_t > optional
Represents the optional alias on std::optional.
Definition optional.hpp:26
std::uint64_t uint64
Represents a 64-bit unsigned integer.
Definition uint64.hpp:23
std::uint8_t byte
Represents a 8-bit unsigned integer.
Definition byte.hpp:23
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::object class.
Contains xtd::optional type.
Contains xtd::string alias.