xtd - Reference Guide 0.2.0
string_writer.h
Go to the documentation of this file.
1 #pragma once
5 
6 #include <sstream>
7 #include "text_writer.h"
8 
10 namespace xtd {
12  namespace io {
24  class core_export_ string_writer : public xtd::io::text_writer {
25  public:
27 
30  string_writer() = default;
33  explicit string_writer(const xtd::ustring& str);
35 
37 
41  const std::ostream& base_stream() const noexcept;
44  std::ostream& base_stream() noexcept;
46 
48 
52  void flush() override;
53 
54  xtd::ustring to_string() const noexcept override;
55 
59  void write(const xtd::ustring& value) override;
61 
62  private:
63  std::stringstream stream_;
64  };
65  }
66 }
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:50
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:1110
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:24
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...