cppNameComponent.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // Filename: cppNameComponent.h
  2. // Created by: drose (12Nov99)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
  8. //
  9. // All use of this software is subject to the terms of the Panda 3d
  10. // Software license. You should have received a copy of this license
  11. // along with this source code; you will also find a current copy of
  12. // the license at http://www.panda3d.org/license.txt .
  13. //
  14. // To contact the maintainers of this program write to
  15. // [email protected] .
  16. //
  17. ////////////////////////////////////////////////////////////////////
  18. #ifndef CPPNAMECOMPONENT_H
  19. #define CPPNAMECOMPONENT_H
  20. #include <dtoolbase.h>
  21. #include <string>
  22. using namespace std;
  23. class CPPTemplateParameterList;
  24. class CPPScope;
  25. class CPPNameComponent {
  26. public:
  27. CPPNameComponent(const string &name);
  28. bool operator == (const CPPNameComponent &other) const;
  29. bool operator != (const CPPNameComponent &other) const;
  30. bool operator < (const CPPNameComponent &other) const;
  31. string get_name() const;
  32. string get_name_with_templ(CPPScope *scope = (CPPScope *)NULL) const;
  33. CPPTemplateParameterList *get_templ() const;
  34. bool empty() const;
  35. bool has_templ() const;
  36. bool is_tbd() const;
  37. void set_name(const string &name);
  38. void append_name(const string &name);
  39. void set_templ(CPPTemplateParameterList *templ);
  40. void output(ostream &out) const;
  41. private:
  42. string _name;
  43. CPPTemplateParameterList *_templ;
  44. };
  45. inline ostream &operator << (ostream &out, const CPPNameComponent &name) {
  46. name.output(out);
  47. return out;
  48. }
  49. #endif