PageRenderTime 106ms CodeModel.GetById 36ms RepoModel.GetById 8ms app.codeStats 0ms

/Language/Members/Destructor.cpp

http://github.com/gavofyork/Martta
C++ | 57 lines | 29 code | 9 blank | 19 comment | 1 complexity | 2824f0bb5b29f6dd48595ed29ffe82a4 MD5 | raw file
Possible License(s): GPL-3.0, LGPL-2.0
  1. /* ***** BEGIN LICENSE BLOCK *****
  2. * Version: Martta License version 1.0
  3. *
  4. * The contents of this file are subject to the Martta License version 1.0
  5. * (the "License"); you may not use this file except in compliance with the
  6. * License. You should have received a copy of the Martta License
  7. * "COPYING.Martta" along with Martta; if not you may obtain a copy of the
  8. * License at http://quidprocode.co.uk/Martta/
  9. *
  10. * Software distributed under the License is distributed on an "AS IS"
  11. * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
  12. * License for the specific language governing rights and limitations under
  13. * the License.
  14. *
  15. * The Initial Developer of the code in this file is Gavin Wood.
  16. * Portions created by the Initial Developer are Copyright (C) 2008
  17. * quid pro code, Ltd. All Rights Reserved.
  18. *
  19. * ***** END LICENSE BLOCK ***** */
  20. #include "TypeDefinition.h"
  21. #include "Compound.h"
  22. #include "Destructor.h"
  23. namespace Martta
  24. {
  25. MARTTA_PROPER_CPP(Destructor);
  26. bool Destructor::keyPressedOnPosition(Position const& _p, KeyEvent const* _e)
  27. {
  28. return simplePositionKeyPressHandler<Destructor>(_p, _e, "~");
  29. }
  30. Kinds Destructor::allowedKinds(int _i) const
  31. {
  32. if (_i >= 0)
  33. return Kinds();
  34. return Super::allowedKinds(_i);
  35. }
  36. String Destructor::nick() const
  37. {
  38. return "~" + typeDefinition()->nick();
  39. }
  40. String Destructor::codeName() const
  41. {
  42. return "~" + typeDefinition()->codeName();
  43. }
  44. String Destructor::basicCode(FunctionCodeScope _ref) const
  45. {
  46. return Martta::code(qualifiers() & FunctionMask) + callingCode(_ref);
  47. }
  48. }