Panda3D
wordWrapStream.h
1 // Filename: wordWrapStream.h
2 // Created by: drose (28Jun00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef WORDWRAPSTREAM_H
16 #define WORDWRAPSTREAM_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "wordWrapStreamBuf.h"
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : WordWrapStream
24 // Description : A special ostream that formats all of its output
25 // through ProgramBase::show_text(). This allows the
26 // program to easily word-wrap its output messages to
27 // fit the terminal width.
28 //
29 // By convention (inherited from show_text), a newline
30 // written to the WordWrapStream indicates a paragraph
31 // break, and is generally printed as a blank line. To
32 // force a line break without a paragraph break, use
33 // '\r'.
34 ////////////////////////////////////////////////////////////////////
35 class WordWrapStream : public ostream {
36 public:
37  WordWrapStream(ProgramBase *program);
38 
39 private:
40  WordWrapStreamBuf _lsb;
41 };
42 
43 #endif
This is intended to be the base class for most general-purpose utility programs in the PANDATOOL tree...
Definition: programBase.h:37
Used by WordWrapStream to implement an ostream that flushes its output to ProgramBase::show_text().
A special ostream that formats all of its output through ProgramBase::show_text().