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.cpp
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#include "node.h"
5
6#include "aggregate.h"
7#include "codemarker.h"
8#include "config.h"
9#include "enumnode.h"
10#include "functionnode.h"
11#include "generator.h"
13#include "nodecontext.h"
14#include "qdocdatabase.h"
15#include "qdoclogging.h"
16#include "qmltypenode.h"
18#include "relatedclass.h"
20#include "tokenizer.h"
21#include "tree.h"
22
23#include <QtCore/quuid.h>
24#include <QtCore/qversionnumber.h>
25
26#include <utility>
27
29
30using namespace Qt::StringLiterals;
31
32/*!
33 \class Node
34 \brief The Node class is the base class for all the nodes in QDoc's parse tree.
35
36 Class Node is the base class of all the node subclasses. There is a subclass of Node
37 for each type of entity that QDoc can document. The types of entities that QDoc can
38 document are listed in the enum type NodeType.
39
40 After ClangCodeParser has parsed all the header files to build its precompiled header,
41 it then visits the clang Abstract Syntax Tree (AST). For each node in the AST that it
42 determines is in the public API and must be documented, it creates an instance of one
43 of the Node subclasses and adds it to the QDoc Tree.
44
45 Each instance of a sublass of Node has a parent pointer to link it into the Tree. The
46 parent pointer is obtained by calling \l {parent()}, which returns a pointer to an
47 instance of the Node subclass, Aggregate, which is never instantiated directly, but
48 as the base class for certain subclasses of Node that can have children. For example,
49 ClassNode and QmlTypeNode can have children, so they both inherit Aggregate, while
50 PropertyNode and QmlPropertyNode can not have children, so they both inherit Node.
51
52 \sa Aggregate, ClassNode, PropertyNode
53 */
54
55// Helper macro for comparing any a < b
56#define LT_RETURN_IF_NOT_EQUAL(a, b)
57 if ((a) != (b))
58 return (a) < (b);
59
60// Helper macro for comparing strings a < b
61#define LT_RETURN_IF_NOT_EQUAL_QSTR(a, b)
62 if ((a) != (b))
63 return QString::compare(a, b) < 0;
64
65/*!
66 Returns \c true if the node \a n1 is less than node \a n2. The
67 comparison is performed by comparing properties of the nodes
68 in order of increasing complexity.
69
70 String properties are compared in a locale- and platform-
71 independent manner.
72
73 Use for sorting lists of Nodes for output not intended for
74 human consumption, for example, ordering elements in an index
75 file.
76
77 \sa nodeNameLessThan()
78 */
79bool Node::nodeLessThan(const Node *n1, const Node *n2)
80{
81 if (n1->isFunction() && n2->isFunction()) {
82 const auto *f1 = static_cast<const FunctionNode *>(n1);
83 const auto *f2 = static_cast<const FunctionNode *>(n2);
84
85 LT_RETURN_IF_NOT_EQUAL(f1->isConst(), f2->isConst());
86 LT_RETURN_IF_NOT_EQUAL_QSTR(f1->signature(Node::SignatureReturnType),
87 f2->signature(Node::SignatureReturnType));
88 }
89
91 LT_RETURN_IF_NOT_EQUAL_QSTR(n1->name(), n2->name());
92 LT_RETURN_IF_NOT_EQUAL_QSTR(n1->logicalModuleName(), n2->logicalModuleName());
94 LT_RETURN_IF_NOT_EQUAL_QSTR(n1->location().filePath(), n2->location().filePath());
96
97 return false;
98}
99
100/*!
101 Returns \c true if the node \a n1 is less than node \a n2. The
102 comparison is performed by comparing properties of the nodes
103 in order of increasing complexity.
104
105 Use for sorting lists of Nodes for output intended for human
106 consumption. Sorting by name/title takes precedence over other
107 properties.
108
109 \sa nodeLessThan()
110 */
111bool Node::nodeNameLessThan(const Node *n1, const Node *n2)
112{
113 if (n1->isPageNode() && n2->isPageNode()) {
114 LT_RETURN_IF_NOT_EQUAL(n1->fullName(), n2->fullName());
115 LT_RETURN_IF_NOT_EQUAL(n1->fullTitle(), n2->fullTitle());
116 }
117
118 if (n1->isFunction() && n2->isFunction()) {
119 const auto *f1 = static_cast<const FunctionNode *>(n1);
120 const auto *f2 = static_cast<const FunctionNode *>(n2);
121
122 LT_RETURN_IF_NOT_EQUAL(f1->isConst(), f2->isConst());
124 f2->signature(Node::SignatureReturnType));
125 }
126
128 LT_RETURN_IF_NOT_EQUAL(n1->name(), n2->name());
129 LT_RETURN_IF_NOT_EQUAL(n1->logicalModuleName(), n2->logicalModuleName());
131 LT_RETURN_IF_NOT_EQUAL(n1->location().filePath(), n2->location().filePath());
132
133 return false;
134}
135
136bool Node::nodeNameOverloadLessThan(const Node *n1, const Node *n2)
137{
138 if (n1->isFunction() && n2->isFunction()) {
139 const auto *f1 = static_cast<const FunctionNode *>(n1);
140 const auto *f2 = static_cast<const FunctionNode *>(n2);
141
142 LT_RETURN_IF_NOT_EQUAL(f1->overloadNumber(), f2->overloadNumber());
143 }
144
145 return nodeNameLessThan(n1, n2);
146}
147
148/*!
149 Returns \c true if node \a n1 is less than node \a n2 when comparing
150 the sort keys, defined with
151
152 \badcode
153 \meta sortkey {<value>}
154 \endcode
155
156 in the respective nodes' documentation. If the two sort keys are equal,
157 falls back to nodeNameLessThan(). If \a n1 defines a sort key and \a n2
158 does not, then n1 < n2.
159
160*/
161bool Node::nodeSortKeyOrNameLessThan(const Node *n1, const Node *n2)
162{
163 const QString default_sortkey{QChar{QChar::LastValidCodePoint}};
164 const auto *n1_metamap{n1->doc().metaTagMap()};
165 const auto *n2_metamap{n2->doc().metaTagMap()};
166 if (auto cmp = QString::compare(
167 n1_metamap ? n1_metamap->value(u"sortkey"_s, default_sortkey) : default_sortkey,
168 n2_metamap ? n2_metamap->value(u"sortkey"_s, default_sortkey) : default_sortkey); cmp != 0) {
169 return cmp < 0;
170 }
171 return nodeNameLessThan(n1, n2);
172}
173
174
176{
177 NodeContext context;
178 context.type = nodeType();
179 context.isPrivate = isPrivate();
180 context.isInternal = isInternal();
183
184 return context;
185}
186
187
188/*!
189 \internal
190 \fn setComparisonCategory(const ComparisonCategory category)
191
192 Sets the comparison category of this node to \a category.
193
194 \sa ComparisonCategory, comparisonCategory()
195 */
196
197/*!
198 \internal
199 \fn ComparisonCategory comparisonCategory()
200
201 Returns the comparison category of this node.
202
203 \sa ComparisonCategory, setComparisonCategory()
204 */
205
206/*!
207 \enum Access
208
209 An unsigned char value that indicates the C++ access level.
210
211 \value Public The element has public access.
212 \value Protected The element has protected access.
213 \value Private The element has private access.
214*/
215
216/*!
217 \enum Node::Status
218
219 An unsigned char that specifies the status of the documentation element in
220 the documentation set.
221
222 \value Deprecated The element has been deprecated.
223 \value Preliminary The element is new; the documentation is preliminary.
224 \value Active The element is current.
225 \value Internal The element is for internal use only, not to be published.
226 \value DontDocument The element is not to be documented.
227*/
228
229/*!
230 \enum Node::ThreadSafeness
231
232 An unsigned char that specifies the degree of thread-safeness of the element.
233
234 \value UnspecifiedSafeness The thread-safeness is not specified.
235 \value NonReentrant The element is not reentrant.
236 \value Reentrant The element is reentrant.
237 \value ThreadSafe The element is threadsafe.
238*/
239
240/*!
241 \enum Node::LinkType
242
243 An unsigned char value that probably should be moved out of the Node base class.
244
245 \value StartLink
246 \value NextLink
247 \value PreviousLink
248 \value ContentsLink
249 */
250
251/*!
252 \enum Node::FlagValue
253
254 A value used in PropertyNode and QmlPropertyNode that can be -1, 0, or +1.
255 Properties and QML properties have flags, which can be 0 or 1, false or true,
256 or not set. FlagValueDefault is the not set value. In other words, if a flag
257 is set to FlagValueDefault, the meaning is the flag has not been set.
258
259 \value FlagValueDefault -1 Not set.
260 \value FlagValueFalse 0 False.
261 \value FlagValueTrue 1 True.
262*/
263
264/*!
265 \fn Node::~Node()
266
267 The default destructor is virtual so any subclass of Node can be
268 deleted by deleting a pointer to Node.
269 */
270
271/*! \fn bool Node::isActive() const
272 Returns true if this node's status is \c Active.
273 */
274
275/*! \fn bool Node::isClass() const
276 Returns true if the node type is \c Class.
277 */
279/*! \fn bool Node::isCppNode() const
280 Returns true if this node's Genus value is \c CPP.
281 */
282
283/*! \fn bool Node::isDeprecated() const
284 Returns true if this node's status is \c Deprecated.
285 */
286
287/*! \fn bool Node::isDontDocument() const
288 Returns true if this node's status is \c DontDocument.
289 */
290
291/*! \fn bool Node::isEnumType() const
292 Returns true if the node type is \c Enum.
293 */
294
295/*! \fn bool Node::isExample() const
296 Returns true if the node type is \c Example.
297 */
298
299/*! \fn bool Node::isExternalPage() const
300 Returns true if the node type is \c ExternalPage.
301 */
302
303/*! \fn bool Node::isFunction(Genus g = DontCare) const
304 Returns true if this is a FunctionNode and its Genus is set to \a g.
305 */
306
307/*! \fn bool Node::isGroup() const
308 Returns true if the node type is \c Group.
309 */
310
311/*! \fn bool Node::isHeader() const
312 Returns true if the node type is \c HeaderFile.
313 */
314
315/*! \fn bool Node::isIndexNode() const
316 Returns true if this node was created from something in an index file.
317 */
318
319/*! \fn bool Node::isModule() const
320 Returns true if the node type is \c Module.
321 */
322
323/*! \fn bool Node::isNamespace() const
324 Returns true if the node type is \c Namespace.
325 */
326
327/*! \fn bool Node::isPage() const
328 Returns true if the node type is \c Page.
329 */
330
331/*! \fn bool Node::isPreliminary() const
332 Returns true if this node's status is \c Preliminary.
333 */
334
335/*! \fn bool Node::isPrivate() const
336 Returns true if this node's access is \c Private.
337 */
338
339/*! \fn bool Node::isProperty() const
340 Returns true if the node type is \c Property.
341 */
342
343/*! \fn bool Node::isProxyNode() const
344 Returns true if the node type is \c Proxy.
345 */
346
347/*! \fn bool Node::isPublic() const
348 Returns true if this node's access is \c Public.
349 */
350
351/*! \fn bool Node::isProtected() const
352 Returns true if this node's access is \c Protected.
353 */
354
355/*! \fn bool Node::isQmlBasicType() const
356 Returns true if the node type is \c QmlBasicType.
357 */
358
359/*! \fn bool Node::isQmlModule() const
360 Returns true if the node type is \c QmlModule.
361 */
362
363/*! \fn bool Node::isQmlNode() const
364 Returns true if this node's Genus value is \c QML.
365 */
366
367/*! \fn bool Node::isQmlProperty() const
368 Returns true if the node type is \c QmlProperty.
369 */
370
371/*! \fn bool Node::isQmlType() const
372 Returns true if the node type is \c QmlType or \c QmlValueType.
373 */
374
375/*! \fn bool Node::isRelatedNonmember() const
376 Returns true if this is a related nonmember of something.
377 */
378
379/*! \fn bool Node::isStruct() const
380 Returns true if the node type is \c Struct.
381 */
382
383/*! \fn bool Node::isSharedCommentNode() const
384 Returns true if the node type is \c SharedComment.
385 */
386
387/*! \fn bool Node::isTypeAlias() const
388 Returns true if the node type is \c Typedef.
389 */
390
391/*! \fn bool Node::isTypedef() const
392 Returns true if the node type is \c Typedef.
393 */
394
395/*! \fn bool Node::isUnion() const
396 Returns true if the node type is \c Union.
397 */
398
399/*! \fn bool Node::isVariable() const
400 Returns true if the node type is \c Variable.
401 */
402
403/*! \fn bool Node::isGenericCollection() const
404 Returns true if the node type is \c Collection.
405 */
406
407/*! \fn bool Node::isAbstract() const
408 Returns true if the ClassNode or QmlTypeNode is marked abstract.
409*/
410
411/*! \fn bool Node::isAggregate() const
412 Returns true if this node is an aggregate, which means it
413 inherits Aggregate and can therefore have children.
414*/
415
416/*! \fn bool Node::isFirstClassAggregate() const
417 Returns true if this Node is an Aggregate but not a ProxyNode.
418*/
419
420/*! \fn bool Node::isAlias() const
421 Returns true if this QML property is marked as an alias.
422*/
423
424/*! \fn bool Node::isAttached() const
425 Returns true if the QML property or QML method node is marked as attached.
426*/
427
428/*! \fn bool Node::isClassNode() const
429 Returns true if this is an instance of ClassNode.
430*/
431
432/*! \fn bool Node::isCollectionNode() const
433 Returns true if this is an instance of CollectionNode.
434*/
435
436/*! \fn bool Node::isDefault() const
437 Returns true if the QML property node is marked as default.
438*/
439
440/*! \fn bool Node::isMacro() const
441 returns true if either FunctionNode::isMacroWithParams() or
442 FunctionNode::isMacroWithoutParams() returns true.
443*/
444
445/*! \fn bool Node::isPageNode() const
446 Returns true if this node represents something that generates a documentation
447 page. In other words, if this Node's subclass inherits PageNode, then this
448 function will return \e true.
449*/
450
451/*! \fn bool Node::isRelatableType() const
452 Returns true if this node is something you can relate things to with
453 the \e relates command. NamespaceNode, ClassNode, HeaderNode, and
454 ProxyNode are relatable types.
455*/
456
457/*! \fn bool Node::isMarkedReimp() const
458 Returns true if the FunctionNode is marked as a reimplemented function.
459 That means it is virtual in the base class and it is reimplemented in
460 the subclass.
461*/
462
463/*! \fn bool Node::isPropertyGroup() const
464 Returns true if the node is a SharedCommentNode for documenting
465 multiple C++ properties or multiple QML properties.
466*/
467
468/*! \fn bool Node::isStatic() const
469 Returns true if the FunctionNode represents a static function.
470*/
471
472/*! \fn bool Node::isTextPageNode() const
473 Returns true if the node is a PageNode but not an Aggregate.
474*/
475
476/*!
477 Returns this node's name member. Appends "()" to the returned
478 name if this node is a function node, but not if it is a macro
479 because macro names normally appear without parentheses.
480 */
482{
483 if (isFunction() && !isMacro())
484 return m_name + QLatin1String("()");
485 return m_name;
486}
487
488/*!
489 Constructs and returns the node's fully qualified name by
490 recursively ascending the parent links and prepending each
491 parent name + "::". Breaks out when reaching a HeaderNode,
492 or when the parent pointer is \a relative. Typically, calls
493 to this function pass \c nullptr for \a relative.
494 */
495QString Node::plainFullName(const Node *relative) const
496{
497 if (m_name.isEmpty())
498 return QLatin1String("global");
499 if (isHeader())
500 return plainName();
501
502 QStringList parts;
503 const Node *node = this;
504 while (node && !node->isHeader()) {
505 parts.prepend(node->plainName());
506 if (node->parent() == relative || node->parent()->name().isEmpty())
507 break;
508 node = node->parent();
509 }
510 return parts.join(QLatin1String("::"));
511}
512
513/*!
514 Constructs and returns the node's fully qualified signature
515 by recursively ascending the parent links and prepending each
516 parent name + "::" to the plain signature. The return type is
517 not included.
518 */
520{
521 if (m_name.isEmpty())
522 return QLatin1String("global");
523
524 QString fullName;
525 const Node *node = this;
526 while (node) {
527 fullName.prepend(node->signature(Node::SignaturePlain));
528 if (node->parent()->name().isEmpty())
529 break;
530 fullName.prepend(QLatin1String("::"));
531 node = node->parent();
532 }
533 return fullName;
534}
535
536/*!
537 Constructs and returns this node's full name. The full name is
538 often just the title(). When it is not the title, it is the
539 plainFullName().
540 */
541QString Node::fullName(const Node *relative) const
542{
543 if ((isTextPageNode() || isGroup()) && !title().isEmpty())
544 return title();
545 return plainFullName(relative);
546}
547
548/*!
549 Sets this Node's Doc to \a doc. If \a replace is false and
550 this Node already has a Doc, and if this doc is not marked
551 with the \\reimp command, a warning is reported that the
552 existing Doc is being overridden, and it reports where the
553 previous Doc was found. If \a replace is true, the Doc is
554 replaced silently. Auto-generated documentation (for explicitly
555 defaulted or deleted functions) is also silently replaced.
556 */
557void Node::setDoc(const Doc &doc, bool replace)
558{
559 if (!m_doc.isEmpty() && !replace && !doc.isMarkedReimp() && !m_doc.isAutoGenerated()) {
560 doc.location().warning(QStringLiteral("Overrides a previous doc"),
561 QStringLiteral("from here: %1").arg(m_doc.location().toString()));
562 }
563 m_doc = doc;
564}
565
566/*!
567 Sets the node's status to \a t.
568
569 \sa Status
570*/
572{
573 m_status = t;
574
575 // Set non-null, empty URL to nodes that are ignored as
576 // link targets
577 switch (t) {
578 case Status::Internal: {
579 const InclusionPolicy policy = Config::instance().createInclusionPolicy();
581 break;
582 Q_FALLTHROUGH();
583 }
584 case Status::DontDocument:
585 m_url = QStringLiteral("");
586 break;
587 default:
588 break;
589 }
590}
591
592/*!
593 Construct a node with the given \a type and having the
594 given \a parent and \a name. The new node is added to the
595 parent's child list.
596 */
597Node::Node(NodeType type, Aggregate *parent, QString name)
598 : m_nodeType(type),
599 m_indexNodeFlag(false),
600 m_relatedNonmember(false),
601 m_hadDoc(false),
602 m_parent(parent),
604{
605 if (m_parent)
606 m_parent->addChild(this);
607
609}
610
611/*!
612 Determines the appropriate Genus value for the NodeType
613 value \a t and returns that Genus value. Note that this
614 function is called in the Node() constructor. It always
615 returns Node::CPP when \a t is Node::Function, which
616 means the FunctionNode() constructor must determine its
617 own Genus value separately, because class FunctionNode
618 is a subclass of Node.
619 */
621{
622 switch (t) {
623 case NodeType::Enum:
624 case NodeType::Class:
625 case NodeType::Struct:
626 case NodeType::Union:
627 case NodeType::Module:
635 return Genus::CPP;
641 return Genus::QML;
642 case NodeType::Page:
643 case NodeType::Group:
646 return Genus::DOC;
649 case NodeType::Proxy:
650 default:
651 return Genus::DontCare;
652 }
653}
654
655/*! \fn QString Node::url() const
656 Returns the node's URL, which is the url of the documentation page
657 created for the node or the url of an external page if the node is
658 an ExternalPageNode. The url is used for generating a link to the
659 page the node represents.
660
661 \sa Node::setUrl()
662 */
663
664/*! \fn void Node::setUrl(const QString &url)
665 Sets the node's URL to \a url, which is the url to the page that the
666 node represents. This function is only called when an index file is
667 read. In other words, a node's url is set when qdoc decides where its
668 page will be and what its name will be, which happens when qdoc writes
669 the index file for the module being documented.
670
671 \sa QDocIndexFiles
672 */
673
674/*!
675 Returns this node's type as a string for use as an
676 attribute value in XML or HTML.
677 */
679{
680 if (isFunction()) {
681 const auto *fn = static_cast<const FunctionNode *>(this);
682 return fn->kindString();
683 }
684 return nodeTypeString(nodeType());
685}
686
687/*!
688 Returns the node type \a t as a string for use as an
689 attribute value in XML or HTML.
690 */
691QString Node::nodeTypeString(NodeType t)
692{
693 switch (t) {
695 return QLatin1String("namespace");
696 case NodeType::Class:
697 return QLatin1String("class");
698 case NodeType::Struct:
699 return QLatin1String("struct");
700 case NodeType::Union:
701 return QLatin1String("union");
703 return QLatin1String("header");
704 case NodeType::Page:
705 return QLatin1String("page");
706 case NodeType::Enum:
707 return QLatin1String("enum");
709 return QLatin1String("example");
711 return QLatin1String("external page");
714 return QLatin1String("typedef");
716 return QLatin1String("function");
718 return QLatin1String("property");
719 case NodeType::Proxy:
720 return QLatin1String("proxy");
722 return QLatin1String("variable");
723 case NodeType::Group:
724 return QLatin1String("group");
725 case NodeType::Module:
726 return QLatin1String("module");
727
729 return QLatin1String("QML type");
731 return QLatin1String("QML value type");
733 return QLatin1String("QML module");
735 return QLatin1String("QML property");
736
738 return QLatin1String("shared comment");
740 return QLatin1String("collection");
741 default:
742 break;
743 }
744 return QString();
745}
746
747/*! Converts the boolean value \a b to an enum representation
748 of the boolean type, which includes an enum value for the
749 \e {default value} of the item, i.e. true, false, or default.
750 */
752{
753 return b ? FlagValueTrue : FlagValueFalse;
754}
755
756/*!
757 Converts the enum \a fv back to a boolean value.
758 If \a fv is neither the true enum value nor the
759 false enum value, the boolean value returned is
760 \a defaultValue.
761 */
762bool Node::fromFlagValue(FlagValue fv, bool defaultValue)
763{
764 switch (fv) {
765 case FlagValueTrue:
766 return true;
767 case FlagValueFalse:
768 return false;
769 default:
770 return defaultValue;
771 }
772}
773
774/*!
775 This function creates a pair that describes a link.
776 The pair is composed from \a link and \a desc. The
777 \a linkType is the map index the pair is filed under.
778 */
779void Node::setLink(LinkType linkType, const QString &link, const QString &desc)
780{
781 std::pair<QString, QString> linkPair;
782 linkPair.first = std::move(link);
783 linkPair.second = std::move(desc);
784 m_linkMap[linkType] = std::move(linkPair);
785}
786
787/*!
788 Sets the information about the project and version a node was introduced
789 in, unless the version is lower than the 'ignoresince.<project>'
790 configuration variable.
791 */
792void Node::setSince(const QString &since)
793{
794 QStringList parts = since.split(QLatin1Char(' '));
795 QString project;
796 if (parts.size() > 1)
797 project = Config::dot + parts.first();
798
799 QVersionNumber cutoff =
800 QVersionNumber::fromString(Config::instance().get(CONFIG_IGNORESINCE + project).asString())
801 .normalized();
802
803 if (!cutoff.isNull() && QVersionNumber::fromString(parts.last()).normalized() < cutoff)
804 return;
805
806 m_since = parts.join(QLatin1Char(' '));
807}
808
809/*!
810 Extract a class name from the type \a string and return it.
811 */
812QString Node::extractClassName(const QString &string) const
813{
814 QString result;
815 for (int i = 0; i <= string.size(); ++i) {
816 QChar ch;
817 if (i != string.size())
818 ch = string.at(i);
819
820 QChar lower = ch.toLower();
821 if ((lower >= QLatin1Char('a') && lower <= QLatin1Char('z')) || ch.digitValue() >= 0
822 || ch == QLatin1Char('_') || ch == QLatin1Char(':')) {
823 result += ch;
824 } else if (!result.isEmpty()) {
825 if (result != QLatin1String("const"))
826 return result;
827 result.clear();
828 }
829 }
830 return result;
831}
832
833/*!
834 Returns the thread safeness value for whatever this node
835 represents. But if this node has a parent and the thread
836 safeness value of the parent is the same as the thread
837 safeness value of this node, what is returned is the
838 value \c{UnspecifiedSafeness}. Why?
839 */
841{
842 if (m_parent && m_safeness == m_parent->inheritedThreadSafeness())
843 return UnspecifiedSafeness;
844 return m_safeness;
845}
846
847/*!
848 If this node has a parent, the parent's thread safeness
849 value is returned. Otherwise, this node's thread safeness
850 value is returned. Why?
851 */
853{
854 if (m_parent && m_safeness == UnspecifiedSafeness)
855 return m_parent->inheritedThreadSafeness();
856 return m_safeness;
857}
858
859/*!
860 Returns \c true if the node's status is \c Internal, or if
861 its parent is a class with \c Internal status.
862 */
863bool Node::isInternal() const
864{
866 return true;
868}
869
870/*! \fn void Node::markInternal()
871 Sets the node's access to Private and its status to Internal.
872 */
873
874/*!
875 Returns a pointer to the root of the Tree this node is in.
876 */
877Aggregate *Node::root() const
878{
879 if (parent() == nullptr)
880 return (this->isAggregate() ? static_cast<Aggregate *>(const_cast<Node *>(this)) : nullptr);
881 Aggregate *t = parent();
882 while (t->parent() != nullptr)
883 t = t->parent();
884 return t;
885}
886
887/*!
888 Returns a pointer to the Tree this node is in.
889 */
890Tree *Node::tree() const
891{
892 return root()->tree();
893}
894
895/*!
896 Sets the node's declaration location, its definition
897 location, or both, depending on the suffix of the file
898 name from the file path in location \a t.
899 */
900void Node::setLocation(const Location &t)
901{
902 QString suffix = t.fileSuffix();
903 if (suffix == "h")
904 m_declLocation = t;
905 else if (suffix == "cpp")
906 m_defLocation = t;
907 else {
908 m_declLocation = t;
909 m_defLocation = t;
910 }
911}
912
913/*!
914 Returns \c true if this node is considered to be
915 part of the API as per the InclusionPolicy retrieved
916 from configuration.
917*/
918bool Node::isInAPI() const
919{
920 const InclusionPolicy policy = Config::instance().createInclusionPolicy();
921 bool inPolicy = InclusionFilter::isIncluded(policy, this->createContext());
922
923 return inPolicy && !isDontDocument() && hasDoc();
924}
925
926/*!
927 Returns \c true if this node is documented, or it represents
928 a documented node read from the index ('had doc'), or this
929 node is sharing a non-empty doc with other nodes.
930
931 \sa Doc
932 */
933bool Node::hasDoc() const
934{
935 if (m_hadDoc)
936 return true;
937
938 if (!m_doc.isEmpty())
939 return true;
940
941 return (m_sharedCommentNode && m_sharedCommentNode->hasDoc());
942}
943
944/*!
945 Returns the CPP node's qualified name by prepending the
946 namespaces name + "::" if there isw a namespace.
947 */
949{
950 if (m_parent && m_parent->isNamespace() && !m_parent->name().isEmpty())
951 return m_parent->name() + "::" + m_name;
952 return m_name;
953}
954
955/*!
956 Return the name of this node qualified with the parent name
957 and "::" if there is a parent name.
958 */
960{
961 if (m_parent && !m_parent->name().isEmpty())
962 return m_parent->name() + "::" + m_name;
963 return m_name;
964}
965
966/*!
967 Returns the QML node's qualified name by prepending the logical
968 module name.
969 */
971{
972 return logicalModuleName() + "::" + m_name;
973}
974
975/*!
976 Returns \c true if the node is a class node or a QML type node
977 that is marked as being a wrapper class or wrapper QML type,
978 or if it is a member of a wrapper class or type.
979 */
980bool Node::isWrapper() const
981{
982 return m_parent != nullptr && m_parent->isWrapper();
983}
984
985/*!
986 Construct the full document name for this node and return it.
987 */
989{
990 QStringList pieces;
991 const Node *n = this;
992
993 do {
994 if (!n->name().isEmpty())
995 pieces.insert(0, n->name());
996
997 if (n->isQmlType() && !n->logicalModuleName().isEmpty()) {
998 pieces.insert(0, n->logicalModuleName());
999 break;
1000 }
1001
1002 if (n->isTextPageNode())
1003 break;
1004
1005 // Examine the parent if the node is a member
1007 break;
1008
1009 n = n->parent();
1010 } while (true);
1011
1012 // Create a name based on the type of the ancestor node.
1013 QString concatenator = "::";
1014 if (n->isQmlType())
1015 concatenator = QLatin1Char('.');
1016
1017 if (n->isTextPageNode())
1018 concatenator = QLatin1Char('#');
1019
1020 return pieces.join(concatenator);
1021}
1022
1023/*!
1024 Sets the Node status to Node::Deprecated, unless \a sinceVersion represents
1025 a future version.
1026
1027 Stores \a sinceVersion representing the version in which the deprecation
1028 took (or will take) place.
1029
1030 Fetches the current version from the config ('version' variable) as a
1031 string, and compared to \a sinceVersion. If both string represent a valid
1032 version and \a sinceVersion is greater than the currect version, do not
1033 mark the node as deprecated; leave it active.
1034*/
1035void Node::setDeprecated(const QString &sinceVersion)
1036{
1037
1038 if (!m_deprecatedSince.isEmpty())
1039 qCWarning(lcQdoc) << QStringLiteral(
1040 "Setting deprecated since version for %1 to %2 even though it "
1041 "was already set to %3. This is very unexpected.")
1042 .arg(this->m_name, sinceVersion, this->m_deprecatedSince);
1043 m_deprecatedSince = sinceVersion;
1044
1045 if (!sinceVersion.isEmpty()) {
1046 QVersionNumber since = QVersionNumber::fromString(sinceVersion).normalized();
1047 QVersionNumber current = QVersionNumber::fromString(
1048 Config::instance().get(CONFIG_VERSION).asString())
1049 .normalized();
1050 if (!current.isNull() && !since.isNull()) {
1051 if (current < since)
1052 return;
1053 }
1054 }
1056}
1057
1058/*! \fn Node *Node::clone(Aggregate *parent)
1059
1060 When reimplemented in a subclass, this function creates a
1061 clone of this node on the heap and makes the clone a child
1062 of \a parent. A pointer to the clone is returned.
1063
1064 Here in the base class, this function does nothing and returns
1065 nullptr.
1066 */
1067
1068/*! \fn NodeType Node::nodeType() const
1069 Returns this node's type.
1070
1071 \sa NodeType
1072*/
1073
1074/*! \fn Genus Node::genus() const
1075 Returns this node's Genus.
1076
1077 \sa Genus
1078*/
1079
1080/*! void Node::setGenus(Genus t)
1081 Sets this node's Genus to \a t.
1082*/
1083
1084/*! \fn QString Node::signature(Node::SignatureOptions options) const
1085
1086 Specific parts of the signature are included according to flags in
1087 \a options.
1088
1089 If this node is not a FunctionNode, this function returns plainName().
1090
1091 \sa FunctionNode::signature()
1092*/
1093
1094/*! \fn const QString &Node::fileNameBase() const
1095 Returns the node's file name base string, which is built once, when
1096 Generator::fileBase() is called and stored in the Node.
1097*/
1098
1099/*! \fn bool Node::hasFileNameBase() const
1100 Returns true if the node's file name base has been set.
1101
1102 \sa Node::fileNameBase()
1103*/
1104
1105/*! \fn void Node::setFileNameBase(const QString &t)
1106 Sets the node's file name base to \a t. Only called by
1107 Generator::fileBase().
1108*/
1109
1110/*! \fn void Node::setAccess(Access t)
1111 Sets the node's access type to \a t.
1112
1113 \sa Access
1114*/
1115
1116/*! \fn void Node::setThreadSafeness(ThreadSafeness t)
1117 Sets the node's thread safeness to \a t.
1118
1119 \sa ThreadSafeness
1120*/
1121
1122/*! \fn void Node::setPhysicalModuleName(const QString &name)
1123 Sets the node's physical module \a name.
1124*/
1125
1126/*! \fn void Node::setReconstitutedBrief(const QString &t)
1127 When reading an index file, this function is called with the
1128 reconstituted brief clause \a t to set the node's brief clause.
1129 I think this is needed for linking to something in the brief clause.
1130*/
1131
1132/*! \fn void Node::setParent(Aggregate *n)
1133 Sets the node's parent pointer to \a n. Such a thing
1134 is not lightly done. All the calls to this function
1135 are in other member functions of Node subclasses. See
1136 the code in the subclass implementations to understand
1137 when this function can be called safely and why it is called.
1138*/
1139
1140/*! \fn void Node::setIndexNodeFlag(bool isIndexNode = true)
1141 Sets a flag in this Node that indicates the node was created
1142 for something in an index file. This is important to know
1143 because an index node is not to be documented in the current
1144 module. When the index flag is set, it means the Node
1145 represents something in another module, and it will be
1146 documented in that module's documentation.
1147*/
1148
1149/*! \fn void Node::setRelatedNonmember(bool b)
1150 Sets a flag in the node indicating whether this node is a related nonmember
1151 of something. This function is called when the \c relates command is seen.
1152 */
1153
1154/*! \fn void Node::addMember(Node *node)
1155 In a CollectionNode, this function adds \a node to the collection
1156 node's members list. It does nothing if this node is not a CollectionNode.
1157 */
1158
1159/*! \fn bool Node::hasNamespaces() const
1160 Returns \c true if this is a CollectionNode and its members list
1161 contains namespace nodes. Otherwise it returns \c false.
1162 */
1163
1164/*! \fn bool Node::hasClasses() const
1165 Returns \c true if this is a CollectionNode and its members list
1166 contains class nodes. Otherwise it returns \c false.
1167 */
1168
1169/*! \fn void Node::setAbstract(bool b)
1170 If this node is a ClassNode or a QmlTypeNode, the node's abstract flag
1171 data member is set to \a b.
1172 */
1173
1174/*! \fn void Node::setWrapper()
1175 If this node is a ClassNode or a QmlTypeNode, the node's wrapper flag
1176 data member is set to \c true.
1177 */
1178
1179/*! \fn void Node::setDataType(const QString &dataType)
1180 If this node is a PropertyNode or a QmlPropertyNode, its
1181 data type data member is set to \a dataType. Otherwise,
1182 this function does nothing.
1183 */
1184
1185/*! \fn bool Node::wasSeen() const
1186 Returns the \c seen flag data member of this node if it is a NamespaceNode
1187 or a CollectionNode. Otherwise it returns \c false. If \c true is returned,
1188 it means that the location where the namespace or collection is to be
1189 documented has been found.
1190 */
1191
1192/*! \fn void appendGroupName(const QString &t)
1193 If this node is a PageNode, the group name \a t is appended to the node's
1194 list of group names. It is not clear to me what this list of group names
1195 is used for, but it is written to the index file, and it is used in the
1196 navigation bar.
1197 */
1198
1199/*! \fn QString Node::element() const
1200 If this node is a QmlPropertyNode or a FunctionNode, this function
1201 returns the name of the parent node. Otherwise it returns an empty
1202 string.
1203 */
1204
1205/*! \fn bool Node::docMustBeGenerated() const
1206 This function is called to perform a test to decide if the node must have
1207 documentation generated. In the Node base class, it always returns \c false.
1208
1209 In the ProxyNode class it always returns \c true. There aren't many proxy
1210 nodes, but when one appears, it must generate documentation. In the overrides
1211 in NamespaceNode and ClassNode, a meaningful test is performed to decide if
1212 documentation must be generated.
1213 */
1214
1215/*! \fn QString Node::title() const
1216 Returns a string that can be used to print a title in the documentation for
1217 whatever this Node is. In the Node base class, the node's name() is returned.
1218 In a PageNode, the function returns the title data member. In a HeaderNode,
1219 if the title() is empty, the name() is returned.
1220 */
1221
1222/*! \fn QString Node::subtitle() const { return QString(); }
1223 Returns a string that can be used to print a subtitle in the documentation for
1224 whatever this Node is. In the Node base class, the empty string is returned.
1225 In a PageNode, the function returns the subtitle data member. In a HeaderNode,
1226 the subtitle data member is returned.
1227 */
1228
1229/*! \fn QString Node::fullTitle() const
1230 Returns a string that can be used as the full title for the documentation of
1231 this node. In this base class, the name() is returned. In a PageNode, title()
1232 is returned. In a HeaderNode, if the title() is empty, the name() is returned.
1233 If the title() is not empty then name-title is returned. In a CollectionNode,
1234 the title() is returned.
1235 */
1236
1237/*! \fn bool Node::setTitle(const QString &title)
1238 Sets the node's \a title, which is used for the title of
1239 the documentation page, if one is generated for this node.
1240 Returns \c true if the title is set. In this base class,
1241 there is no title string stored, so in the base class,
1242 nothing happens and \c false is returned. The override in
1243 the PageNode class is where the title is set.
1244 */
1245
1246/*! \fn bool Node::setSubtitle(const QString &subtitle)
1247 Sets the node's \a subtitle, which is used for the subtitle
1248 of the documentation page, if one is generated for this node.
1249 Returns \c true if the subtitle is set. In this base class,
1250 there is no subtitle string stored, so in the base class,
1251 nothing happens and \c false is returned. The override in
1252 the PageNode and HeaderNode classes is where the subtitle is
1253 set.
1254 */
1255
1256/*! \fn void Node::markDefault()
1257 If this node is a QmlPropertyNode, it is marked as the default property.
1258 Otherwise the function does nothing.
1259 */
1260
1261/*! \fn void Node::markReadOnly(bool flag)
1262 If this node is a QmlPropertyNode, then the property's read-only
1263 flag is set to \a flag.
1264 */
1265
1266/*! \fn Aggregate *Node::parent() const
1267 Returns the node's parent pointer.
1268*/
1269
1270/*! \fn const QString &Node::name() const
1271 Returns the node's name data member.
1272*/
1273
1274/*! \fn void Node::setQtVariable(const QString &v)
1275 If this node is a CollectionNode, its QT variable is set to \a v.
1276 Otherwise the function does nothing. I don't know what the QT variable
1277 is used for.
1278 */
1279
1280/*! \fn QString Node::qtVariable() const
1281 If this node is a CollectionNode, its QT variable is returned.
1282 Otherwise an empty string is returned. I don't know what the QT
1283 variable is used for.
1284 */
1285
1286/*! \fn bool Node::hasTag(const QString &t) const
1287 If this node is a FunctionNode, the function returns \c true if
1288 the function has the tag \a t. Otherwise the function returns
1289 \c false. I don't know what the tag is used for.
1290 */
1291
1292/*! \fn const QMap<LinkType, std::pair<QString, QString> > &Node::links() const
1293 Returns a reference to this node's link map. The link map should
1294 probably be moved to the PageNode, because it contains links to the
1295 start page, next page, previous page, and contents page, and these
1296 are only used in PageNode, I think.
1297 */
1298
1299/*! \fn Access Node::access() const
1300 Returns the node's Access setting, which can be \c Public,
1301 \c Protected, or \c Private.
1302 */
1303
1304/*! \fn const Location& Node::declLocation() const
1305 Returns the Location where this node's declaration was seen.
1306 Normally the declaration location is in an \e include file.
1307 The declaration location is used in qdoc error/warning messages
1308 about the declaration.
1309 */
1310
1311/*! \fn const Location& Node::defLocation() const
1312 Returns the Location where this node's dedefinition was seen.
1313 Normally the definition location is in a \e .cpp file.
1314 The definition location is used in qdoc error/warning messages
1315 when the error is discovered at the location of the definition,
1316 although the way to correct the problem often requires changing
1317 the declaration.
1318 */
1319
1320/*! \fn const Location& Node::location() const
1321 If this node's definition location is empty, this function
1322 returns this node's declaration location. Otherwise it
1323 returns the definition location.
1324
1325 \sa Location
1326 */
1327
1328/*! \fn const Doc &Node::doc() const
1329 Returns a reference to the node's Doc data member.
1330
1331 \sa Doc
1332 */
1333
1334/*! \fn Status Node::status() const
1335 Returns the node's status value.
1336
1337 \sa Status
1338 */
1339
1340/*! \fn QString Node::since() const
1341 Returns the node's since string, which can be empty.
1342 */
1343
1344/*! \fn QString Node::templateStuff() const
1345 Returns the node's template parameters string, if this node
1346 represents a templated element.
1347 */
1348
1349/*! \fn bool Node::isSharingComment() const
1350 This function returns \c true if the node is sharing a comment
1351 with other nodes. For example, multiple functions can be documented
1352 with a single qdoc comment by listing the \c {\\fn} signatures for
1353 all the functions in the single qdoc comment.
1354 */
1355
1356/*! \fn QString Node::qmlTypeName() const
1357 If this is a QmlPropertyNode or a FunctionNode representing a QML
1358 method, this function returns the qmlTypeName() of
1359 the parent() node. Otherwise it returns the name data member.
1360 */
1361
1362/*! \fn QString Node::qmlFullBaseName() const
1363 If this is a QmlTypeNode, this function returns the QML full
1364 base name. Otherwise it returns an empty string.
1365 */
1366
1367/*! \fn QString Node::logicalModuleName() const
1368 If this is a CollectionNode, this function returns the logical
1369 module name. Otherwise it returns an empty string.
1370 */
1371
1372/*! \fn QString Node::logicalModuleVersion() const
1373 If this is a CollectionNode, this function returns the logical
1374 module version number. Otherwise it returns an empty string.
1375 */
1376
1377/*! \fn QString Node::logicalModuleIdentifier() const
1378 If this is a CollectionNode, this function returns the logical
1379 module identifier. Otherwise it returns an empty string.
1380 */
1381
1382/*! \fn void Node::setLogicalModuleInfo(const QString &arg)
1383 If this node is a CollectionNode, this function splits \a arg
1384 on the blank character to get a logical module name and version
1385 number. If the version number is present, it splits the version
1386 number on the '.' character to get a major version number and a
1387 minor version number. If the version number is present, both the
1388 major and minor version numbers should be there, but the minor
1389 version number is not absolutely necessary.
1390
1391 The strings are stored in the appropriate data members for use
1392 when the QML module page is generated.
1393 */
1394
1395/*! \fn void Node::setLogicalModuleInfo(const QStringList &info)
1396 If this node is a CollectionNode, this function accepts the
1397 logical module \a info as a string list. If the logical module
1398 info contains the version number, it splits the version number
1399 on the '.' character to get the major and minor version numbers.
1400 Both major and minor version numbers should be provided, but
1401 the minor version number is not strictly necessary.
1402
1403 The strings are stored in the appropriate data members for use
1404 when the QML module page is generated. This overload
1405 of the function is called when qdoc is reading an index file.
1406 */
1407
1408/*! \fn CollectionNode *Node::logicalModule() const
1409 If this is a QmlTypeNode, a pointer to its QML module is returned,
1410 which is a pointer to a CollectionNode. Otherwise the \c nullptr
1411 is returned.
1412 */
1413
1414/*! \fn void Node::setQmlModule(CollectionNode *t)
1415 If this is a QmlTypeNode, this function sets the QML type's QML module
1416 pointer to the CollectionNode \a t. Otherwise the function does nothing.
1417 */
1418
1419/*! \fn ClassNode *Node::classNode()
1420 If this is a QmlTypeNode, this function returns the pointer to
1421 the C++ ClassNode that this QML type represents. Otherwise the
1422 \c nullptr is returned.
1423 */
1424
1425/*! \fn void Node::setClassNode(ClassNode *cn)
1426 If this is a QmlTypeNode, this function sets the C++ class node
1427 to \a cn. The C++ ClassNode is the C++ implementation of the QML
1428 type.
1429 */
1430
1431/*! \fn NodeType Node::goal(const QString &t)
1432 When a square-bracket parameter is used in a qdoc command, this
1433 function might be called to convert the text string \a t obtained
1434 from inside the square brackets to be a Goal value, which is returned.
1435
1436 \sa Goal
1437 */
1438
1439QT_END_NAMESPACE
void addChild(Node *child)
Adds the child to this node's child list and sets the child's parent pointer to this Aggregate.
Definition doc.h:32
const Location & location() const
Returns the starting location of a qdoc comment.
Definition doc.cpp:89
Doc & operator=(const Doc &doc)
Definition doc.cpp:74
bool isMarkedReimp() const
Returns true if the set of metacommands used in the doc comment contains {reimp}.
Definition doc.cpp:233
bool isAutoGenerated() const
Returns true if this documentation was auto-generated by QDoc rather than written by an author.
Definition doc.cpp:242
QStringMultiMap * metaTagMap() const
Definition doc.cpp:340
bool isEmpty() const
Definition doc.cpp:109
static bool processInternalDocs(const InclusionPolicy &policy)
static bool isIncluded(const InclusionPolicy &policy, const NodeContext &context)
The Location class provides a way to mark a location in a file.
Definition location.h:20
int lineNo() const
Returns the current line number.
Definition location.h:50
Status
Specifies the status of the QQmlIncubator.
This class constructs and maintains a tree of instances of the subclasses of Node.
Definition tree.h:58
#define CONFIG_VERSION
Definition config.h:449
#define CONFIG_IGNORESINCE
Definition config.h:396
NodeType
Definition genustypes.h:150
@ SharedComment
Definition genustypes.h:173
Combined button and popup list for selecting options.
#define LT_RETURN_IF_NOT_EQUAL(a, b)
Definition node.cpp:56
#define LT_RETURN_IF_NOT_EQUAL_QSTR(a, b)
Definition node.cpp:61
@ Deprecated
Definition status.h:12
@ Internal
Definition status.h:15
bool isInternal
Definition nodecontext.h:18
bool isPureVirtual
Definition nodecontext.h:19
NodeType type
Definition nodecontext.h:16
bool hasAutoGeneratedDoc
Definition nodecontext.h:20
The Node class is the base class for all the nodes in QDoc's parse tree.
bool isDontDocument() const
Returns true if this node's status is DontDocument.
Definition node.h:92
virtual QString plainName() const
Returns this node's name member.
Definition node.cpp:481
const Doc & doc() const
Returns a reference to the node's Doc data member.
Definition node.h:235
void setGenus(Genus t)
Definition node.h:86
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:980
bool isPrivate() const
Returns true if this node's access is Private.
Definition node.h:111
virtual bool isAbstract() const
Returns true if the ClassNode or QmlTypeNode is marked abstract.
Definition node.h:135
QString nodeTypeString() const
Returns this node's type as a string for use as an attribute value in XML or HTML.
Definition node.cpp:678
bool isQmlType() const
Returns true if the node type is QmlType or QmlValueType.
Definition node.h:121
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:863
bool isHeader() const
Returns true if the node type is HeaderFile.
Definition node.h:105
NodeType nodeType() const override
Returns this node's type.
Definition node.h:82
virtual bool isPageNode() const
Returns true if this node represents something that generates a documentation page.
Definition node.h:148
virtual Status status() const
Returns the node's status value.
Definition node.h:239
virtual bool isTextPageNode() const
Returns true if the node is a PageNode but not an Aggregate.
Definition node.h:153
Aggregate * parent() const
Returns the node's parent pointer.
Definition node.h:208
static bool fromFlagValue(FlagValue fv, bool defaultValue)
Converts the enum fv back to a boolean value.
Definition node.cpp:762
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:900
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:495
FlagValue
A value used in PropertyNode and QmlPropertyNode that can be -1, 0, or +1.
Definition node.h:75
@ FlagValueTrue
Definition node.h:75
@ FlagValueFalse
Definition node.h:75
QString qualifyQmlName()
Returns the QML node's qualified name by prepending the logical module name.
Definition node.cpp:970
static bool nodeNameLessThan(const Node *first, const Node *second)
Returns true if the node n1 is less than node n2.
Definition node.cpp:111
QString qualifyCppName()
Returns the CPP node's qualified name by prepending the namespaces name + "::" if there isw a namespa...
Definition node.cpp:948
ThreadSafeness inheritedThreadSafeness() const
If this node has a parent, the parent's thread safeness value is returned.
Definition node.cpp:852
const Location & location() const
If this node's definition location is empty, this function returns this node's declaration location.
Definition node.h:231
Access access() const
Returns the node's Access setting, which can be Public, Protected, or Private.
Definition node.h:228
bool isFunction(Genus g=Genus::DontCare) const
Returns true if this is a FunctionNode and its Genus is set to g.
Definition node.h:100
ThreadSafeness threadSafeness() const
Returns the thread safeness value for whatever this node represents.
Definition node.cpp:840
Aggregate * root() const
virtual bool isInAPI() const
Returns true if this node is considered to be part of the API as per the InclusionPolicy retrieved fr...
Definition node.cpp:918
QString fullDocumentName() const
Construct the full document name for this node and return it.
Definition node.cpp:988
virtual Tree * tree() const
Returns a pointer to the Tree this node is in.
Definition node.cpp:890
NodeContext createContext() const
Definition node.cpp:175
void setDoc(const Doc &doc, bool replace=false)
Sets this Node's Doc to doc.
Definition node.cpp:557
Node(NodeType type, Aggregate *parent, QString name)
Construct a node with the given type and having the given parent and name.
Definition node.cpp:597
ThreadSafeness
An unsigned char that specifies the degree of thread-safeness of the element.
Definition node.h:58
@ UnspecifiedSafeness
Definition node.h:59
QString fullName(const Node *relative) const
Constructs and returns this node's full name.
Definition node.cpp:541
virtual bool isPureVirtual() const
Definition node.h:116
bool hasDoc() const
Returns true if this node is documented, or it represents a documented node read from the index ('had...
Definition node.cpp:933
static Genus getGenus(NodeType t)
Determines the appropriate Genus value for the NodeType value t and returns that Genus value.
Definition node.cpp:620
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:751
bool isRelatedNonmember() const
Returns true if this is a related nonmember of something.
Definition node.h:122
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:792
virtual void setStatus(Status t)
Sets the node's status to t.
Definition node.cpp:571
QString extractClassName(const QString &string) const
Extract a class name from the type string and return it.
Definition node.cpp:812
void setDeprecated(const QString &sinceVersion)
Sets the Node status to Node::Deprecated, unless sinceVersion represents a future version.
Definition node.cpp:1035
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:161
@ SignatureReturnType
Definition node.h:68
@ SignaturePlain
Definition node.h:66
static bool nodeNameOverloadLessThan(const Node *first, const Node *second)
Definition node.cpp:136
QString qualifyWithParentName()
Return the name of this node qualified with the parent name and "::" if there is a parent name.
Definition node.cpp:959
QString plainSignature() const
Constructs and returns the node's fully qualified signature by recursively ascending the parent links...
Definition node.cpp:519
static bool nodeLessThan(const Node *first, const Node *second)
Returns true if the node n1 is less than node n2.
Definition node.cpp:79