cppNameComponent.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // Filename: cppNameComponent.h
  2. // Created by: drose (12Nov99)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. #ifndef CPPNAMECOMPONENT_H
  6. #define CPPNAMECOMPONENT_H
  7. #include <dtoolbase.h>
  8. #include <string>
  9. using namespace std;
  10. class CPPTemplateParameterList;
  11. class CPPScope;
  12. class CPPNameComponent {
  13. public:
  14. CPPNameComponent(const string &name);
  15. bool operator == (const CPPNameComponent &other) const;
  16. bool operator != (const CPPNameComponent &other) const;
  17. bool operator < (const CPPNameComponent &other) const;
  18. string get_name() const;
  19. string get_name_with_templ(CPPScope *scope = (CPPScope *)NULL) const;
  20. CPPTemplateParameterList *get_templ() const;
  21. bool empty() const;
  22. bool has_templ() const;
  23. bool is_tbd() const;
  24. void set_name(const string &name);
  25. void append_name(const string &name);
  26. void set_templ(CPPTemplateParameterList *templ);
  27. void output(ostream &out) const;
  28. private:
  29. string _name;
  30. CPPTemplateParameterList *_templ;
  31. };
  32. inline ostream &operator << (ostream &out, const CPPNameComponent &name) {
  33. name.output(out);
  34. return out;
  35. }
  36. #endif