JSBFunction.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //
  2. // Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved
  3. // LICENSE: Atomic Game Engine Editor and Tools EULA
  4. // Please see LICENSE_ATOMIC_EDITOR_AND_TOOLS.md in repository root for
  5. // license information: https://github.com/AtomicGameEngine/AtomicGameEngine
  6. //
  7. #include "JSBFunction.h"
  8. namespace ToolCore
  9. {
  10. void JSBFunction::Process()
  11. {
  12. if (skip_)
  13. {
  14. return;
  15. }
  16. // if not already marked as a getter
  17. if (!isGetter_)
  18. {
  19. if (!parameters_.Size() && returnType_)
  20. {
  21. if (name_.Length() > 3 && name_.StartsWith("Get") && isupper(name_[3]))
  22. {
  23. String pname = name_.Substring(3);
  24. class_->SetSkipFunction(pname);
  25. isGetter_ = true;
  26. propertyName_ = pname;
  27. }
  28. }
  29. }
  30. if (!isSetter_)
  31. {
  32. if (parameters_.Size() == 1 && !returnType_)
  33. {
  34. if (name_.Length() > 3 && name_.StartsWith("Set") && isupper(name_[3]))
  35. {
  36. String pname = name_.Substring(3);
  37. class_->SetSkipFunction(pname);
  38. isSetter_ = true;
  39. propertyName_ = pname;
  40. }
  41. }
  42. }
  43. if (isGetter_)
  44. class_->AddPropertyFunction(this);
  45. if (isSetter_)
  46. class_->AddPropertyFunction(this);
  47. }
  48. }