Panda3D
 All Classes Functions Variables Enumerations
eggComment.h
00001 // Filename: eggComment.h
00002 // Created by:  drose (20Jan99)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef EGGCOMMENT_H
00016 #define EGGCOMMENT_H
00017 
00018 #include "pandabase.h"
00019 
00020 #include "eggNode.h"
00021 
00022 ////////////////////////////////////////////////////////////////////
00023 //       Class : EggComment
00024 // Description : A comment that appears in an egg file within a
00025 //               <Comment> entry.
00026 ////////////////////////////////////////////////////////////////////
00027 class EXPCL_PANDAEGG EggComment : public EggNode {
00028 PUBLISHED:
00029   INLINE EggComment(const string &node_name, const string &comment);
00030   INLINE EggComment(const EggComment &copy);
00031 
00032   // You can use the string operators to directly set and manipulate
00033   // the comment.
00034 
00035   INLINE EggComment &operator = (const string &comment);
00036   INLINE EggComment &operator = (const EggComment &copy);
00037 
00038   INLINE operator const string & () const;
00039 
00040   // Or, you can set and get it explicitly.
00041 
00042   INLINE void set_comment(const string &comment);
00043   INLINE string get_comment() const;
00044 
00045   virtual void write(ostream &out, int indent_level) const;
00046 
00047 private:
00048   string _comment;
00049 
00050 
00051 public:
00052 
00053   static TypeHandle get_class_type() {
00054     return _type_handle;
00055   }
00056   static void init_type() {
00057     EggNode::init_type();
00058     register_type(_type_handle, "EggComment",
00059                   EggNode::get_class_type());
00060   }
00061   virtual TypeHandle get_type() const {
00062     return get_class_type();
00063   }
00064   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00065 
00066 private:
00067   static TypeHandle _type_handle;
00068 };
00069 
00070 #include "eggComment.I"
00071 
00072 #endif
 All Classes Functions Variables Enumerations