xtd 0.2.0
string_writer.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "text_writer.hpp"
6#include <sstream>
7
9namespace xtd {
11 namespace io {
28 public:
30
33 string_writer() = default;
36 explicit string_writer(const xtd::string& str);
38
40
44 const std::ostream& base_stream() const noexcept;
47 std::ostream& base_stream() noexcept;
49
51
55 void flush() override;
56
57 xtd::string to_string() const noexcept override;
58
62 void write(const xtd::string& value) override;
64
65 private:
66 std::stringstream stream_;
67 };
68 }
69}
const std::ostream & base_stream() const noexcept
Returns the underlying stream.
void write(const xtd::string &value) override
Writes the specified string value to the text stream.
xtd::string to_string() const noexcept override
Returns a xtd::string that represents the current object.
string_writer(const xtd::string &str)
Initializes a new instance of the stream_writer class for the specified string.
string_writer()=default
Initializes a new instance of the stream_writer class .
void flush() override
Clears all buffers for the current writer and causes any buffered data to be written to the underlyin...
Represents a writer that can write a sequential series of characters.
Definition text_writer.hpp:36
#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
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::io::text_writer class.