xtd 0.2.0
string_writer.h
Go to the documentation of this file.
1 #pragma once
5 #include "text_writer.h"
6 #include <sstream>
7 
9 namespace xtd {
11  namespace io {
25  class core_export_ string_writer : public xtd::io::text_writer {
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 }
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
std::string to_string(const date_time &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition: date_time.h:1063
Represents a writer that can write a sequential series of characters.
Definition: text_writer.h:34
Implements a xtd::io::text_writer for writing characters to a string.
Definition: string_writer.h:25
Contains xtd::io::text_writer class.
Write access to the file. Data can be written to the file. Combine with Read for read/write access...