class.hpp 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // SuperTux - Scripting reference generator
  2. // Copyright (C) 2023 Vankata453
  3. //
  4. // This program is free software: you can redistribute it and/or modify
  5. // it under the terms of the GNU General Public License as published by
  6. // the Free Software Foundation, either version 3 of the License, or
  7. // (at your option) any later version.
  8. //
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU General Public License
  15. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. #ifndef CLASS_HEADER
  17. #define CLASS_HEADER
  18. #include <map>
  19. #include <string>
  20. #include <vector>
  21. struct Constant
  22. {
  23. std::string type {};
  24. std::string name {};
  25. std::string initializer {};
  26. std::string description {};
  27. };
  28. struct Variable
  29. {
  30. std::string type {};
  31. std::string name {};
  32. std::string description {};
  33. };
  34. struct Parameter
  35. {
  36. std::string type {};
  37. std::string name {};
  38. std::string description {};
  39. std::string default_value {};
  40. };
  41. struct Function
  42. {
  43. std::string type {};
  44. std::string name {};
  45. std::string description {};
  46. std::vector<Parameter> parameters {};
  47. bool deprecated {};
  48. std::string deprecation_msg {};
  49. };
  50. struct Class
  51. {
  52. std::string name {};
  53. std::string summary {};
  54. std::string instances {};
  55. std::vector<Constant> constants {};
  56. std::vector<Variable> variables {};
  57. std::vector<Function> functions {};
  58. typedef std::map<int, std::string> BaseClasses;
  59. BaseClasses base_classes {};
  60. std::vector<std::string> derived_classes {};
  61. };
  62. #endif