aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/ApiExtractor/docparser.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move the shiboken-generator source aroundFriedemann Kleint2025-11-241-228/+0
| | | | | | | | | THIS COMMIT WAS GENERATED BY A SCRIPT Task-number: PYSIDE-962 Task-number: PYSIDE-1587 Change-Id: I58b05c3d05606efb6303193f2d7f907a0ab5741b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Remove unused includesFriedemann Kleint2025-06-131-4/+0
| | | | | | Pick-to: 6.9 Change-Id: I0472704d333ca656ba9ff3d84dac43b7e7de5e2a Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Port to Qt include styleFriedemann Kleint2025-03-271-4/+4
| | | | | | | | | Replace the Qt forwarding headers by the .h files. This brings down the dependency list by approx 6%. Pick-to: 6.9 Change-Id: Iaa57400fd20600b940119a6016041b885a68d207 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix warnings about using deprecated libxml2 APIFriedemann Kleint2024-02-231-7/+1
| | | | | | | | Remove the call to xmlSubstituteEntitiesDefault(int) and use the new xmlRead*() functions with the replacment option. Change-Id: Id71aac645bb5c92c2d5fb9d77934ed74a5cc8479 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Extract global (non-added) function/enum documentationFriedemann Kleint2023-12-191-0/+8
| | | | | | | | | | Try to determine the name of the .webxml file in which the documentation is via include/doc file hint and write that to the globals page. Task-number: PYSIDE-1106 Change-Id: I8042d9122fa9037a602aadc2266d85d1f79f4fde Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* DocGenerator: Further preparations for generating global functions/enumsFriedemann Kleint2023-12-121-32/+81
| | | | | | | | | | | | | | | | QtDocGenerator::writeInjectDocumentation() previously had class and function as parameters and was used for class documentation (function == 0) as well as function documentation. Split it into separate functions for both cases such that class can be 0 in the function case for global functions. Remove the indentation, which appeared to be misguided. Add separate functions for querying the XPATH modifications. Task-number: PYSIDE-1106 Task-number: PYSIDE-2543 Change-Id: I78a25f100b810abb542d82be56c4473816bb8c82 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Port from QSharedPointer to std::shared_ptrFriedemann Kleint2023-01-051-1/+1
| | | | | | | Task-number: QTBUG-109570 Change-Id: Iabdafb0a5ab211e32c1bbf7face78fd5102a49b9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Use smart pointers for AbstractMetaClass instancesFriedemann Kleint2022-12-061-2/+2
| | | | | Change-Id: I101ca8ceea6ffa63ca8bd03e2e9adf7531cb8f80 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Use smart pointers for the TypeEntry classesFriedemann Kleint2022-11-171-1/+1
| | | | | | | | | | TypeEntry instances were previously stored and passed as raw pointers, which made it difficult to track ownership, particularly when synthesized classes were added. Change it to use QSharedPointer. Change-Id: I3612efbc5d467ebeac9aa5dda86c7439bbd03ddd Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* shiboken6: Fix coding style regarding pointers (Type* v -> Type *v)Friedemann Kleint2022-11-141-1/+1
| | | | | | | | | As a drive-by, introduce some auto and streamline the code. Pick-to: 6.4 Change-Id: If84a3721a50b2e00b473ba78cba184f1a35d326b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Documentation: Indicate enum typesFriedemann Kleint2022-11-081-0/+17
| | | | | | | | | Insert the base class into the WebXML doc string. Pick-to: 6.4 Task-number: PYSIDE-1735 Change-Id: I5b59df98f929c82112903bb316143b592c06e33e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6/Documentation: Document signalsFriedemann Kleint2022-10-241-0/+1
| | | | | | | | | | | | Signals were previously only listed in the reference section. Add the doc text for them. Pick-to: 6.4 Task-number: PYSIDE-1106 Change-Id: I2fd16fd85f02043026324fdd5b1cf726e9da018a Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Port some loop variables to qsizetypeFriedemann Kleint2022-10-131-1/+1
| | | | | | | | Where possible, used range-based for. Otherwise, use qsizetype for loop variables. Change-Id: I4773bee8468ce73722656ec73845369b7d40d4cd Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Clean up includesFriedemann Kleint2022-09-211-3/+3
| | | | | | | | | Remove unused includes from headers; add includes to sources where needed. Change-Id: I05efd95a9340eaf42cc5d606e2aef97acdaf83c7 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* shiboken6: Fix documentation injection for added functions with parameter namesFriedemann Kleint2022-09-061-0/+3
| | | | | | | | | | | Documentation modifications were matched by function signatures, which failed for added function signatures with parameter names (@). To fix this, store documentation modifications in AddedFunction similar to what is done for normal modifications. Task-number: PYSIDE-2025 Change-Id: I0b3a8c2a066c028da6feb394905510892e85e47d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Split the document modifications in ComplexTypeEntryFriedemann Kleint2022-09-051-1/+17
| | | | | | | | | | | | Split into function modifications (with signature) with a new accessor and let the old accessor return the class modifications only. Add a helper function DocParser::getDocModifications() to retrieve the modifications. Task-number: PYSIDE-2025 Change-Id: I1f8b3eb0cfa4b121910329cd76b0a67559d76fca Reviewed-by: Christian Tismer <tismer@stackless.com>
* Use SPDX license identifiersLucie Gérard2022-05-271-27/+2
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: I065150015bdb84a3096b5b39c061cf0a20ab637d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Remove deprecated QLatin1StringFriedemann Kleint2022-04-251-6/+10
| | | | | | | | | | Introduce a compatibility header to provide the 6.4 API to 6.3 to reduce merge conflicts. Task-number: QTBUG-98434 Pick-to: 6.3 6.2 Change-Id: Iab3f9f894019b4135afa96b930325966348210d0 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Migrate from QLatin1Char to UTF-16 char literalsFriedemann Kleint2022-04-251-2/+2
| | | | | | | | | Preparing for the deprecation of QLatin1Char in 6.4. Task-number: QTBUG-98434 Pick-to: 6.3 6.2 Change-Id: I8bc92aa9f4e6dbfcb12d2025c5a1e760ab4f0d7f Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix include conventionsFriedemann Kleint2022-04-221-1/+2
| | | | | | | | | Reorder includes such that local includes are first, followed by Qt and C/C++ system includes. Pick-to: 6.3 6.2 Change-Id: Ib801d34de7242befce4be429bfb099ccabe1f987 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6/Documentation: Replace XPath/Xquery usage for retrieving WebXML ↵Friedemann Kleint2021-12-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | docs by a parser shiboken used XPath expressions to extract the function descriptions from the qdoc-generated WebXML. With the deprecation of QtXmlPatterns in Qt 6, libxml/xslt was used for this. A major drawback is that libxml/xslt is unable to match entities in attributes which means functions taking parameters by const-ref could not be found. This required cumbersome workarounds involving repeated searches, which still were not sufficient to find all functions. To fix this, write a WebXML parser based on QXmlStreamReader that extracts the contents of a WebXML page into some simple data structures and use those for searching. On this occasion, also use the metafunction flags to correctly match binary operator functions. This reduces the number of functions for which no documentation can be found (from ~1100 to ~800 for the qtbase repository). From the remaining functions, ~230 are functions inherited from templates, which should at least be listed. Others are caused by qdoc not finding hidden friends. The remaining usages of libxml/xslt are the doxygen parser and the documentation modifications using XSLT. Task-number: PYSIDE-1106 Change-Id: I31c045ad42948afad884f40d5bbc8bee7555859e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Documentation: Skip functions using RValue referencesFriedemann Kleint2021-12-131-1/+8
| | | | | | Pick-to: 6.2 Change-Id: I7a4990e8d389d493ddd6155d12a1c2cc36b0e450 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Remove AbstractMetaAttributesFriedemann Kleint2021-02-191-1/+1
| | | | | | | | | | | | Remove AbstractMetaAttributes as a base class of AbstractMetaFunction and AbstractMetaClass. Split the Attributes enumerations into those applying to classes and functions, respectively and add them to AbstractMetaFunction and AbstractMetaClass. Change-Id: Ie60517876af4096fd6234479ee7dc7fbcca1eda6 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Make more functions static using clang tidyFriedemann Kleint2021-01-231-3/+3
| | | | | | | | | Apply the fix created by clang tidy' -wreadability-convert-member-functions-to-static warning with some manual correction. Change-Id: I394bd96881fa25dbcb7a725b79d10395fcbb8676 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Fold MetaFunction::isCastOperator() into isConversionOperator()Friedemann Kleint2020-12-101-1/+1
| | | | | | | | | | | | They are basically the same thing. The complicated regular expression in isConversionOperator() apparently dates back to the old C++ parser; with clang's canonical function names, a check for startsWith("operator ") is sufficient. Pick-to: 6.0 Change-Id: Ife948695619d36904d124e204bc91490704fd4bf Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Store AbstractMetaFunction using a QSharedPointerFriedemann Kleint2020-11-301-3/+3
| | | | | | | | | | | | | | | | | | Store the list functions (global / class member) as a QList<QSharedPointer<const AbstractMetaFunction> instead of a raw pointer list. This makes passing around function lists easier and solves the memory leaks caused by mixing cloned and unmodified functions while collecting the overload lists in the generators. - Change the function signatures accordingly - Add a qSharedPointerConstCast() for non-const access. - Restructure the traversing of added functions in the AbstractMetaBuilder - Remove some unused typedefs and functions unearthed by the change Change-Id: I08a6c5243750e3eb3813bc3f7172899ad2b13e22 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Introduce a private class hierarchy for TypeEntryFriedemann Kleint2020-11-101-0/+1
| | | | | | | | | | | | | | | | | Move the data members of the TypeEntry classes to private classes, using convenience macros modeled after Qt's Q_D macro. The main motivation here is header hygiene and decoupling; typesystem.h was including a lot of classes. This requires moving some code around: - Move the debug formatting helpers of the TypeEntry classes from typedatabase.cpp to typesystem.cpp. - Move struct TypeRejection to typedatabase.h - Reorder typesystem.cpp in order of declaration. Change-Id: I24fe501d98940afd44caf75057cd6131cfbd6b6e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Split the abstractmetalang headers and sourcesFriedemann Kleint2020-11-061-0/+3
| | | | | | | | Split out enums, fields and functions. Only AbstractMetaClass remains in abstractmetalang.h. Change-Id: I49846f92fafc5969d83aa4a1767eb4ac23f39d1c Reviewed-by: Christian Tismer <tismer@stackless.com>
* Rename shiboken2 to shiboken6Friedemann Kleint2020-10-281-0/+150
Adapt CMake files, build scripts, tests and examples. Task-number: PYSIDE-904 Change-Id: I4cb5ee4c8df539546014b08202a7b1e98ed3ff07 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>