xtd 0.2.0
Loading...
Searching...
No Matches
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}
Represents text as a sequence of character units.
Definition basic_string.hpp:79
Implements a xtd::io::text_writer for writing characters to a string.
Definition string_writer.hpp:27
const std::ostream & base_stream() const noexcept
Returns the underlying stream.
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 .
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
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
Contains xtd::io::text_writer class.