JSBFunction.cpp 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #include "JSBFunction.h"
  2. namespace ToolCore
  3. {
  4. void JSBFunction::Process()
  5. {
  6. if (skip_)
  7. {
  8. return;
  9. }
  10. // if not already marked as a getter
  11. if (!isGetter_)
  12. {
  13. if (!parameters_.Size() && returnType_)
  14. {
  15. if (name_.Length() > 3 && name_.StartsWith("Get") && isupper(name_[3]))
  16. {
  17. String pname = name_.Substring(3);
  18. class_->SetSkipFunction(pname);
  19. isGetter_ = true;
  20. propertyName_ = pname;
  21. }
  22. }
  23. }
  24. if (!isSetter_)
  25. {
  26. if (parameters_.Size() == 1 && !returnType_)
  27. {
  28. if (name_.Length() > 3 && name_.StartsWith("Set") && isupper(name_[3]))
  29. {
  30. String pname = name_.Substring(3);
  31. class_->SetSkipFunction(pname);
  32. isSetter_ = true;
  33. propertyName_ = pname;
  34. }
  35. }
  36. }
  37. if (isGetter_)
  38. class_->AddPropertyFunction(this);
  39. if (isSetter_)
  40. class_->AddPropertyFunction(this);
  41. }
  42. }