Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
node.h
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#ifndef NODE_H
5#define NODE_H
6
7#include "access.h"
9#include "doc.h"
10#include "enumitem.h"
11#include "importrec.h"
12#include "parameters.h"
13#include "relatedclass.h"
15
16#include <QtCore/qdir.h>
17#include <QtCore/qlist.h>
18#include <QtCore/qmap.h>
19#include <QtCore/qstringlist.h>
20
21#include <optional>
22
23QT_BEGIN_NAMESPACE
24
25class Aggregate;
26class ClassNode;
27class CollectionNode;
28class EnumNode;
29class ExampleNode;
30class FunctionNode;
31class Node;
32class QDocDatabase;
33class QmlTypeNode;
34class PageNode;
35class PropertyNode;
36class QmlPropertyNode;
38class Tree;
39class TypedefNode;
40
41typedef QList<Node *> NodeList;
50
51class Node
52{
53public:
80
81 enum Genus : unsigned char {
82 DontCare = 0x0,
83 CPP = 0x1,
84 QML = 0x4,
85 DOC = 0x8,
86 API = CPP | QML
87 };
88
89 enum Status : unsigned char {
95 }; // don't reorder this enum
96
103
110 Q_DECLARE_FLAGS(SignatureOptions, SignatureOption)
111
113
115
116 virtual ~Node() = default;
117 virtual Node *clone(Aggregate *) { return nullptr; } // currently only FunctionNode
118 [[nodiscard]] virtual Tree *tree() const;
120
121 [[nodiscard]] NodeType nodeType() const { return m_nodeType; }
122 [[nodiscard]] QString nodeTypeString() const;
123
124 [[nodiscard]] Genus genus() const { return m_genus; }
125 void setGenus(Genus t) { m_genus = t; }
126 static Genus getGenus(NodeType t);
127
128 [[nodiscard]] bool isActive() const { return m_status == Active; }
129 [[nodiscard]] bool isClass() const { return m_nodeType == Class; }
130 [[nodiscard]] bool isCppNode() const { return genus() == CPP; }
131 [[nodiscard]] bool isDontDocument() const { return (m_status == DontDocument); }
132 [[nodiscard]] bool isEnumType() const { return m_nodeType == Enum; }
133 [[nodiscard]] bool isExample() const { return m_nodeType == Example; }
134 [[nodiscard]] bool isExternalPage() const { return m_nodeType == ExternalPage; }
135 [[nodiscard]] bool isFunction(Genus g = DontCare) const
136 {
137 return m_nodeType == Function && (genus() == g || g == DontCare);
138 }
139 [[nodiscard]] bool isGroup() const { return m_nodeType == Group; }
140 [[nodiscard]] bool isHeader() const { return m_nodeType == HeaderFile; }
141 [[nodiscard]] bool isIndexNode() const { return m_indexNodeFlag; }
142 [[nodiscard]] bool isModule() const { return m_nodeType == Module; }
143 [[nodiscard]] bool isNamespace() const { return m_nodeType == Namespace; }
144 [[nodiscard]] bool isPage() const { return m_nodeType == Page; }
145 [[nodiscard]] bool isPreliminary() const { return (m_status == Preliminary); }
146 [[nodiscard]] bool isPrivate() const { return m_access == Access::Private; }
147 [[nodiscard]] bool isProperty() const { return m_nodeType == Property; }
148 [[nodiscard]] bool isProxyNode() const { return m_nodeType == Proxy; }
149 [[nodiscard]] bool isPublic() const { return m_access == Access::Public; }
150 [[nodiscard]] bool isProtected() const { return m_access == Access::Protected; }
151 [[nodiscard]] bool isQmlBasicType() const { return m_nodeType == QmlValueType; }
152 [[nodiscard]] bool isQmlModule() const { return m_nodeType == QmlModule; }
153 [[nodiscard]] bool isQmlNode() const { return genus() == QML; }
154 [[nodiscard]] bool isQmlProperty() const { return m_nodeType == QmlProperty; }
155 [[nodiscard]] bool isQmlType() const { return m_nodeType == QmlType || m_nodeType == QmlValueType; }
156 [[nodiscard]] bool isRelatedNonmember() const { return m_relatedNonmember; }
157 [[nodiscard]] bool isStruct() const { return m_nodeType == Struct; }
158 [[nodiscard]] bool isSharedCommentNode() const { return m_nodeType == SharedComment; }
159 [[nodiscard]] bool isTypeAlias() const { return m_nodeType == TypeAlias; }
160 [[nodiscard]] bool isTypedef() const
161 {
162 return m_nodeType == Typedef || m_nodeType == TypeAlias;
163 }
164 [[nodiscard]] bool isUnion() const { return m_nodeType == Union; }
165 [[nodiscard]] bool isVariable() const { return m_nodeType == Variable; }
166 [[nodiscard]] bool isGenericCollection() const { return (m_nodeType == Node::Collection); }
167
168 [[nodiscard]] virtual bool isDeprecated() const { return (m_status == Deprecated); }
169 [[nodiscard]] virtual bool isAbstract() const { return false; }
170 [[nodiscard]] virtual bool isAggregate() const { return false; } // means "can have children"
171 [[nodiscard]] virtual bool isFirstClassAggregate() const
172 {
173 return false;
174 } // Aggregate but not proxy or prop group"
175 [[nodiscard]] virtual bool isAlias() const { return false; }
176 [[nodiscard]] virtual bool isAttached() const { return false; }
177 [[nodiscard]] virtual bool isClassNode() const { return false; }
178 [[nodiscard]] virtual bool isCollectionNode() const { return false; }
179 [[nodiscard]] virtual bool isDefault() const { return false; }
180 [[nodiscard]] virtual bool isInternal() const;
181 [[nodiscard]] virtual bool isMacro() const { return false; }
182 [[nodiscard]] virtual bool isPageNode() const { return false; } // means "generates a doc page"
183 [[nodiscard]] virtual bool isRelatableType() const { return false; }
184 [[nodiscard]] virtual bool isMarkedReimp() const { return false; }
185 [[nodiscard]] virtual bool isPropertyGroup() const { return false; }
186 [[nodiscard]] virtual bool isStatic() const { return false; }
187 [[nodiscard]] virtual bool isTextPageNode() const
188 {
189 return false;
190 } // means PageNode but not Aggregate
191 [[nodiscard]] virtual bool isWrapper() const;
192
193 [[nodiscard]] QString plainName() const;
194 QString plainFullName(const Node *relative = nullptr) const;
195 [[nodiscard]] QString plainSignature() const;
196 QString fullName(const Node *relative = nullptr) const;
197 [[nodiscard]] virtual QString signature(Node::SignatureOptions) const { return plainName(); }
198
199 [[nodiscard]] const QString &fileNameBase() const { return m_fileNameBase; }
200 [[nodiscard]] bool hasFileNameBase() const { return !m_fileNameBase.isEmpty(); }
201 void setFileNameBase(const QString &t) { m_fileNameBase = t; }
202
203 void setAccess(Access t) { m_access = t; }
204 void setLocation(const Location &t);
205 void setDoc(const Doc &doc, bool replace = false);
206 void setStatus(Status t);
207 void setThreadSafeness(ThreadSafeness t) { m_safeness = t; }
208 void setSince(const QString &since);
209 void setPhysicalModuleName(const QString &name) { m_physicalModuleName = name; }
210 void setUrl(const QString &url) { m_url = url; }
211 void setTemplateDecl(std::optional<RelaxedTemplateDeclaration> t) { m_templateDecl = t; }
212 void setReconstitutedBrief(const QString &t) { m_reconstitutedBrief = t; }
213 void setParent(Aggregate *n) { m_parent = n; }
214 void setIndexNodeFlag(bool isIndexNode = true) { m_indexNodeFlag = isIndexNode; }
215 void setHadDoc() { m_hadDoc = true; }
216 void setComparisonCategory(const ComparisonCategory &category) { m_comparisonCategory = category; }
217 [[nodiscard]] ComparisonCategory comparisonCategory() const { return m_comparisonCategory; }
218 virtual void setRelatedNonmember(bool b) { m_relatedNonmember = b; }
219 virtual void addMember(Node *) {}
220 [[nodiscard]] virtual bool hasNamespaces() const { return false; }
221 [[nodiscard]] virtual bool hasClasses() const { return false; }
222 virtual void setAbstract(bool) {}
223 virtual void setWrapper() {}
224 virtual void setDataType(const QString &) {}
225 [[nodiscard]] virtual bool wasSeen() const { return false; }
226 virtual void appendGroupName(const QString &) {}
227 [[nodiscard]] virtual QString element() const { return QString(); }
228 [[nodiscard]] virtual bool docMustBeGenerated() const { return false; }
229
230 [[nodiscard]] virtual QString title() const { return name(); }
231 [[nodiscard]] virtual QString subtitle() const { return QString(); }
232 [[nodiscard]] virtual QString fullTitle() const { return name(); }
233 virtual bool setTitle(const QString &) { return false; }
234 virtual bool setSubtitle(const QString &) { return false; }
235
237 {
238 setAccess(Access::Private);
240 }
241 virtual void markDefault() {}
242 virtual void markReadOnly(bool) {}
243
244 [[nodiscard]] Aggregate *parent() const { return m_parent; }
245 [[nodiscard]] const QString &name() const { return m_name; }
246 [[nodiscard]] QString physicalModuleName() const { return m_physicalModuleName; }
247 [[nodiscard]] QString url() const { return m_url; }
248 virtual void setQtVariable(const QString &) {}
249 [[nodiscard]] virtual QString qtVariable() const { return QString(); }
250 virtual void setCMakePackage(const QString &) {}
251 virtual void setCMakeComponent(const QString &) {}
252 virtual void setCMakeTargetItem(const QString &) {}
253 [[nodiscard]] virtual QString cmakePackage() const { return QString(); }
254 [[nodiscard]] virtual QString cmakeComponent() const { return QString(); }
255 [[nodiscard]] virtual QString cmakeTargetItem() const { return QString(); }
256 [[nodiscard]] virtual bool hasTag(const QString &) const { return false; }
257
258 void setDeprecated(const QString &sinceVersion);
259 [[nodiscard]] const QString &deprecatedSince() const { return m_deprecatedSince; }
260
261 [[nodiscard]] const QMap<LinkType, std::pair<QString, QString>> &links() const { return m_linkMap; }
262 void setLink(LinkType linkType, const QString &link, const QString &desc);
263
264 [[nodiscard]] Access access() const { return m_access; }
265 [[nodiscard]] const Location &declLocation() const { return m_declLocation; }
266 [[nodiscard]] const Location &defLocation() const { return m_defLocation; }
267 [[nodiscard]] const Location &location() const
268 {
269 return (m_defLocation.isEmpty() ? m_declLocation : m_defLocation);
270 }
271 [[nodiscard]] const Doc &doc() const { return m_doc; }
272 [[nodiscard]] bool isInAPI() const
273 {
275 }
276 [[nodiscard]] bool hasDoc() const;
277 [[nodiscard]] bool hadDoc() const { return m_hadDoc; }
278 [[nodiscard]] Status status() const { return m_status; }
281 [[nodiscard]] QString since() const { return m_since; }
282 [[nodiscard]] const std::optional<RelaxedTemplateDeclaration>& templateDecl() const { return m_templateDecl; }
283 [[nodiscard]] const QString &reconstitutedBrief() const { return m_reconstitutedBrief; }
284
285 [[nodiscard]] bool isSharingComment() const { return (m_sharedCommentNode != nullptr); }
286 void setSharedCommentNode(SharedCommentNode *t) { m_sharedCommentNode = t; }
287 SharedCommentNode *sharedCommentNode() { return m_sharedCommentNode; }
288
289 [[nodiscard]] QString extractClassName(const QString &string) const;
290 [[nodiscard]] virtual QString qmlTypeName() const { return m_name; }
291 [[nodiscard]] virtual QString qmlFullBaseName() const { return QString(); }
292 [[nodiscard]] virtual QString logicalModuleName() const { return QString(); }
293 [[nodiscard]] virtual QString logicalModuleVersion() const { return QString(); }
294 [[nodiscard]] virtual QString logicalModuleIdentifier() const { return QString(); }
295
296 virtual void setLogicalModuleInfo(const QStringList &) {}
297 [[nodiscard]] virtual CollectionNode *logicalModule() const { return nullptr; }
298 virtual void setQmlModule(CollectionNode *) {}
299 virtual ClassNode *classNode() { return nullptr; }
300 virtual void setClassNode(ClassNode *) {}
305
306 static FlagValue toFlagValue(bool b);
307 static bool fromFlagValue(FlagValue fv, bool defaultValue);
309 [[nodiscard]] static bool nodeNameLessThan(const Node *first, const Node *second);
310 [[nodiscard]] static bool nodeSortKeyOrNameLessThan(const Node *n1, const Node *n2);
311
312protected:
313 Node(NodeType type, Aggregate *parent, QString name);
314
315private:
316 NodeType m_nodeType {};
317 Genus m_genus {};
318 Access m_access { Access::Public };
319 ThreadSafeness m_safeness { UnspecifiedSafeness };
320 Status m_status { Active };
321 ComparisonCategory m_comparisonCategory { ComparisonCategory::None };
322 bool m_indexNodeFlag : 1;
323 bool m_relatedNonmember : 1;
324 bool m_hadDoc : 1;
325
326 Aggregate *m_parent { nullptr };
327 SharedCommentNode *m_sharedCommentNode { nullptr };
328 QString m_name {};
329 Location m_declLocation {};
330 Location m_defLocation {};
331 Doc m_doc {};
333 QString m_fileNameBase {};
334 QString m_physicalModuleName {};
335 QString m_url {};
336 QString m_since {};
337 std::optional<RelaxedTemplateDeclaration> m_templateDecl{std::nullopt};
338 QString m_reconstitutedBrief {};
339 QString m_deprecatedSince {};
340};
341
342Q_DECLARE_OPERATORS_FOR_FLAGS(Node::SignatureOptions)
343
344QT_END_NAMESPACE
345
346#endif
int main(int argc, char *argv[])
[2]
Definition buffer.cpp:77
std::optional< PCHFile > buildPCH(QDocDatabase *qdb, QString module_header, const std::set< Config::HeaderFilePath > &all_headers, const std::vector< QByteArray > &include_paths, const QList< QByteArray > &defines)
Building the PCH must be possible when there are no .cpp files, so it is moved here to its own member...
struct CXTranslationUnitImpl * CXTranslationUnit
ParsedCppFileIR parse_cpp_file(const QString &filePath)
Get ready to parse the C++ cpp file identified by filePath and add its parsed contents to the databas...
ClangCodeParser(QDocDatabase *qdb, Config &, const std::vector< QByteArray > &include_paths, const QList< QByteArray > &defines, std::optional< std::reference_wrapper< const PCHFile > > pch)
The ClassNode represents a C++ class.
Definition classnode.h:21
static void initialize()
All the code markers in the static list are initialized here, after the qdoc configuration file has b...
static void terminate()
All the code markers in the static list are terminated here.
static const QSet< QString > common_meta_commands
Definition codeparser.h:108
virtual void initializeParser()=0
virtual void terminateParser()
Terminating a code parser is trivial.
CodeParser()
The constructor adds this code parser to the static list of code parsers.
static void setLink(Node *node, Node::LinkType linkType, const QString &arg)
virtual QString language()=0
virtual void parseSourceFile(const Location &location, const QString &filePath, CppCodeParser &cpp_code_parser)=0
QDocDatabase * m_qdb
Definition codeparser.h:137
static CodeParser * parserForLanguage(const QString &language)
static CodeParser * parserForSourceFile(const QString &filePath)
static bool isWorthWarningAbout(const Doc &doc)
Test for whether a doc comment warrants warnings.
virtual QStringList sourceFileNameFilter()=0
virtual ~CodeParser()
The destructor removes this code parser from the static list of code parsers.
static void extractPageLinkAndDesc(QStringView arg, QString *link, QString *desc)
static void initialize()
All the code parsers in the static list are initialized here, after the qdoc configuration variables ...
static void terminate()
All the code parsers in the static list are terminated here.
A class for holding the members of a collection of doc pages.
bool asBool() const
Returns this config variable as a boolean.
Definition config.cpp:264
The Config class contains the configuration variables for controlling how qdoc produces documentation...
Definition config.h:84
static const QString dot
Definition config.h:162
bool singleExec() const
Definition config.h:404
@ IncludePaths
Definition config.h:104
const Location & location() const
Definition config.h:121
const ExcludedPaths & getExcludedPaths()
Definition config.cpp:1406
bool dualExec() const
Definition config.h:409
bool preparing() const
Definition config.h:181
bool getDebug() const
Definition config.h:108
CppCodeParser(FnCommandParser &&parser)
void processMetaCommands(const Doc &doc, Node *node)
The topic command has been processed, and now doc and node are passed to this function to get the met...
DocBookGenerator(FileResolver &file_resolver)
Definition doc.h:31
static void initialize(FileResolver &file_resolver)
Definition doc.cpp:308
Doc()=default
static void terminate()
All the heap allocated variables are deleted.
Definition doc.cpp:361
Encapsulate the logic that QDoc uses to find files whose path is provided by the user and that are re...
This node is used to represent any kind of function being documented.
static void initialize()
static void terminate()
HtmlGenerator(FileResolver &file_resolver)
The Location class provides a way to mark a location in a file.
Definition location.h:15
static int exitCode()
Returns the error code QDoc should exit with; EXIT_SUCCESS or the number of documentation warnings if...
Definition location.cpp:244
static void initialize()
Gets several parameters from the config, including tab size, program name, and a regular expression t...
Definition location.cpp:297
Location()
Constructs an empty location.
Definition location.cpp:40
static void terminate()
Apparently, all this does is delete the regular expression used for intercepting certain error messag...
Definition location.cpp:324
This class represents a C++ namespace.
Tree * tree() const override
Returns a pointer to the Tree that contains this NamespaceNode.
void markInternal()
Sets the node's access to Private and its status to Internal.
Definition node.h:236
virtual void setLogicalModuleInfo(const QStringList &)
If this node is a CollectionNode, this function splits arg on the blank character to get a logical mo...
Definition node.h:296
bool isGenericCollection() const
Returns true if the node type is Collection.
Definition node.h:166
bool isExternalPage() const
Returns true if the node type is ExternalPage.
Definition node.h:134
bool isDontDocument() const
Returns true if this node's status is DontDocument.
Definition node.h:131
QString plainName() const
Returns this node's name member.
Definition node.cpp:471
const Doc & doc() const
Returns a reference to the node's Doc data member.
Definition node.h:271
virtual bool setTitle(const QString &)
Sets the node's title, which is used for the title of the documentation page, if one is generated for...
Definition node.h:233
bool isQmlNode() const
Returns true if this node's Genus value is QML.
Definition node.h:153
virtual void appendGroupName(const QString &)
Definition node.h:226
virtual bool isStatic() const
Returns true if the FunctionNode represents a static function.
Definition node.h:186
virtual QString logicalModuleIdentifier() const
If this is a CollectionNode, this function returns the logical module identifier.
Definition node.h:294
void setHadDoc()
Definition node.h:215
void setUrl(const QString &url)
Sets the node's URL to url, which is the url to the page that the node represents.
Definition node.h:210
virtual bool hasClasses() const
Returns true if this is a CollectionNode and its members list contains class nodes.
Definition node.h:221
virtual bool hasNamespaces() const
Returns true if this is a CollectionNode and its members list contains namespace nodes.
Definition node.h:220
bool isGroup() const
Returns true if the node type is Group.
Definition node.h:139
const QString & reconstitutedBrief() const
Definition node.h:283
void setGenus(Genus t)
Definition node.h:125
virtual bool docMustBeGenerated() const
This function is called to perform a test to decide if the node must have documentation generated.
Definition node.h:228
virtual bool isWrapper() const
Returns true if the node is a class node or a QML type node that is marked as being a wrapper class o...
Definition node.cpp:953
bool isPrivate() const
Returns true if this node's access is Private.
Definition node.h:146
virtual QString signature(Node::SignatureOptions) const
void Node::setGenus(Genus t) Sets this node's Genus to t.
Definition node.h:197
bool isActive() const
Returns true if this node's status is Active.
Definition node.h:128
void setAccess(Access t)
Sets the node's access type to t.
Definition node.h:203
const Location & defLocation() const
Returns the Location where this node's dedefinition was seen.
Definition node.h:266
void setIndexNodeFlag(bool isIndexNode=true)
Sets a flag in this Node that indicates the node was created for something in an index file.
Definition node.h:214
QString fullName(const Node *relative=nullptr) const
Constructs and returns this node's full name.
Definition node.cpp:531
virtual void setQmlModule(CollectionNode *)
If this is a QmlTypeNode, this function sets the QML type's QML module pointer to the CollectionNode ...
Definition node.h:298
virtual QString qmlTypeName() const
If this is a QmlPropertyNode or a FunctionNode representing a QML method, this function returns the q...
Definition node.h:290
virtual bool isAbstract() const
Returns true if the ClassNode or QmlTypeNode is marked abstract.
Definition node.h:169
NodeType
An unsigned char value that identifies an object as a particular subclass of Node.
Definition node.h:54
@ Variable
Definition node.h:69
@ Module
Definition node.h:71
@ Struct
Definition node.h:58
@ QmlModule
Definition node.h:73
@ Typedef
Definition node.h:66
@ QmlValueType
Definition node.h:75
@ Function
Definition node.h:65
@ TypeAlias
Definition node.h:67
@ Union
Definition node.h:59
@ Page
Definition node.h:61
@ Group
Definition node.h:70
@ Enum
Definition node.h:62
@ HeaderFile
Definition node.h:60
@ QmlProperty
Definition node.h:74
@ QmlType
Definition node.h:72
@ SharedComment
Definition node.h:76
@ Namespace
Definition node.h:56
@ Proxy
Definition node.h:78
@ Property
Definition node.h:68
@ Class
Definition node.h:57
@ NoType
Definition node.h:55
@ Collection
Definition node.h:77
@ ExternalPage
Definition node.h:64
@ Example
Definition node.h:63
SharedCommentNode * sharedCommentNode()
Definition node.h:287
bool isNamespace() const
Returns true if the node type is Namespace.
Definition node.h:143
bool isTypedef() const
Returns true if the node type is Typedef.
Definition node.h:160
bool isQmlBasicType() const
Returns true if the node type is QmlBasicType.
Definition node.h:151
virtual QString logicalModuleVersion() const
If this is a CollectionNode, this function returns the logical module version number.
Definition node.h:293
QString nodeTypeString() const
Returns this node's type as a string for use as an attribute value in XML or HTML.
Definition node.cpp:664
ComparisonCategory comparisonCategory() const
Definition node.h:217
virtual void addMember(Node *)
In a CollectionNode, this function adds node to the collection node's members list.
Definition node.h:219
bool hasFileNameBase() const
Returns true if the node's file name base has been set.
Definition node.h:200
bool isPage() const
Returns true if the node type is Page.
Definition node.h:144
virtual QString qmlFullBaseName() const
If this is a QmlTypeNode, this function returns the QML full base name.
Definition node.h:291
bool isFunction(Genus g=DontCare) const
Returns true if this is a FunctionNode and its Genus is set to g.
Definition node.h:135
bool isQmlType() const
Returns true if the node type is QmlType or QmlValueType.
Definition node.h:155
bool isSharedCommentNode() const
Returns true if the node type is SharedComment.
Definition node.h:158
QString physicalModuleName() const
Definition node.h:246
virtual void setCMakePackage(const QString &)
Definition node.h:250
virtual void setDataType(const QString &)
If this node is a PropertyNode or a QmlPropertyNode, its data type data member is set to dataType.
Definition node.h:224
virtual bool isInternal() const
Returns true if the node's status is Internal, or if its parent is a class with Internal status.
Definition node.cpp:849
bool isHeader() const
Returns true if the node type is HeaderFile.
Definition node.h:140
virtual bool isPageNode() const
Returns true if this node represents something that generates a documentation page.
Definition node.h:182
void setFileNameBase(const QString &t)
Sets the node's file name base to t.
Definition node.h:201
virtual bool isMacro() const
returns true if either FunctionNode::isMacroWithParams() or FunctionNode::isMacroWithoutParams() retu...
Definition node.h:181
virtual bool isDefault() const
Returns true if the QML property node is marked as default.
Definition node.h:179
bool isEnumType() const
Returns true if the node type is Enum.
Definition node.h:132
bool isStruct() const
Returns true if the node type is Struct.
Definition node.h:157
virtual bool isTextPageNode() const
Returns true if the node is a PageNode but not an Aggregate.
Definition node.h:187
virtual bool isAttached() const
Returns true if the QML property or QML method node is marked as attached.
Definition node.h:176
Aggregate * parent() const
Returns the node's parent pointer.
Definition node.h:244
static bool fromFlagValue(FlagValue fv, bool defaultValue)
Converts the enum fv back to a boolean value.
Definition node.cpp:748
bool isPublic() const
Returns true if this node's access is Public.
Definition node.h:149
bool isVariable() const
Returns true if the node type is Variable.
Definition node.h:165
void setLocation(const Location &t)
Sets the node's declaration location, its definition location, or both, depending on the suffix of th...
Definition node.cpp:886
virtual void setClassNode(ClassNode *)
If this is a QmlTypeNode, this function sets the C++ class node to cn.
Definition node.h:300
virtual ~Node()=default
The default destructor is virtual so any subclass of Node can be deleted by deleting a pointer to Nod...
QString plainFullName(const Node *relative=nullptr) const
Constructs and returns the node's fully qualified name by recursively ascending the parent links and ...
Definition node.cpp:485
virtual bool isDeprecated() const
Returns true if this node's status is Deprecated.
Definition node.h:168
virtual bool isAggregate() const
Returns true if this node is an aggregate, which means it inherits Aggregate and can therefore have c...
Definition node.h:170
NodeType nodeType() const
Returns this node's type.
Definition node.h:121
FlagValue
A value used in PropertyNode and QmlPropertyNode that can be -1, 0, or +1.
Definition node.h:114
@ FlagValueDefault
Definition node.h:114
@ FlagValueTrue
Definition node.h:114
@ FlagValueFalse
Definition node.h:114
QString qualifyQmlName()
Returns the QML node's qualified name by prepending the logical module name.
Definition node.cpp:943
void setSharedCommentNode(SharedCommentNode *t)
Definition node.h:286
void setTemplateDecl(std::optional< RelaxedTemplateDeclaration > t)
Definition node.h:211
virtual void setRelatedNonmember(bool b)
Sets a flag in the node indicating whether this node is a related nonmember of something.
Definition node.h:218
virtual Node * clone(Aggregate *)
When reimplemented in a subclass, this function creates a clone of this node on the heap and makes th...
Definition node.h:117
virtual void markReadOnly(bool)
If this node is a QmlPropertyNode, then the property's read-only flag is set to flag.
Definition node.h:242
void setComparisonCategory(const ComparisonCategory &category)
Definition node.h:216
static bool nodeNameLessThan(const Node *first, const Node *second)
Returns true if the node n1 is less than node n2.
Definition node.cpp:57
QString qualifyCppName()
Returns the CPP node's qualified name by prepending the namespaces name + "::" if there isw a namespa...
Definition node.cpp:921
ThreadSafeness inheritedThreadSafeness() const
If this node has a parent, the parent's thread safeness value is returned.
Definition node.cpp:838
const Location & location() const
If this node's definition location is empty, this function returns this node's declaration location.
Definition node.h:267
bool isProxyNode() const
Returns true if the node type is Proxy.
Definition node.h:148
virtual bool wasSeen() const
Returns the seen flag data member of this node if it is a NamespaceNode or a CollectionNode.
Definition node.h:225
bool hadDoc() const
Definition node.h:277
const std::optional< RelaxedTemplateDeclaration > & templateDecl() const
Definition node.h:282
Access access() const
Returns the node's Access setting, which can be Public, Protected, or Private.
Definition node.h:264
virtual void setWrapper()
If this node is a ClassNode or a QmlTypeNode, the node's wrapper flag data member is set to true.
Definition node.h:223
virtual QString cmakeComponent() const
Definition node.h:254
virtual void markDefault()
If this node is a QmlPropertyNode, it is marked as the default property.
Definition node.h:241
ThreadSafeness threadSafeness() const
Returns the thread safeness value for whatever this node represents.
Definition node.cpp:826
virtual QString qtVariable() const
If this node is a CollectionNode, its QT variable is returned.
Definition node.h:249
Genus
An unsigned char value that specifies whether the Node represents a C++ element, a QML element,...
Definition node.h:81
@ DontCare
Definition node.h:82
@ API
Definition node.h:86
@ CPP
Definition node.h:83
@ DOC
Definition node.h:85
@ QML
Definition node.h:84
virtual QString logicalModuleName() const
If this is a CollectionNode, this function returns the logical module name.
Definition node.h:292
Aggregate * root() const
bool isInAPI() const
Definition node.h:272
virtual bool isFirstClassAggregate() const
Returns true if this Node is an Aggregate but not a ProxyNode.
Definition node.h:171
virtual bool isMarkedReimp() const
Returns true if the FunctionNode is marked as a reimplemented function.
Definition node.h:184
bool isProperty() const
Returns true if the node type is Property.
Definition node.h:147
virtual QString cmakePackage() const
Definition node.h:253
QString fullDocumentName() const
Construct the full document name for this node and return it.
Definition node.cpp:961
QString url() const
Returns the node's URL, which is the url of the documentation page created for the node or the url of...
Definition node.h:247
bool isTypeAlias() const
Returns true if the node type is Typedef.
Definition node.h:159
virtual Tree * tree() const
Returns a pointer to the Tree this node is in.
Definition node.cpp:876
const Location & declLocation() const
Returns the Location where this node's declaration was seen.
Definition node.h:265
void setDoc(const Doc &doc, bool replace=false)
Sets this Node's Doc to doc.
Definition node.cpp:546
virtual QString title() const
Returns a string that can be used to print a title in the documentation for whatever this Node is.
Definition node.h:230
virtual void setCMakeComponent(const QString &)
Definition node.h:251
virtual bool setSubtitle(const QString &)
Sets the node's subtitle, which is used for the subtitle of the documentation page,...
Definition node.h:234
bool isModule() const
Returns true if the node type is Module.
Definition node.h:142
virtual bool isAlias() const
Returns true if this QML property is marked as an alias.
Definition node.h:175
virtual QString element() const
If this node is a QmlPropertyNode or a FunctionNode, this function returns the name of the parent nod...
Definition node.h:227
virtual QString subtitle() const
Returns a string that can be used to print a subtitle in the documentation for whatever this Node is.
Definition node.h:231
Node(NodeType type, Aggregate *parent, QString name)
Construct a node with the given type and having the given parent and name.
Definition node.cpp:584
virtual ClassNode * classNode()
If this is a QmlTypeNode, this function returns the pointer to the C++ ClassNode that this QML type r...
Definition node.h:299
bool isClass() const
Returns true if the node type is Class.
Definition node.h:129
const QString & fileNameBase() const
Returns the node's file name base string, which is built once, when Generator::fileBase() is called a...
Definition node.h:199
virtual bool isPropertyGroup() const
Returns true if the node is a SharedCommentNode for documenting multiple C++ properties or multiple Q...
Definition node.h:185
Genus genus() const
Returns this node's Genus.
Definition node.h:124
ThreadSafeness
An unsigned char that specifies the degree of thread-safeness of the element.
Definition node.h:97
@ ThreadSafe
Definition node.h:101
@ NonReentrant
Definition node.h:99
@ UnspecifiedSafeness
Definition node.h:98
@ Reentrant
Definition node.h:100
virtual QString fullTitle() const
Returns a string that can be used as the full title for the documentation of this node.
Definition node.h:232
static QString nodeTypeString(NodeType t)
Returns the node type t as a string for use as an attribute value in XML or HTML.
Definition node.cpp:677
bool isSharingComment() const
This function returns true if the node is sharing a comment with other nodes.
Definition node.h:285
virtual void setCMakeTargetItem(const QString &)
Definition node.h:252
virtual CollectionNode * logicalModule() const
If this is a QmlTypeNode, a pointer to its QML module is returned, which is a pointer to a Collection...
Definition node.h:297
QString since() const
Returns the node's since string, which can be empty.
Definition node.h:281
virtual void setAbstract(bool)
If this node is a ClassNode or a QmlTypeNode, the node's abstract flag data member is set to b.
Definition node.h:222
bool hasDoc() const
Returns true if this node is documented, or it represents a documented node read from the index ('had...
Definition node.cpp:906
void setParent(Aggregate *n)
Sets the node's parent pointer to n.
Definition node.h:213
bool isPreliminary() const
Returns true if this node's status is Preliminary.
Definition node.h:145
static FlagValue toFlagValue(bool b)
Converts the boolean value b to an enum representation of the boolean type, which includes an enum va...
Definition node.cpp:737
void setReconstitutedBrief(const QString &t)
When reading an index file, this function is called with the reconstituted brief clause t to set the ...
Definition node.h:212
LinkType
An unsigned char value that probably should be moved out of the Node base class.
Definition node.h:112
virtual bool hasTag(const QString &) const
If this node is a FunctionNode, the function returns true if the function has the tag t.
Definition node.h:256
virtual QString cmakeTargetItem() const
Definition node.h:255
bool isRelatedNonmember() const
Returns true if this is a related nonmember of something.
Definition node.h:156
void setSince(const QString &since)
Sets the information about the project and version a node was introduced in, unless the version is lo...
Definition node.cpp:778
virtual bool isClassNode() const
Returns true if this is an instance of ClassNode.
Definition node.h:177
bool isCppNode() const
Returns true if this node's Genus value is CPP.
Definition node.h:130
void setStatus(Status t)
Sets the node's status to t.
Definition node.cpp:560
QString extractClassName(const QString &string) const
Extract a class name from the type string and return it.
Definition node.cpp:798
void setDeprecated(const QString &sinceVersion)
Sets the Node status to Node::Deprecated, unless sinceVersion represents a future version.
Definition node.cpp:1008
virtual bool isRelatableType() const
Returns true if this node is something you can relate things to with the relates command.
Definition node.h:183
virtual bool isCollectionNode() const
Returns true if this is an instance of CollectionNode.
Definition node.h:178
static bool nodeSortKeyOrNameLessThan(const Node *n1, const Node *n2)
Returns true if node n1 is less than node n2 when comparing the sort keys, defined with.
Definition node.cpp:99
void setThreadSafeness(ThreadSafeness t)
Sets the node's thread safeness to t.
Definition node.h:207
void setPhysicalModuleName(const QString &name)
Sets the node's physical module name.
Definition node.h:209
Status
An unsigned char that specifies the status of the documentation element in the documentation set.
Definition node.h:89
@ Internal
Definition node.h:93
@ Active
Definition node.h:92
@ DontDocument
Definition node.h:94
@ Deprecated
Definition node.h:90
@ Preliminary
Definition node.h:91
bool isQmlModule() const
Returns true if the node type is QmlModule.
Definition node.h:152
SignatureOption
Definition node.h:104
@ SignatureReturnType
Definition node.h:107
@ SignatureDefaultValues
Definition node.h:106
@ SignaturePlain
Definition node.h:105
@ SignatureTemplateParams
Definition node.h:108
bool isProtected() const
Returns true if this node's access is Protected.
Definition node.h:150
bool isExample() const
Returns true if the node type is Example.
Definition node.h:133
QString qualifyWithParentName()
Return the name of this node qualified with the parent name and "::" if there is a parent name.
Definition node.cpp:932
bool isIndexNode() const
Returns true if this node was created from something in an index file.
Definition node.h:141
QString plainSignature() const
Constructs and returns the node's fully qualified signature by recursively ascending the parent links...
Definition node.cpp:509
Status status() const
Returns the node's status value.
Definition node.h:278
bool isUnion() const
Returns true if the node type is Union.
Definition node.h:164
const QString & deprecatedSince() const
Definition node.h:259
bool isQmlProperty() const
Returns true if the node type is QmlProperty.
Definition node.h:154
virtual void setQtVariable(const QString &)
If this node is a CollectionNode, its QT variable is set to v.
Definition node.h:248
const QString & name() const
Returns the node's name data member.
Definition node.h:245
static Genus getGenus(NodeType t)
Determines the appropriate Genus value for the NodeType value t and returns that Genus value.
Definition node.cpp:607
A PageNode is a Node that generates a documentation page.
Definition pagenode.h:18
This class describes one instance of using the Q_PROPERTY macro.
PureDocParser(const Location &location)
This class provides exclusive access to the qdoc database, which consists of a forrest of trees and a...
static void destroyQdocDB()
Destroys the singleton.
static QDocDatabase * qdocDB()
Creates the singleton.
NamespaceNode * primaryTreeRoot()
Returns a pointer to the root node of the primary tree.
void processForest()
This function calls a set of functions for each tree in the forest that has not already been analyzed...
void clearSearchOrder()
void resolveStuff()
Performs several housekeeping tasks prior to generating the documentation.
static void terminate()
Clear the static maps so that subsequent runs don't try to use contents from a previous run.
SourceFileParser(ClangCodeParser &clang_parser, PureDocParser &pure_parser)
static void terminate()
The heap allocated variables are freed here.
static void initialize()
This class constructs and maintains a tree of instances of the subclasses of Node.
Definition tree.h:56
WebXMLGenerator(FileResolver &file_resolver)
#define COMMAND_QMLINHERITS
Definition codeparser.h:56
#define COMMAND_MODULESTATE
Definition codeparser.h:37
#define COMMAND_INTERNAL
Definition codeparser.h:34
#define COMMAND_NONREENTRANT
Definition codeparser.h:41
#define COMMAND_OBSOLETE
Definition codeparser.h:42
#define COMMAND_INMODULE
Definition codeparser.h:31
#define COMMAND_DEPRECATED
Definition codeparser.h:21
#define COMMAND_PRELIMINARY
Definition codeparser.h:45
#define COMMAND_WRAPPER
Definition codeparser.h:84
#define COMMAND_CMAKETARGETITEM
Definition codeparser.h:17
#define COMMAND_REENTRANT
Definition codeparser.h:70
#define COMMAND_TITLE
Definition codeparser.h:78
#define COMMAND_STARTPAGE
Definition codeparser.h:76
#define COMMAND_QMLDEFAULT
Definition codeparser.h:54
#define COMMAND_SINCE
Definition codeparser.h:73
#define COMMAND_QMLABSTRACT
Definition codeparser.h:48
#define COMMAND_QTVARIABLE
Definition codeparser.h:69
#define COMMAND_QTCMAKEPACKAGE
Definition codeparser.h:67
#define COMMAND_NOAUTOLIST
Definition codeparser.h:40
#define COMMAND_QTCMAKETARGETITEM
Definition codeparser.h:68
#define COMMAND_DEFAULT
Definition codeparser.h:20
#define COMMAND_THREADSAFE
Definition codeparser.h:77
#define COMMAND_CMAKECOMPONENT
Definition codeparser.h:16
#define COMMAND_QMLREADONLY
Definition codeparser.h:63
#define COMMAND_QMLENUMERATORSFROM
Definition codeparser.h:55
#define COMMAND_INPUBLICGROUP
Definition codeparser.h:32
#define COMMAND_QMLREQUIRED
Definition codeparser.h:64
#define COMMAND_ABSTRACT
Definition codeparser.h:13
#define COMMAND_ATTRIBUTION
Definition codeparser.h:85
#define COMMAND_INQMLMODULE
Definition codeparser.h:33
#define COMMAND_CMAKEPACKAGE
Definition codeparser.h:15
#define COMMAND_INGROUP
Definition codeparser.h:29
#define COMMAND_SUBTITLE
Definition codeparser.h:75
#define CONFIG_SOURCES
Definition config.h:384
#define CONFIG_VERSION
Definition config.h:394
#define CONFIG_EXAMPLEDIRS
Definition config.h:337
#define CONFIG_INDEXES
Definition config.h:358
#define CONFIG_DEFINES
Definition config.h:331
#define CONFIG_DEPENDS
Definition config.h:332
#define CONFIG_NOLINKERRORS
Definition config.h:369
#define CONFIG_LOGPROGRESS
Definition config.h:363
#define CONFIG_IMAGEDIRS
Definition config.h:355
#define CONFIG_PROJECT
Definition config.h:375
#define CONFIG_SOURCEDIRS
Definition config.h:382
#define CONFIG_HEADERS
Definition config.h:346
#define CONFIG_DOCUMENTATIONINHEADERS
Definition config.h:335
#define CONFIG_NAVIGATION
Definition config.h:368
#define CONFIG_LANDINGPAGE
Definition config.h:359
#define CONFIG_OUTPUTFORMATS
Definition config.h:371
#define CONFIG_LANDINGTITLE
Definition config.h:360
#define CONFIG_MODULEHEADER
Definition config.h:366
#define CONFIG_HEADERDIRS
Definition config.h:345
#define CONFIG_INCLUDEPATHS
Definition config.h:356
Combined button and popup list for selecting options.
This namespace holds QDoc-internal utility methods.
Definition utilities.h:15
bool debugging()
Definition utilities.cpp:38
QMultiMap< QString, CollectionNode * > CNMultiMap
Definition node.h:49
QList< Node * > NodeList
Definition node.h:41
QList< ClassNode * > ClassList
Definition node.h:42
QList< Node * > NodeVector
Definition node.h:43
QMap< QString, NodeMultiMap > NodeMultiMapMap
Definition node.h:47
QMap< QString, Node * > NodeMap
Definition node.h:44
QMap< QString, NodeMap > NodeMapMap
Definition node.h:45
QMap< QString, CollectionNode * > CNMap
Definition node.h:48
QMultiMap< QString, Node * > NodeMultiMap
Definition node.h:46
static void parseSourceFiles(std::vector< QString > &&sources, SourceFileParser &source_file_parser, CppCodeParser &cpp_code_parser)
Definition main.cpp:64
static void singleExecutionMode()
Definition main.cpp:652
void logStartEndMessage(const QLatin1String &startStop, Config &config)
Definition main.cpp:273
static void processQdocconfFile(const QString &fileName)
Processes the qdoc config file fileName.
Definition main.cpp:295
static void clearModuleDependenciesAndProcessQdocconfFile(const QStringList &qdocFiles)
Definition main.cpp:634
static void dualExecutionMode()
Definition main.cpp:669
bool creationTimeBefore(const QFileInfo &fi1, const QFileInfo &fi2)
Definition main.cpp:45
static void loadIndexFiles(const QSet< QString > &formats)
Read some XML indexes containing definitions from other documentation sets.
Definition main.cpp:121
FnCommandParser(QDocDatabase *qdb, const std::set< Config::HeaderFilePath > &all_headers, const QList< QByteArray > &defines, std::optional< std::reference_wrapper< const PCHFile > > pch)
std::variant< Node *, FnMatchError > operator()(const Location &location, const QString &fnSignature, const QString &idTag, QStringList context)
Use clang to parse the function signature from a function command.
QByteArray name
QTemporaryDir dir
Processes parser errors and outputs warnings for them.
Definition parsererror.h:20
QStringList context
Definition codeparser.h:97