00001 // Filename: wordWrapStream.h 00002 // Created by: drose (28Jun00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef WORDWRAPSTREAM_H 00016 #define WORDWRAPSTREAM_H 00017 00018 #include "pandatoolbase.h" 00019 00020 #include "wordWrapStreamBuf.h" 00021 00022 //////////////////////////////////////////////////////////////////// 00023 // Class : WordWrapStream 00024 // Description : A special ostream that formats all of its output 00025 // through ProgramBase::show_text(). This allows the 00026 // program to easily word-wrap its output messages to 00027 // fit the terminal width. 00028 // 00029 // By convention (inherited from show_text), a newline 00030 // written to the WordWrapStream indicates a paragraph 00031 // break, and is generally printed as a blank line. To 00032 // force a line break without a paragraph break, use 00033 // '\r'. 00034 //////////////////////////////////////////////////////////////////// 00035 class WordWrapStream : public ostream { 00036 public: 00037 WordWrapStream(ProgramBase *program); 00038 00039 private: 00040 WordWrapStreamBuf _lsb; 00041 }; 00042 00043 #endif