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