Panda3D
|
00001 // Filename: indent.h 00002 // Created by: drose (16Jan99) 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 INDENT_H 00016 #define INDENT_H 00017 00018 #include "dtoolbase.h" 00019 00020 //////////////////////////////////////////////////////////////////// 00021 // Function: indent 00022 // Description: A handy function for doing text formatting. This 00023 // function simply outputs the indicated number of 00024 // spaces to the given output stream, returning the 00025 // stream itself. Useful for indenting a series of 00026 // lines of text by a given amount. 00027 //////////////////////////////////////////////////////////////////// 00028 EXPCL_DTOOL ostream & 00029 indent(ostream &out, int indent_level); 00030 00031 //////////////////////////////////////////////////////////////////// 00032 // Function: write_long_list 00033 // Description: Writes a list of things to the indicated output 00034 // stream, with a space separating each item. One or 00035 // more lines will be written, and the lines will 00036 // automatically be broken such that no line exceeds 00037 // max_col columns if possible. 00038 //////////////////////////////////////////////////////////////////// 00039 template<class InputIterator> 00040 void 00041 write_long_list(ostream &out, int indent_level, 00042 InputIterator ifirst, InputIterator ilast, 00043 string first_prefix = "", 00044 string later_prefix = "", 00045 int max_col = 72); 00046 00047 #include "indent.I" 00048 00049 #endif 00050 00051