28 _literal_mode =
false;
35 ~WordWrapStreamBuf() {
43 int WordWrapStreamBuf::
45 std::streamsize n = pptr() - pbase();
46 write_chars(pbase(), n);
58 int WordWrapStreamBuf::
60 std::streamsize n = pptr() - pbase();
62 if (n != 0 && sync() != 0) {
80 void WordWrapStreamBuf::
81 write_chars(
const char *start,
int length) {
84 std::string new_data(start, length);
85 size_t newline = new_data.find_first_of(
"\n\r");
87 while (newline != std::string::npos) {
89 _data += new_data.substr(p, newline - p + 1);
92 newline = new_data.find_first_of(
"\n\r", p);
96 _data += new_data.substr(p);
104 void WordWrapStreamBuf::
106 if (!_data.empty()) {