cppUsing.cxx 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // Filename: cppUsing.cxx
  2. // Created by: drose (16Nov99)
  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. #include "cppUsing.h"
  19. #include "cppIdentifier.h"
  20. ////////////////////////////////////////////////////////////////////
  21. // Function: CPPUsing::Constructor
  22. // Access: Public
  23. // Description:
  24. ////////////////////////////////////////////////////////////////////
  25. CPPUsing::
  26. CPPUsing(CPPIdentifier *ident, bool full_namespace, const CPPFile &file) :
  27. CPPDeclaration(file),
  28. _ident(ident), _full_namespace(full_namespace)
  29. {
  30. }
  31. ////////////////////////////////////////////////////////////////////
  32. // Function: CPPUsing::output
  33. // Access: Public, Virtual
  34. // Description:
  35. ////////////////////////////////////////////////////////////////////
  36. void CPPUsing::
  37. output(ostream &out, int, CPPScope *, bool) const {
  38. out << "using ";
  39. if (_full_namespace) {
  40. out << "namespace ";
  41. }
  42. out << *_ident;
  43. }
  44. ////////////////////////////////////////////////////////////////////
  45. // Function: CPPUsing::get_subtype
  46. // Access: Public, Virtual
  47. // Description:
  48. ////////////////////////////////////////////////////////////////////
  49. CPPDeclaration::SubType CPPUsing::
  50. get_subtype() const {
  51. return ST_using;
  52. }
  53. ////////////////////////////////////////////////////////////////////
  54. // Function: CPPUsing::as_using
  55. // Access: Public, Virtual
  56. // Description:
  57. ////////////////////////////////////////////////////////////////////
  58. CPPUsing *CPPUsing::
  59. as_using() {
  60. return this;
  61. }