5 #include "../optional.h" 7 #include "../ustring.h" 63 std::optional<std::reference_wrapper<std::ostream>> base_stream()
const;
82 virtual size_t seek(
size_t offset, std::ios::seekdir origin);
88 virtual void write(
bool value);
100 virtual void write(
char value);
106 template<
size_t size>
107 void write(
const std::array<xtd::byte, size>& buffer) {
108 for (
auto b : buffer)
116 template<
size_t size>
117 void write(
const std::array<char, size>& buffer) {
118 for (
auto c : buffer)
126 virtual void write(
const std::vector<xtd::byte>& buffer);
135 virtual void write(
const std::vector<xtd::byte>& buffer,
size_t index,
size_t count);
141 virtual void write(
const std::vector<char>& buffer);
150 virtual void write(
const std::vector<char>& buffer,
size_t index,
size_t count);
156 virtual void write(
double value);
186 virtual void write(
float value);
194 virtual void write(
const std::string& value);
195 #if defined(__cpp_lib_char8_t) 196 virtual void write(
const std::u8string& value);
198 virtual void write(
const std::u16string& value);
199 virtual void write(
const std::u32string& value);
200 virtual void write(
const std::wstring& value);
201 virtual void write(
const char* value);
202 #if defined(__cpp_lib_char8_t) 233 template<
size_t size>
234 binary_writer& operator <<(const std::array<xtd::byte, size>& value) {
write(value);
return *
this;}
235 template<
size_t size>
236 binary_writer& operator <<(const std::array<char, size>& value) {
write(value);
return *
this;}
237 binary_writer& operator <<(const std::vector<xtd::byte>& value) {
write(value);
return *
this;}
238 binary_writer& operator <<(const std::vector<char>& value) {
write(value);
return *
this;}
247 #if defined(__cpp_lib_char8_t) 254 #if defined(__cpp_lib_char8_t) 266 std::ostream* stream_ =
nullptr;
267 bool delete_when_destroy_ =
false;
int_least8_t sbyte
Represents a 8-bit signed integer.
Definition: types.h:173
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
uint_least16_t uint16
Represents a 16-bit unsigned integer.
Definition: types.h:228
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
void write(const std::array< xtd::byte, size > &buffer)
Writes a byte array to the underlying stream.
Definition: binary_writer.h:107
void write(const std::array< char, size > &buffer)
Writes a character array to the underlying stream.
Definition: binary_writer.h:117
Performs operations on std::basic_string instances that contain file or directory path information...
Definition: path.h:34
int_least16_t int16
Represents a 16-bit signed integer.
Definition: types.h:118
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes...
Definition: object.h:32
int_least32_t int32
Represents a 32-bit signed integer.
Definition: types.h:129
char32_t char32
Represents a 32-bit unicode character.
Definition: types.h:85
uint_least64_t uint64
Represents a 64-bit unsigned integer.
Definition: types.h:250
char8_t char8
Represents a 8-bit unicode character.
Definition: types.h:62
int_least64_t int64
Represents a 64-bit signed integer.
Definition: types.h:140
uint_least8_t byte
Represents a 8-bit unsigned integer.
Definition: types.h:39
uint_least32_t uint32
Represents a 32-bit unsigned integer.
Definition: types.h:239
char16_t char16
Represents a 16-bit unicode character.
Definition: types.h:74
Write access to the file. Data can be written to the file. Combine with Read for read/write access...
wchar_t wchar
Represents a wide character.
Definition: types.h:284
Writes primitive types in binary to a stream and supports writing strings.
Definition: binary_writer.h:37