cppNameComponent.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // Filename: cppNameComponent.h
  2. // Created by: drose (12Nov99)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) Carnegie Mellon University. All rights reserved.
  8. //
  9. // All use of this software is subject to the terms of the revised BSD
  10. // license. You should have received a copy of this license along
  11. // with this source code in a file named "LICENSE."
  12. //
  13. ////////////////////////////////////////////////////////////////////
  14. #ifndef CPPNAMECOMPONENT_H
  15. #define CPPNAMECOMPONENT_H
  16. #include "dtoolbase.h"
  17. #include <string>
  18. using namespace std;
  19. class CPPTemplateParameterList;
  20. class CPPScope;
  21. class CPPNameComponent {
  22. public:
  23. CPPNameComponent(const string &name);
  24. bool operator == (const CPPNameComponent &other) const;
  25. bool operator != (const CPPNameComponent &other) const;
  26. bool operator < (const CPPNameComponent &other) const;
  27. string get_name() const;
  28. string get_name_with_templ(CPPScope *scope = (CPPScope *)NULL) const;
  29. CPPTemplateParameterList *get_templ() const;
  30. bool empty() const;
  31. bool has_templ() const;
  32. bool is_tbd() const;
  33. void set_name(const string &name);
  34. void append_name(const string &name);
  35. void set_templ(CPPTemplateParameterList *templ);
  36. void output(ostream &out) const;
  37. private:
  38. string _name;
  39. CPPTemplateParameterList *_templ;
  40. };
  41. inline ostream &operator << (ostream &out, const CPPNameComponent &name) {
  42. name.output(out);
  43. return out;
  44. }
  45. #endif