diff options
Diffstat (limited to 'core/doc_data.h')
-rw-r--r-- | core/doc_data.h | 155 |
1 files changed, 145 insertions, 10 deletions
diff --git a/core/doc_data.h b/core/doc_data.h index b8c92a4b67..04bd55eaba 100644 --- a/core/doc_data.h +++ b/core/doc_data.h @@ -114,9 +114,12 @@ public: String qualifiers; String description; bool is_deprecated = false; + String deprecated_message; bool is_experimental = false; + String experimental_message; Vector<ArgumentDoc> arguments; Vector<int> errors_returned; + String keywords; bool operator<(const MethodDoc &p_method) const { if (name == p_method.name) { // Must be an operator or a constructor since there is no other overloading @@ -171,6 +174,7 @@ public: doc.description = p_dict["description"]; } +#ifndef DISABLE_DEPRECATED if (p_dict.has("is_deprecated")) { doc.is_deprecated = p_dict["is_deprecated"]; } @@ -178,6 +182,17 @@ public: if (p_dict.has("is_experimental")) { doc.is_experimental = p_dict["is_experimental"]; } +#endif + + if (p_dict.has("deprecated")) { + doc.is_deprecated = true; + doc.deprecated_message = p_dict["deprecated"]; + } + + if (p_dict.has("experimental")) { + doc.is_experimental = true; + doc.experimental_message = p_dict["experimental"]; + } Array arguments; if (p_dict.has("arguments")) { @@ -195,6 +210,10 @@ public: doc.errors_returned.push_back(errors_returned[i]); } + if (p_dict.has("keywords")) { + doc.keywords = p_dict["keywords"]; + } + return doc; } static Dictionary to_dict(const MethodDoc &p_doc) { @@ -221,9 +240,17 @@ public: dict["description"] = p_doc.description; } - dict["is_deprecated"] = p_doc.is_deprecated; + if (p_doc.is_deprecated) { + dict["deprecated"] = p_doc.deprecated_message; + } - dict["is_experimental"] = p_doc.is_experimental; + if (p_doc.is_experimental) { + dict["experimental"] = p_doc.experimental_message; + } + + if (!p_doc.keywords.is_empty()) { + dict["keywords"] = p_doc.keywords; + } if (!p_doc.arguments.is_empty()) { Array arguments; @@ -253,7 +280,10 @@ public: bool is_bitfield = false; String description; bool is_deprecated = false; + String deprecated_message; bool is_experimental = false; + String experimental_message; + String keywords; bool operator<(const ConstantDoc &p_const) const { return name < p_const.name; } @@ -283,6 +313,7 @@ public: doc.description = p_dict["description"]; } +#ifndef DISABLE_DEPRECATED if (p_dict.has("is_deprecated")) { doc.is_deprecated = p_dict["is_deprecated"]; } @@ -290,6 +321,21 @@ public: if (p_dict.has("is_experimental")) { doc.is_experimental = p_dict["is_experimental"]; } +#endif + + if (p_dict.has("deprecated")) { + doc.is_deprecated = true; + doc.deprecated_message = p_dict["deprecated"]; + } + + if (p_dict.has("experimental")) { + doc.is_experimental = true; + doc.experimental_message = p_dict["experimental"]; + } + + if (p_dict.has("keywords")) { + doc.keywords = p_dict["keywords"]; + } return doc; } @@ -315,9 +361,17 @@ public: dict["description"] = p_doc.description; } - dict["is_deprecated"] = p_doc.is_deprecated; + if (p_doc.is_deprecated) { + dict["deprecated"] = p_doc.deprecated_message; + } + + if (p_doc.is_experimental) { + dict["experimental"] = p_doc.experimental_message; + } - dict["is_experimental"] = p_doc.is_experimental; + if (!p_doc.keywords.is_empty()) { + dict["keywords"] = p_doc.keywords; + } return dict; } @@ -334,7 +388,10 @@ public: bool overridden = false; String overrides; bool is_deprecated = false; + String deprecated_message; bool is_experimental = false; + String experimental_message; + String keywords; bool operator<(const PropertyDoc &p_prop) const { return name.naturalcasecmp_to(p_prop.name) < 0; } @@ -380,6 +437,7 @@ public: doc.overrides = p_dict["overrides"]; } +#ifndef DISABLE_DEPRECATED if (p_dict.has("is_deprecated")) { doc.is_deprecated = p_dict["is_deprecated"]; } @@ -387,6 +445,21 @@ public: if (p_dict.has("is_experimental")) { doc.is_experimental = p_dict["is_experimental"]; } +#endif + + if (p_dict.has("deprecated")) { + doc.is_deprecated = true; + doc.deprecated_message = p_dict["deprecated"]; + } + + if (p_dict.has("experimental")) { + doc.is_experimental = true; + doc.experimental_message = p_dict["experimental"]; + } + + if (p_dict.has("keywords")) { + doc.keywords = p_dict["keywords"]; + } return doc; } @@ -428,9 +501,17 @@ public: dict["overrides"] = p_doc.overrides; } - dict["is_deprecated"] = p_doc.is_deprecated; + if (p_doc.is_deprecated) { + dict["deprecated"] = p_doc.deprecated_message; + } - dict["is_experimental"] = p_doc.is_experimental; + if (p_doc.is_experimental) { + dict["experimental"] = p_doc.experimental_message; + } + + if (!p_doc.keywords.is_empty()) { + dict["keywords"] = p_doc.keywords; + } return dict; } @@ -442,6 +523,7 @@ public: String data_type; String description; String default_value; + String keywords; bool operator<(const ThemeItemDoc &p_theme_item) const { // First sort by the data type, then by name. if (data_type == p_theme_item.data_type) { @@ -472,6 +554,10 @@ public: doc.default_value = p_dict["default_value"]; } + if (p_dict.has("keywords")) { + doc.keywords = p_dict["keywords"]; + } + return doc; } static Dictionary to_dict(const ThemeItemDoc &p_doc) { @@ -497,6 +583,10 @@ public: dict["default_value"] = p_doc.default_value; } + if (!p_doc.keywords.is_empty()) { + dict["keywords"] = p_doc.keywords; + } + return dict; } }; @@ -535,7 +625,9 @@ public: struct EnumDoc { String description; bool is_deprecated = false; + String deprecated_message; bool is_experimental = false; + String experimental_message; static EnumDoc from_dict(const Dictionary &p_dict) { EnumDoc doc; @@ -543,6 +635,7 @@ public: doc.description = p_dict["description"]; } +#ifndef DISABLE_DEPRECATED if (p_dict.has("is_deprecated")) { doc.is_deprecated = p_dict["is_deprecated"]; } @@ -550,6 +643,17 @@ public: if (p_dict.has("is_experimental")) { doc.is_experimental = p_dict["is_experimental"]; } +#endif + + if (p_dict.has("deprecated")) { + doc.is_deprecated = true; + doc.deprecated_message = p_dict["deprecated"]; + } + + if (p_dict.has("experimental")) { + doc.is_experimental = true; + doc.experimental_message = p_dict["experimental"]; + } return doc; } @@ -560,9 +664,13 @@ public: dict["description"] = p_doc.description; } - dict["is_deprecated"] = p_doc.is_deprecated; + if (p_doc.is_deprecated) { + dict["deprecated"] = p_doc.deprecated_message; + } - dict["is_experimental"] = p_doc.is_experimental; + if (p_doc.is_experimental) { + dict["experimental"] = p_doc.experimental_message; + } return dict; } @@ -573,6 +681,7 @@ public: String inherits; String brief_description; String description; + String keywords; Vector<TutorialDoc> tutorials; Vector<MethodDoc> constructors; Vector<MethodDoc> methods; @@ -584,7 +693,9 @@ public: Vector<MethodDoc> annotations; Vector<ThemeItemDoc> theme_properties; bool is_deprecated = false; + String deprecated_message; bool is_experimental = false; + String experimental_message; bool is_script_doc = false; String script_path; bool operator<(const ClassDoc &p_class) const { @@ -609,6 +720,10 @@ public: doc.description = p_dict["description"]; } + if (p_dict.has("keywords")) { + doc.keywords = p_dict["keywords"]; + } + Array tutorials; if (p_dict.has("tutorials")) { tutorials = p_dict["tutorials"]; @@ -689,6 +804,7 @@ public: doc.theme_properties.push_back(ThemeItemDoc::from_dict(theme_properties[i])); } +#ifndef DISABLE_DEPRECATED if (p_dict.has("is_deprecated")) { doc.is_deprecated = p_dict["is_deprecated"]; } @@ -696,6 +812,17 @@ public: if (p_dict.has("is_experimental")) { doc.is_experimental = p_dict["is_experimental"]; } +#endif + + if (p_dict.has("deprecated")) { + doc.is_deprecated = true; + doc.deprecated_message = p_dict["deprecated"]; + } + + if (p_dict.has("experimental")) { + doc.is_experimental = true; + doc.experimental_message = p_dict["experimental"]; + } if (p_dict.has("is_script_doc")) { doc.is_script_doc = p_dict["is_script_doc"]; @@ -806,9 +933,13 @@ public: dict["theme_properties"] = theme_properties; } - dict["is_deprecated"] = p_doc.is_deprecated; + if (p_doc.is_deprecated) { + dict["deprecated"] = p_doc.deprecated_message; + } - dict["is_experimental"] = p_doc.is_experimental; + if (p_doc.is_experimental) { + dict["experimental"] = p_doc.experimental_message; + } dict["is_script_doc"] = p_doc.is_script_doc; @@ -816,6 +947,10 @@ public: dict["script_path"] = p_doc.script_path; } + if (!p_doc.keywords.is_empty()) { + dict["keywords"] = p_doc.keywords; + } + return dict; } }; |