Panda3D

eggComment.cxx
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 eggComment.cxx
10 * @author drose
11 * @date 1999-01-20
12 */
13
14 #include "eggComment.h"
15 #include "eggMiscFuncs.h"
16
17 #include "indent.h"
18 #include "string_utils.h"
19
20 TypeHandle EggComment::_type_handle;
21
22
23 /**
24 * Writes the comment definition to the indicated output stream in Egg format.
25 */
26 void EggComment::
27 write(std::ostream &out, int indent_level) const {
28 write_header(out, indent_level, "<Comment>");
29 enquote_string(out, get_comment(), indent_level + 2) << "\n";
30 indent(out, indent_level) << "}\n";
31 }
EggComment::write
virtual void write(std::ostream &out, int indent_level) const
Writes the comment definition to the indicated output stream in Egg format.
Definition: eggComment.cxx:27
EggNamedObject::write_header
void write_header(std::ostream &out, int indent_level, const char *egg_keyword) const
Writes the first line of the egg object, e.g.
Definition: eggNamedObject.cxx:39
TypeHandle
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
eggComment.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
enquote_string
ostream & enquote_string(ostream &out, const string &str, int indent_level, bool always_quote)
Writes the string to the indicated output stream.
Definition: eggMiscFuncs.cxx:30
eggMiscFuncs.h
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
indent.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
string_utils.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.