00001 // Filename: eggNamedObject.cxx 00002 // Created by: drose (16Jan99) 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 #include "eggNamedObject.h" 00020 #include "eggMiscFuncs.h" 00021 00022 #include <indent.h> 00023 00024 TypeHandle EggNamedObject::_type_handle; 00025 00026 //////////////////////////////////////////////////////////////////// 00027 // Function: EggNamedObject::write_header 00028 // Access: Public 00029 // Description: Writes the first line of the egg object, 00030 // e.g. "<Group> group_name {" or some such. It 00031 // automatically enquotes the name if it contains any 00032 // special characters. egg_keyword is the keyword that 00033 // begins the line, e.g. "<Group>". 00034 //////////////////////////////////////////////////////////////////// 00035 void EggNamedObject:: 00036 write_header(ostream &out, int indent_level, const char *egg_keyword) const { 00037 indent(out, indent_level) << egg_keyword << " "; 00038 00039 if (has_name()) { 00040 enquote_string(out, get_name()) << " {\n"; 00041 } else { 00042 out << "{\n"; 00043 } 00044 }