From 1e2f45da078e36487c3bb9bd0d63f67a29ef3f3d Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 12 Dec 2023 08:26:18 +0100 Subject: Documentation: Adapt struct ClassDocumentation for header documents Global functions and enumeration appear as WebXml documents with a
element instead of 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 --- sources/shiboken6/ApiExtractor/classdocumentation.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'sources/shiboken6/ApiExtractor/classdocumentation.h') 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 +#include + QT_FORWARD_DECLARE_CLASS(QDebug) /// An enumeration in a WebXML/doxygen document @@ -41,9 +43,14 @@ struct FunctionDocumentation : public FunctionDocumentationQuery using FunctionDocumentationList = QList; -/// A class/namespace in a WebXML/doxygen document +/// A WebXML/doxygen document struct ClassDocumentation { + enum Type { + Class, // , class/namespace + 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 enums; QList properties; FunctionDocumentationList functions; - - operator bool() const { return !name.isEmpty(); } }; /// Parse a WebXML class/namespace document -ClassDocumentation parseWebXml(const QString &fileName, QString *errorMessage); +std::optional parseWebXml(const QString &fileName, QString *errorMessage); /// Extract the module description from a WebXML module document QString webXmlModuleDescription(const QString &fileName, QString *errorMessage); -- cgit v1.2.3