12 #define _WINDOWS_LINE_END
13 #ifndef _WINDOWS_LINE_END
14 static const wchar_t NEW_LINE_CHAR = L
'\n';
16 static const wchar_t* NEW_LINE_CHAR = L
"\r\n";
26 size_t length_to_write;
27 static const size_t kDefaultBufferSize = 1 << 13;
33 virtual void AppendData(
const std::wstring& str);
50 virtual std::unique_ptr<COutStream>
clone()
const = 0;
52 virtual bool Write(
const std::wstring& str) = 0;
69 void print(
const char* format, ...);
70 void wprint(
const wchar_t* format, ...);
98 : slave(slave), master(master)
121 bool Write(
const std::wstring& str)
override
124 if (next) b = next->Write(str);
125 return b && stream.
Write(str);
128 std::unique_ptr<COutStream>
clone()
const override
131 return std::unique_ptr<COutStream>();
136 : stream(stream), next(std::move(next)) {}
154 bool Write(
const std::wstring& str)
override
157 if (next) b = next->Write(str);
158 return b && stream->Write(str);
166 : stream(stream.
clone()), next(std::move(next))
170 std::unique_ptr<COutStream>
clone()
const override
172 std::unique_ptr<COutStream> forwarder(
new Forwarder);
177 that_next->stream = this_next->stream->clone();
178 this_next = this->next->next.get();
179 that_next = that_next->next.get();
205 virtual bool Write(
const std::wstring& str)
212 virtual std::unique_ptr<COutStream>
clone()
const override
214 return std::unique_ptr<COutStream>(
new SinkStream());
222 std::list<std::wstring> output;
225 virtual bool Write(
const std::wstring& str)
227 if (str.size() != 0) output.push_back(str);
238 virtual std::unique_ptr<COutStream>
clone()
const override