Panda3D

Loading...
Searching...
No Matches
indent.h
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file indent.h
10 * @author drose
11 * @date 1999-01-16
12 */
13
14#ifndef INDENT_H
15#define INDENT_H
16
17#include "dtoolbase.h"
18
19/**
20 * A handy function for doing text formatting. This function simply outputs
21 * the indicated number of spaces to the given output stream, returning the
22 * stream itself. Useful for indenting a series of lines of text by a given
23 * amount.
24 */
25EXPCL_DTOOL_DTOOLBASE std::ostream &
26 indent(std::ostream &out, int indent_level);
27
28/**
29 * Writes a list of things to the indicated output stream, with a space
30 * separating each item. One or more lines will be written, and the lines
31 * will automatically be broken such that no line exceeds max_col columns if
32 * possible.
33 */
34 template<class InputIterator>
35 void
36 write_long_list(std::ostream &out, int indent_level,
37 InputIterator ifirst, InputIterator ilast,
38 std::string first_prefix = "",
39 std::string later_prefix = "",
40 int max_col = 72);
41
42#include "indent.I"
43
44#endif
dtoolbase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
indent.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
indent
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
Definition indent.cxx:20
write_long_list
void write_long_list(std::ostream &out, int indent_level, InputIterator ifirst, InputIterator ilast, std::string first_prefix="", std::string later_prefix="", int max_col=72)
Writes a list of things to the indicated output stream, with a space separating each item.
Definition indent.I:22