xtd
1.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
xtd.core
include
xtd
io
string_writer.hpp
Go to the documentation of this file.
1
4
#pragma once
5
#include "
text_writer.hpp
"
6
#include <sstream>
7
9
namespace
xtd
{
11
namespace
io
{
27
class
core_export_
string_writer
:
public
xtd::io::text_writer
{
28
public
:
30
33
string_writer
() =
default
;
36
explicit
string_writer
(
const
xtd::string
& str);
38
40
44
[[nodiscard]]
auto
base_stream
() const noexcept -> const std::ostream&;
47
[[nodiscard]] auto
base_stream
() noexcept -> std::ostream&;
49
51
55
auto
flush
() ->
void
override;
56
57
[[nodiscard]] auto
to_string
() const noexcept ->
xtd
::
string
override;
58
62
auto
write
(const
xtd
::
string
& value) ->
void
override;
64
65
private:
66
std::stringstream stream_;
67
};
68
}
69
}
xtd::io::string_writer::flush
auto flush() -> void override
Clears all buffers for the current writer and causes any buffered data to be written to the underlyin...
xtd::io::string_writer::base_stream
auto base_stream() const noexcept -> const std::ostream &
Returns the underlying stream.
xtd::io::string_writer::string_writer
string_writer(const xtd::string &str)
Initializes a new instance of the stream_writer class for the specified string.
xtd::io::string_writer::string_writer
string_writer()=default
Initializes a new instance of the stream_writer class .
xtd::io::string_writer::write
auto write(const xtd::string &value) -> void override
Writes the specified string value to the text stream.
xtd::io::string_writer::to_string
auto to_string() const noexcept -> xtd::string override
Returns a xtd::string that represents the current object.
xtd::io::text_writer
Represents a writer that can write a sequential series of characters.
Definition
text_writer.hpp:36
core_export_
#define core_export_
Define shared library export.
Definition
core_export.hpp:13
xtd::string
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition
__string_definitions.hpp:43
xtd::io
The xtd::io namespace contains types that allow reading and writing to files and data streams,...
Definition
binary_reader.hpp:17
xtd
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition
abstract_object.hpp:8
text_writer.hpp
Contains xtd::io::text_writer class.
Generated on
for xtd by
Gammasoft
. All rights reserved.