indent.cxx 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Filename: indent.cxx
  2. // Created by: drose (16Jan99)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
  8. //
  9. // All use of this software is subject to the terms of the Panda 3d
  10. // Software license. You should have received a copy of this license
  11. // along with this source code; you will also find a current copy of
  12. // the license at http://www.panda3d.org/license.txt .
  13. //
  14. // To contact the maintainers of this program write to
  15. // [email protected] .
  16. //
  17. ////////////////////////////////////////////////////////////////////
  18. #include "indent.h"
  19. ////////////////////////////////////////////////////////////////////
  20. // Function: indent
  21. // Description: A handy function for doing text formatting. This
  22. // function simply outputs the indicated number of
  23. // spaces to the given output stream, returning the
  24. // stream itself. Useful for indenting a series of
  25. // lines of text by a given amount.
  26. ////////////////////////////////////////////////////////////////////
  27. ostream &
  28. indent(ostream &out, int indent_level) {
  29. for (int i = 0; i < indent_level; i++) {
  30. out << ' ';
  31. }
  32. return out;
  33. }