diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-12-12 08:26:18 +0100 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-12-19 12:29:45 +0100 |
| commit | 1e2f45da078e36487c3bb9bd0d63f67a29ef3f3d (patch) | |
| tree | bfdda4ce8c392f6c68f38ef7fdb147ac65be1053 /sources/shiboken6/ApiExtractor/classdocumentation.h | |
| parent | ad5eb64daaaa1b927bcbf9e568738f417fef845f (diff) | |
Documentation: Adapt struct ClassDocumentation for header documents
Global functions and enumeration appear as WebXml documents with a
<header> element instead of class <class>. Extend the
ClassDocumentation and its parse to represent that. Change the parsing
to return an optional and remove the operator bool.
Task-number: PYSIDE-1106
Change-Id: I2e0413904dd8a5859aa9ed2aea9522aa5f24e939
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/classdocumentation.h')
| -rw-r--r-- | sources/shiboken6/ApiExtractor/classdocumentation.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sources/shiboken6/ApiExtractor/classdocumentation.h b/sources/shiboken6/ApiExtractor/classdocumentation.h index ef66912f8..d47101389 100644 --- a/sources/shiboken6/ApiExtractor/classdocumentation.h +++ b/sources/shiboken6/ApiExtractor/classdocumentation.h @@ -6,6 +6,8 @@ #include <QtCore/QStringList> +#include <optional> + QT_FORWARD_DECLARE_CLASS(QDebug) /// An enumeration in a WebXML/doxygen document @@ -41,9 +43,14 @@ struct FunctionDocumentation : public FunctionDocumentationQuery using FunctionDocumentationList = QList<FunctionDocumentation>; -/// A class/namespace in a WebXML/doxygen document +/// A WebXML/doxygen document struct ClassDocumentation { + enum Type { + Class, // <class>, class/namespace + Header // <header>, grouped global functions/enums + }; + qsizetype indexOfEnum(const QString &name) const; FunctionDocumentationList findFunctionCandidates(const QString &name, bool constant) const; @@ -51,18 +58,17 @@ struct ClassDocumentation const FunctionDocumentationQuery &q); qsizetype indexOfProperty(const QString &name) const; + Type type = Type::Class; QString name; QString description; QList<EnumDocumentation> enums; QList<PropertyDocumentation> properties; FunctionDocumentationList functions; - - operator bool() const { return !name.isEmpty(); } }; /// Parse a WebXML class/namespace document -ClassDocumentation parseWebXml(const QString &fileName, QString *errorMessage); +std::optional<ClassDocumentation> parseWebXml(const QString &fileName, QString *errorMessage); /// Extract the module description from a WebXML module document QString webXmlModuleDescription(const QString &fileName, QString *errorMessage); |
