Panda3D
eggComment.h
1 // Filename: eggComment.h
2 // Created by: drose (20Jan99)
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 EGGCOMMENT_H
16 #define EGGCOMMENT_H
17 
18 #include "pandabase.h"
19 
20 #include "eggNode.h"
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : EggComment
24 // Description : A comment that appears in an egg file within a
25 // <Comment> entry.
26 ////////////////////////////////////////////////////////////////////
27 class EXPCL_PANDAEGG EggComment : public EggNode {
28 PUBLISHED:
29  INLINE EggComment(const string &node_name, const string &comment);
30  INLINE EggComment(const EggComment &copy);
31 
32  // You can use the string operators to directly set and manipulate
33  // the comment.
34 
35  INLINE EggComment &operator = (const string &comment);
36  INLINE EggComment &operator = (const EggComment &copy);
37 
38  INLINE operator const string & () const;
39 
40  // Or, you can set and get it explicitly.
41 
42  INLINE void set_comment(const string &comment);
43  INLINE string get_comment() const;
44 
45  virtual void write(ostream &out, int indent_level) const;
46 
47 private:
48  string _comment;
49 
50 
51 public:
52 
53  static TypeHandle get_class_type() {
54  return _type_handle;
55  }
56  static void init_type() {
57  EggNode::init_type();
58  register_type(_type_handle, "EggComment",
59  EggNode::get_class_type());
60  }
61  virtual TypeHandle get_type() const {
62  return get_class_type();
63  }
64  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
65 
66 private:
67  static TypeHandle _type_handle;
68 };
69 
70 #include "eggComment.I"
71 
72 #endif
A comment that appears in an egg file within a <Comment> entry.
Definition: eggComment.h:27
A base class for things that may be directly added into the egg hierarchy.
Definition: eggNode.h:38
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85