Panda3D
indent.h
1 // Filename: indent.h
2 // Created by: drose (16Jan99)
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 INDENT_H
16 #define INDENT_H
17 
18 #include "dtoolbase.h"
19 
20 ////////////////////////////////////////////////////////////////////
21 // Function: indent
22 // Description: A handy function for doing text formatting. This
23 // function simply outputs the indicated number of
24 // spaces to the given output stream, returning the
25 // stream itself. Useful for indenting a series of
26 // lines of text by a given amount.
27 ////////////////////////////////////////////////////////////////////
28 EXPCL_DTOOL ostream &
29 indent(ostream &out, int indent_level);
30 
31 ////////////////////////////////////////////////////////////////////
32 // Function: write_long_list
33 // Description: Writes a list of things to the indicated output
34 // stream, with a space separating each item. One or
35 // more lines will be written, and the lines will
36 // automatically be broken such that no line exceeds
37 // max_col columns if possible.
38 ////////////////////////////////////////////////////////////////////
39 template<class InputIterator>
40 void
41 write_long_list(ostream &out, int indent_level,
42  InputIterator ifirst, InputIterator ilast,
43  string first_prefix = "",
44  string later_prefix = "",
45  int max_col = 72);
46 
47 #include "indent.I"
48 
49 #endif
50 
51