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()) {
static ios_fmtflags get_literal_flag()
Returns a flag that may be set on the Notify stream via setf() that, when set, enables "literal" mode...
This is intended to be the base class for most general-purpose utility programs in the PANDATOOL tree...
void show_text(const std::string &text)
Formats the indicated text to stderr with the known _terminal_width.
A special ostream that formats all of its output through ProgramBase::show_text().
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.