|
@@ -78,6 +78,27 @@ public:
|
|
|
|
|
|
return doc;
|
|
|
}
|
|
|
+ static Dictionary to_dict(const ArgumentDoc &p_doc) {
|
|
|
+ Dictionary dict;
|
|
|
+
|
|
|
+ if (!p_doc.name.is_empty()) {
|
|
|
+ dict["name"] = p_doc.name;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.type.is_empty()) {
|
|
|
+ dict["type"] = p_doc.type;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.enumeration.is_empty()) {
|
|
|
+ dict["enumeration"] = p_doc.enumeration;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.default_value.is_empty()) {
|
|
|
+ dict["default_value"] = p_doc.default_value;
|
|
|
+ }
|
|
|
+
|
|
|
+ return dict;
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
struct MethodDoc {
|
|
@@ -167,6 +188,51 @@ public:
|
|
|
|
|
|
return doc;
|
|
|
}
|
|
|
+ static Dictionary to_dict(const MethodDoc &p_doc) {
|
|
|
+ Dictionary dict;
|
|
|
+
|
|
|
+ if (!p_doc.name.is_empty()) {
|
|
|
+ dict["name"] = p_doc.name;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.return_type.is_empty()) {
|
|
|
+ dict["return_type"] = p_doc.return_type;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.return_enum.is_empty()) {
|
|
|
+ dict["return_enum"] = p_doc.return_enum;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.qualifiers.is_empty()) {
|
|
|
+ dict["qualifiers"] = p_doc.qualifiers;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.description.is_empty()) {
|
|
|
+ dict["description"] = p_doc.description;
|
|
|
+ }
|
|
|
+
|
|
|
+ dict["is_deprecated"] = p_doc.is_deprecated;
|
|
|
+
|
|
|
+ dict["is_experimental"] = p_doc.is_experimental;
|
|
|
+
|
|
|
+ if (!p_doc.arguments.is_empty()) {
|
|
|
+ Array arguments;
|
|
|
+ for (int i = 0; i < p_doc.arguments.size(); i++) {
|
|
|
+ arguments.push_back(ArgumentDoc::to_dict(p_doc.arguments[i]));
|
|
|
+ }
|
|
|
+ dict["arguments"] = arguments;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.errors_returned.is_empty()) {
|
|
|
+ Array errors_returned;
|
|
|
+ for (int i = 0; i < p_doc.errors_returned.size(); i++) {
|
|
|
+ errors_returned.push_back(p_doc.errors_returned[i]);
|
|
|
+ }
|
|
|
+ dict["errors_returned"] = errors_returned;
|
|
|
+ }
|
|
|
+
|
|
|
+ return dict;
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
struct ConstantDoc {
|
|
@@ -218,6 +284,35 @@ public:
|
|
|
|
|
|
return doc;
|
|
|
}
|
|
|
+ static Dictionary to_dict(const ConstantDoc &p_doc) {
|
|
|
+ Dictionary dict;
|
|
|
+
|
|
|
+ if (!p_doc.name.is_empty()) {
|
|
|
+ dict["name"] = p_doc.name;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.value.is_empty()) {
|
|
|
+ dict["value"] = p_doc.value;
|
|
|
+ }
|
|
|
+
|
|
|
+ dict["is_value_valid"] = p_doc.is_value_valid;
|
|
|
+
|
|
|
+ if (!p_doc.enumeration.is_empty()) {
|
|
|
+ dict["enumeration"] = p_doc.enumeration;
|
|
|
+ }
|
|
|
+
|
|
|
+ dict["is_bitfield"] = p_doc.is_bitfield;
|
|
|
+
|
|
|
+ if (!p_doc.description.is_empty()) {
|
|
|
+ dict["description"] = p_doc.description;
|
|
|
+ }
|
|
|
+
|
|
|
+ dict["is_deprecated"] = p_doc.is_deprecated;
|
|
|
+
|
|
|
+ dict["is_experimental"] = p_doc.is_experimental;
|
|
|
+
|
|
|
+ return dict;
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
struct EnumDoc {
|
|
@@ -250,6 +345,29 @@ public:
|
|
|
|
|
|
return doc;
|
|
|
}
|
|
|
+ static Dictionary to_dict(const EnumDoc &p_doc) {
|
|
|
+ Dictionary dict;
|
|
|
+
|
|
|
+ if (!p_doc.name.is_empty()) {
|
|
|
+ dict["name"] = p_doc.name;
|
|
|
+ }
|
|
|
+
|
|
|
+ dict["is_bitfield"] = p_doc.is_bitfield;
|
|
|
+
|
|
|
+ if (!p_doc.description.is_empty()) {
|
|
|
+ dict["description"] = p_doc.description;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.values.is_empty()) {
|
|
|
+ Array values;
|
|
|
+ for (int i = 0; i < p_doc.values.size(); i++) {
|
|
|
+ values.push_back(ConstantDoc::to_dict(p_doc.values[i]));
|
|
|
+ }
|
|
|
+ dict["values"] = values;
|
|
|
+ }
|
|
|
+
|
|
|
+ return dict;
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
struct PropertyDoc {
|
|
@@ -315,6 +433,49 @@ public:
|
|
|
|
|
|
return doc;
|
|
|
}
|
|
|
+ static Dictionary to_dict(const PropertyDoc &p_doc) {
|
|
|
+ Dictionary dict;
|
|
|
+
|
|
|
+ if (!p_doc.name.is_empty()) {
|
|
|
+ dict["name"] = p_doc.name;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.type.is_empty()) {
|
|
|
+ dict["type"] = p_doc.type;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.enumeration.is_empty()) {
|
|
|
+ dict["enumeration"] = p_doc.enumeration;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.description.is_empty()) {
|
|
|
+ dict["description"] = p_doc.description;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.setter.is_empty()) {
|
|
|
+ dict["setter"] = p_doc.setter;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.getter.is_empty()) {
|
|
|
+ dict["getter"] = p_doc.getter;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.default_value.is_empty()) {
|
|
|
+ dict["default_value"] = p_doc.default_value;
|
|
|
+ }
|
|
|
+
|
|
|
+ dict["overridden"] = p_doc.overridden;
|
|
|
+
|
|
|
+ if (!p_doc.overrides.is_empty()) {
|
|
|
+ dict["overrides"] = p_doc.overrides;
|
|
|
+ }
|
|
|
+
|
|
|
+ dict["is_deprecated"] = p_doc.is_deprecated;
|
|
|
+
|
|
|
+ dict["is_experimental"] = p_doc.is_experimental;
|
|
|
+
|
|
|
+ return dict;
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
struct ThemeItemDoc {
|
|
@@ -355,6 +516,31 @@ public:
|
|
|
|
|
|
return doc;
|
|
|
}
|
|
|
+ static Dictionary to_dict(const ThemeItemDoc &p_doc) {
|
|
|
+ Dictionary dict;
|
|
|
+
|
|
|
+ if (!p_doc.name.is_empty()) {
|
|
|
+ dict["name"] = p_doc.name;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.type.is_empty()) {
|
|
|
+ dict["type"] = p_doc.type;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.data_type.is_empty()) {
|
|
|
+ dict["data_type"] = p_doc.data_type;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.description.is_empty()) {
|
|
|
+ dict["description"] = p_doc.description;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.default_value.is_empty()) {
|
|
|
+ dict["default_value"] = p_doc.default_value;
|
|
|
+ }
|
|
|
+
|
|
|
+ return dict;
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
struct TutorialDoc {
|
|
@@ -373,6 +559,19 @@ public:
|
|
|
|
|
|
return doc;
|
|
|
}
|
|
|
+ static Dictionary to_dict(const TutorialDoc &p_doc) {
|
|
|
+ Dictionary dict;
|
|
|
+
|
|
|
+ if (!p_doc.link.is_empty()) {
|
|
|
+ dict["link"] = p_doc.link;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.title.is_empty()) {
|
|
|
+ dict["title"] = p_doc.title;
|
|
|
+ }
|
|
|
+
|
|
|
+ return dict;
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
struct ClassDoc {
|
|
@@ -514,6 +713,117 @@ public:
|
|
|
|
|
|
return doc;
|
|
|
}
|
|
|
+ static Dictionary to_dict(const ClassDoc &p_doc) {
|
|
|
+ Dictionary dict;
|
|
|
+
|
|
|
+ if (!p_doc.name.is_empty()) {
|
|
|
+ dict["name"] = p_doc.name;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.inherits.is_empty()) {
|
|
|
+ dict["inherits"] = p_doc.inherits;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.brief_description.is_empty()) {
|
|
|
+ dict["brief_description"] = p_doc.brief_description;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.description.is_empty()) {
|
|
|
+ dict["description"] = p_doc.description;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.tutorials.is_empty()) {
|
|
|
+ Array tutorials;
|
|
|
+ for (int i = 0; i < p_doc.tutorials.size(); i++) {
|
|
|
+ tutorials.push_back(TutorialDoc::to_dict(p_doc.tutorials[i]));
|
|
|
+ }
|
|
|
+ dict["tutorials"] = tutorials;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.constructors.is_empty()) {
|
|
|
+ Array constructors;
|
|
|
+ for (int i = 0; i < p_doc.constructors.size(); i++) {
|
|
|
+ constructors.push_back(MethodDoc::to_dict(p_doc.constructors[i]));
|
|
|
+ }
|
|
|
+ dict["constructors"] = constructors;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.methods.is_empty()) {
|
|
|
+ Array methods;
|
|
|
+ for (int i = 0; i < p_doc.methods.size(); i++) {
|
|
|
+ methods.push_back(MethodDoc::to_dict(p_doc.methods[i]));
|
|
|
+ }
|
|
|
+ dict["methods"] = methods;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.operators.is_empty()) {
|
|
|
+ Array operators;
|
|
|
+ for (int i = 0; i < p_doc.operators.size(); i++) {
|
|
|
+ operators.push_back(MethodDoc::to_dict(p_doc.operators[i]));
|
|
|
+ }
|
|
|
+ dict["operators"] = operators;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.signals.is_empty()) {
|
|
|
+ Array signals;
|
|
|
+ for (int i = 0; i < p_doc.signals.size(); i++) {
|
|
|
+ signals.push_back(MethodDoc::to_dict(p_doc.signals[i]));
|
|
|
+ }
|
|
|
+ dict["signals"] = signals;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.constants.is_empty()) {
|
|
|
+ Array constants;
|
|
|
+ for (int i = 0; i < p_doc.constants.size(); i++) {
|
|
|
+ constants.push_back(ConstantDoc::to_dict(p_doc.constants[i]));
|
|
|
+ }
|
|
|
+ dict["constants"] = constants;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.enums.is_empty()) {
|
|
|
+ Dictionary enums;
|
|
|
+ for (const KeyValue<String, String> &E : p_doc.enums) {
|
|
|
+ enums[E.key] = E.value;
|
|
|
+ }
|
|
|
+ dict["enums"] = enums;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.properties.is_empty()) {
|
|
|
+ Array properties;
|
|
|
+ for (int i = 0; i < p_doc.properties.size(); i++) {
|
|
|
+ properties.push_back(PropertyDoc::to_dict(p_doc.properties[i]));
|
|
|
+ }
|
|
|
+ dict["properties"] = properties;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.annotations.is_empty()) {
|
|
|
+ Array annotations;
|
|
|
+ for (int i = 0; i < p_doc.annotations.size(); i++) {
|
|
|
+ annotations.push_back(MethodDoc::to_dict(p_doc.annotations[i]));
|
|
|
+ }
|
|
|
+ dict["annotations"] = annotations;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!p_doc.theme_properties.is_empty()) {
|
|
|
+ Array theme_properties;
|
|
|
+ for (int i = 0; i < p_doc.theme_properties.size(); i++) {
|
|
|
+ theme_properties.push_back(ThemeItemDoc::to_dict(p_doc.theme_properties[i]));
|
|
|
+ }
|
|
|
+ dict["theme_properties"] = theme_properties;
|
|
|
+ }
|
|
|
+
|
|
|
+ dict["is_deprecated"] = p_doc.is_deprecated;
|
|
|
+
|
|
|
+ dict["is_experimental"] = p_doc.is_experimental;
|
|
|
+
|
|
|
+ dict["is_script_doc"] = p_doc.is_script_doc;
|
|
|
+
|
|
|
+ if (!p_doc.script_path.is_empty()) {
|
|
|
+ dict["script_path"] = p_doc.script_path;
|
|
|
+ }
|
|
|
+
|
|
|
+ return dict;
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
static String get_default_value_string(const Variant &p_value);
|