00001 // Filename: cppUsing.cxx 00002 // Created by: drose (16Nov99) 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 00020 #include "cppUsing.h" 00021 #include "cppIdentifier.h" 00022 00023 //////////////////////////////////////////////////////////////////// 00024 // Function: CPPUsing::Constructor 00025 // Access: Public 00026 // Description: 00027 //////////////////////////////////////////////////////////////////// 00028 CPPUsing:: 00029 CPPUsing(CPPIdentifier *ident, bool full_namespace, const CPPFile &file) : 00030 CPPDeclaration(file), 00031 _ident(ident), _full_namespace(full_namespace) 00032 { 00033 } 00034 00035 //////////////////////////////////////////////////////////////////// 00036 // Function: CPPUsing::output 00037 // Access: Public, Virtual 00038 // Description: 00039 //////////////////////////////////////////////////////////////////// 00040 void CPPUsing:: 00041 output(ostream &out, int, CPPScope *, bool) const { 00042 out << "using "; 00043 if (_full_namespace) { 00044 out << "namespace "; 00045 } 00046 out << *_ident; 00047 } 00048 00049 //////////////////////////////////////////////////////////////////// 00050 // Function: CPPUsing::get_subtype 00051 // Access: Public, Virtual 00052 // Description: 00053 //////////////////////////////////////////////////////////////////// 00054 CPPDeclaration::SubType CPPUsing:: 00055 get_subtype() const { 00056 return ST_using; 00057 } 00058 00059 //////////////////////////////////////////////////////////////////// 00060 // Function: CPPUsing::as_using 00061 // Access: Public, Virtual 00062 // Description: 00063 //////////////////////////////////////////////////////////////////// 00064 CPPUsing *CPPUsing:: 00065 as_using() { 00066 return this; 00067 }