OSDN Git Service

fix for FreeBSD 11.1.
[hmh/hhml.git] / lib / motoroutput-iconv.cc
1 #include "motoroutput-iconv.h"
2 #include "ustring.h"
3 #include <iostream>
4
5 MotorOutput*  MotorOutputIConv::out_toText (const ustring& str) {
6     ustring  o;
7
8     o = cd.cv (str);
9     out (o.data (), o.length ());
10     return this;
11 }
12
13 MotorOutput*  MotorOutputIConv::out_templateText (const ustring& str) {
14     return out_toText (str);
15 }
16
17 MotorOutput*  MotorOutputIConv::flush () {
18     ustring  o;
19
20     o = cd.cv (uEmpty, true);   // flush
21     out (o.data (), o.length ());
22     return this;
23 }
24
25 MotorOutput*  MotorOutputIConvOStream::out (const ustring::value_type* s, size_t len) {
26     std::cout.write (s, len);
27     return this;
28 }
29
30 MotorOutput*  MotorOutputIConvString::out (const ustring::value_type* s, size_t len) {
31     ans.append (ustring (s, len));
32     return this;
33 }
34