xtd 0.2.0
Loading...
Searching...
No Matches
string_writer.h
Go to the documentation of this file.
1
4#pragma once
5#include "text_writer.h"
6#include <sstream>
7
9namespace xtd {
11 namespace io {
26 public:
28
31 string_writer() = default;
34 explicit string_writer(const xtd::ustring& str);
36
38
42 const std::ostream& base_stream() const noexcept;
45 std::ostream& base_stream() noexcept;
47
49
53 void flush() override;
54
55 xtd::ustring to_string() const noexcept override;
56
60 void write(const xtd::ustring& value) override;
62
63 private:
64 std::stringstream stream_;
65 };
66 }
67}
Implements a xtd::io::text_writer for writing characters to a string.
Definition string_writer.h:25
const std::ostream & base_stream() const noexcept
Returns the underlying stream.
string_writer(const xtd::ustring &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.h:34
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:47
#define core_export_
Define shared library export.
Definition core_export.h:13
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Contains xtd::io::text_writer class.