Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/egg/eggComment.h

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

Generated on Fri May 2 00:37:30 2003 for Panda by doxygen1.3