00001 // Filename: cppNameComponent.h 00002 // Created by: drose (12Nov99) 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 CPPNAMECOMPONENT_H 00020 #define CPPNAMECOMPONENT_H 00021 00022 #include <dtoolbase.h> 00023 00024 #include <string> 00025 00026 using namespace std; 00027 00028 class CPPTemplateParameterList; 00029 class CPPScope; 00030 00031 class CPPNameComponent { 00032 public: 00033 CPPNameComponent(const string &name); 00034 bool operator == (const CPPNameComponent &other) const; 00035 bool operator != (const CPPNameComponent &other) const; 00036 bool operator < (const CPPNameComponent &other) const; 00037 00038 string get_name() const; 00039 string get_name_with_templ(CPPScope *scope = (CPPScope *)NULL) const; 00040 CPPTemplateParameterList *get_templ() const; 00041 bool empty() const; 00042 bool has_templ() const; 00043 00044 bool is_tbd() const; 00045 00046 void set_name(const string &name); 00047 void append_name(const string &name); 00048 void set_templ(CPPTemplateParameterList *templ); 00049 00050 void output(ostream &out) const; 00051 00052 private: 00053 string _name; 00054 CPPTemplateParameterList *_templ; 00055 }; 00056 00057 inline ostream &operator << (ostream &out, const CPPNameComponent &name) { 00058 name.output(out); 00059 return out; 00060 } 00061 00062 #endif