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 {
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.h:79
Implements a xtd::io::text_writer for writing characters to a string.
Definition string_writer.h: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.h:36
#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.