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:
639 return Genus::CPP;
645 return Genus::QML;
646 case NodeType::Page:
647 case NodeType::Group:
650 return Genus::DOC;
653 case NodeType::Proxy:
654 default:
655 return Genus::DontCare;
656 }
657}
658
659/*! \fn QString Node::url() const
660 Returns the node's URL, which is the url of the documentation page
661 created for the node or the url of an external page if the node is
662 an ExternalPageNode. The url is used for generating a link to the
663 page the node represents.
664
665 \sa Node::setUrl()
666 */
667
668/*! \fn void Node::setUrl(const QString &url)
669 Sets the node's URL to \a url, which is the url to the page that the
670 node represents. This function is only called when an index file is
671 read. In other words, a node's url is set when qdoc decides where its
672 page will be and what its name will be, which happens when qdoc writes
673 the index file for the module being documented.
674
675 \sa QDocIndexFiles
676 */
677
678/*!
679 Returns this node's type as a string for use as an
680 attribute value in XML or HTML.
681 */
683{
684 if (isFunction()) {
685 const auto *fn = static_cast<const FunctionNode *>(this);
686 return fn->kindString();
687 }
688 return nodeTypeString(nodeType());
689}
690
691/*!
692 Returns the node type \a t as a string for use as an
693 attribute value in XML or HTML.
694 */
695QString Node::nodeTypeString(NodeType t)
696{
697 switch (t) {
699 return QLatin1String("namespace");
700 case NodeType::Class:
701 return QLatin1String("class");
702 case NodeType::Struct:
703 return QLatin1String("struct");
704 case NodeType::Union:
705 return QLatin1String("union");
707 return QLatin1String("header");
708 case NodeType::Page:
709 return QLatin1String("page");
710 case NodeType::Enum:
711 return QLatin1String("enum");
713 return QLatin1String("example");
715 return QLatin1String("external page");
718 return QLatin1String("typedef");
720 return QLatin1String("function");
722 return QLatin1String("property");
723 case NodeType::Proxy:
724 return QLatin1String("proxy");
726 return QLatin1String("variable");
727 case NodeType::Group:
728 return QLatin1String("group");
729 case NodeType::Module:
730 return QLatin1String("module");
732 return QLatin1String("enumeration");
734 return QLatin1String("QML type");
736 return QLatin1String("QML value type");
738 return QLatin1String("QML module");
740 return QLatin1String("QML property");
741
743 return QLatin1String("shared comment");
745 return QLatin1String("collection");
746 default:
747 break;
748 }
749 return QString();
750}
751
752/*! Converts the boolean value \a b to an enum representation
753 of the boolean type, which includes an enum value for the
754 \e {default value} of the item, i.e. true, false, or default.
755 */
757{
758 return b ? FlagValueTrue : FlagValueFalse;
759}
760
761/*!
762 Converts the enum \a fv back to a boolean value.
763 If \a fv is neither the true enum value nor the
764 false enum value, the boolean value returned is
765 \a defaultValue.
766 */
767bool Node::fromFlagValue(FlagValue fv, bool defaultValue)
768{
769 switch (fv) {
770 case FlagValueTrue:
771 return true;
772 case FlagValueFalse:
773 return false;
774 default:
775 return defaultValue;
776 }
777}
778
779/*!
780 This function creates a pair that describes a link.
781 The pair is composed from \a link and \a desc. The
782 \a linkType is the map index the pair is filed under.
783 */
784void Node::setLink(LinkType linkType, const QString &link, const QString &desc)
785{
786 std::pair<QString, QString> linkPair;
787 linkPair.first = std::move(link);
788 linkPair.second = std::move(desc);
789 m_linkMap[linkType] = std::move(linkPair);
790}
791
792/*!
793 Sets the information about the project and version a node was introduced
794 in, unless the version is lower than the 'ignoresince.<project>'
795 configuration variable.
796 */
797void Node::setSince(const QString &since)
798{
799 QStringList parts = since.split(QLatin1Char(' '));
800 QString project;
801 if (parts.size() > 1)
802 project = Config::dot + parts.first();
803
804 QVersionNumber cutoff =
805 QVersionNumber::fromString(Config::instance().get(CONFIG_IGNORESINCE + project).asString())
806 .normalized();
807
808 if (!cutoff.isNull() && QVersionNumber::fromString(parts.last()).normalized() < cutoff)
809 return;
810
811 m_since = parts.join(QLatin1Char(' '));
812}
813
814/*!
815 Extract a class name from the type \a string and return it.
816 */
817QString Node::extractClassName(const QString &string) const
818{
819 QString result;
820 for (int i = 0; i <= string.size(); ++i) {
821 QChar ch;
822 if (i != string.size())
823 ch = string.at(i);
824
825 QChar lower = ch.toLower();
826 if ((lower >= QLatin1Char('a') && lower <= QLatin1Char('z')) || ch.digitValue() >= 0
827 || ch == QLatin1Char('_') || ch == QLatin1Char(':')) {
828 result += ch;
829 } else if (!result.isEmpty()) {
830 if (result != QLatin1String("const"))
831 return result;
832 result.clear();
833 }
834 }
835 return result;
836}
837
838/*!
839 Returns the thread safeness value for whatever this node
840 represents. But if this node has a parent and the thread
841 safeness value of the parent is the same as the thread
842 safeness value of this node, what is returned is the
843 value \c{UnspecifiedSafeness}. Why?
844 */
846{
847 if (m_parent && m_safeness == m_parent->inheritedThreadSafeness())
848 return UnspecifiedSafeness;
849 return m_safeness;
850}
851
852/*!
853 If this node has a parent, the parent's thread safeness
854 value is returned. Otherwise, this node's thread safeness
855 value is returned. Why?
856 */
858{
859 if (m_parent && m_safeness == UnspecifiedSafeness)
860 return m_parent->inheritedThreadSafeness();
861 return m_safeness;
862}
863
864/*!
865 Returns \c true if the node's status is \c Internal, or if
866 its parent is a class with \c Internal status.
867 */
868bool Node::isInternal() const
869{
871 return true;
872 if (parent() && !parent()->isAbstract()) {
873 const Status parentStatus = parent()->status();
874 return parentStatus == Status::Internal || parentStatus == Status::InternalAuto;
875 }
876 return false;
877}
878
879/*! \fn void Node::markInternal()
880 Sets the node's access to Private and its status to Internal.
881 */
882
883/*!
884 Returns a pointer to the root of the Tree this node is in.
885 */
886Aggregate *Node::root() const
887{
888 if (parent() == nullptr)
889 return (this->isAggregate() ? static_cast<Aggregate *>(const_cast<Node *>(this)) : nullptr);
890 Aggregate *t = parent();
891 while (t->parent() != nullptr)
892 t = t->parent();
893 return t;
894}
895
896/*!
897 Returns a pointer to the Tree this node is in.
898 */
899Tree *Node::tree() const
900{
901 return root()->tree();
902}
903
904/*!
905 Sets the node's declaration location, its definition
906 location, or both, depending on the suffix of the file
907 name from the file path in location \a t.
908 */
909void Node::setLocation(const Location &t)
910{
911 QString suffix = t.fileSuffix();
912 if (suffix == "h")
913 m_declLocation = t;
914 else if (suffix == "cpp")
915 m_defLocation = t;
916 else {
917 m_declLocation = t;
918 m_defLocation = t;
919 }
920}
921
922/*!
923 Returns \c true if this node is considered to be
924 part of the API as per the InclusionPolicy retrieved
925 from configuration.
926*/
927bool Node::isInAPI() const
928{
929 const InclusionPolicy policy = Config::instance().createInclusionPolicy();
930 bool inPolicy = InclusionFilter::isIncluded(policy, this->createContext());
931
932 return inPolicy && !isDontDocument() && hasDoc();
933}
934
935/*!
936 Returns \c true if this node is documented, or it represents
937 a documented node read from the index ('had doc'), or this
938 node is sharing a non-empty doc with other nodes.
939
940 \sa Doc
941 */
942bool Node::hasDoc() const
943{
944 if (m_hadDoc)
945 return true;
946
947 if (!m_doc.isEmpty())
948 return true;
949
950 return (m_sharedCommentNode && m_sharedCommentNode->hasDoc());
951}
952
953/*!
954 Returns the CPP node's qualified name by prepending the
955 namespaces name + "::" if there isw a namespace.
956 */
958{
959 if (m_parent && m_parent->isNamespace() && !m_parent->name().isEmpty())
960 return m_parent->name() + "::" + m_name;
961 return m_name;
962}
963
964/*!
965 Return the name of this node qualified with the parent name
966 and "::" if there is a parent name.
967 */
969{
970 if (m_parent && !m_parent->name().isEmpty())
971 return m_parent->name() + "::" + m_name;
972 return m_name;
973}
974
975/*!
976 Returns the QML node's qualified name by prepending the logical
977 module name.
978 */
980{
981 return logicalModuleName() + "::" + m_name;
982}
983
984/*!
985 Returns \c true if the node is a class node or a QML type node
986 that is marked as being a wrapper class or wrapper QML type,
987 or if it is a member of a wrapper class or type.
988 */
989bool Node::isWrapper() const
990{
991 return m_parent != nullptr && m_parent->isWrapper();
992}
993
994/*!
995 Construct the full document name for this node and return it.
996 */
998{
999 QStringList pieces;
1000 const Node *n = this;
1001
1002 do {
1003 if (!n->name().isEmpty())
1004 pieces.insert(0, n->name());
1005
1006 if (n->isQmlType() && !n->logicalModuleName().isEmpty()) {
1007 pieces.insert(0, n->logicalModuleName());
1008 break;
1009 }
1010
1011 if (n->isTextPageNode())
1012 break;
1013
1014 // Examine the parent if the node is a member
1016 break;
1017
1018 n = n->parent();
1019 } while (true);
1020
1021 // Create a name based on the type of the ancestor node.
1022 QString concatenator = "::";
1023 if (n->isQmlType())
1024 concatenator = QLatin1Char('.');
1025
1026 if (n->isTextPageNode())
1027 concatenator = QLatin1Char('#');
1028
1029 return pieces.join(concatenator);
1030}
1031
1032/*!
1033 Sets the Node status to Node::Deprecated, unless \a sinceVersion represents
1034 a future version.
1035
1036 Stores \a sinceVersion representing the version in which the deprecation
1037 took (or will take) place.
1038
1039 Fetches the current version from the config ('version' variable) as a
1040 string, and compared to \a sinceVersion. If both string represent a valid
1041 version and \a sinceVersion is greater than the currect version, do not
1042 mark the node as deprecated; leave it active.
1043*/
1044void Node::setDeprecated(const QString &sinceVersion)
1045{
1046
1047 if (!m_deprecatedSince.isEmpty())
1048 qCWarning(lcQdoc) << QStringLiteral(
1049 "Setting deprecated since version for %1 to %2 even though it "
1050 "was already set to %3. This is very unexpected.")
1051 .arg(this->m_name, sinceVersion, this->m_deprecatedSince);
1052 m_deprecatedSince = sinceVersion;
1053
1054 if (!sinceVersion.isEmpty()) {
1055 QVersionNumber since = QVersionNumber::fromString(sinceVersion).normalized();
1056 QVersionNumber current = QVersionNumber::fromString(
1057 Config::instance().get(CONFIG_VERSION).asString())
1058 .normalized();
1059 if (!current.isNull() && !since.isNull()) {
1060 if (current < since)
1061 return;
1062 }
1063 }
1065}
1066
1067/*! \fn Node *Node::clone(Aggregate *parent)
1068
1069 When reimplemented in a subclass, this function creates a
1070 clone of this node on the heap and makes the clone a child
1071 of \a parent. A pointer to the clone is returned.
1072
1073 Here in the base class, this function does nothing and returns
1074 nullptr.
1075 */
1076
1077/*! \fn NodeType Node::nodeType() const
1078 Returns this node's type.
1079
1080 \sa NodeType
1081*/
1082
1083/*! \fn Genus Node::genus() const
1084 Returns this node's Genus.
1085
1086 \sa Genus
1087*/
1088
1089/*! void Node::setGenus(Genus t)
1090 Sets this node's Genus to \a t.
1091*/
1092
1093/*! \fn QString Node::signature(Node::SignatureOptions options) const
1094
1095 Specific parts of the signature are included according to flags in
1096 \a options.
1097
1098 If this node is not a FunctionNode, this function returns plainName().
1099
1100 \sa FunctionNode::signature()
1101*/
1102
1103/*! \fn const QString &Node::fileNameBase() const
1104 Returns the node's file name base string, which is built once, when
1105 Generator::fileBase() is called and stored in the Node.
1106*/
1107
1108/*! \fn bool Node::hasFileNameBase() const
1109 Returns true if the node's file name base has been set.
1110
1111 \sa Node::fileNameBase()
1112*/
1113
1114/*! \fn void Node::setFileNameBase(const QString &t)
1115 Sets the node's file name base to \a t. Only called by
1116 Generator::fileBase().
1117*/
1118
1119/*! \fn void Node::setAccess(Access t)
1120 Sets the node's access type to \a t.
1121
1122 \sa Access
1123*/
1124
1125/*! \fn void Node::setThreadSafeness(ThreadSafeness t)
1126 Sets the node's thread safeness to \a t.
1127
1128 \sa ThreadSafeness
1129*/
1130
1131/*! \fn void Node::setPhysicalModuleName(const QString &name)
1132 Sets the node's physical module \a name.
1133*/
1134
1135/*! \fn void Node::setReconstitutedBrief(const QString &t)
1136 When reading an index file, this function is called with the
1137 reconstituted brief clause \a t to set the node's brief clause.
1138 I think this is needed for linking to something in the brief clause.
1139*/
1140
1141/*! \fn void Node::setParent(Aggregate *n)
1142 Sets the node's parent pointer to \a n. Such a thing
1143 is not lightly done. All the calls to this function
1144 are in other member functions of Node subclasses. See
1145 the code in the subclass implementations to understand
1146 when this function can be called safely and why it is called.
1147*/
1148
1149/*! \fn void Node::setIndexNodeFlag(bool isIndexNode = true)
1150 Sets a flag in this Node that indicates the node was created
1151 for something in an index file. This is important to know
1152 because an index node is not to be documented in the current
1153 module. When the index flag is set, it means the Node
1154 represents something in another module, and it will be
1155 documented in that module's documentation.
1156*/
1157
1158/*! \fn void Node::setRelatedNonmember(bool b)
1159 Sets a flag in the node indicating whether this node is a related nonmember
1160 of something. This function is called when the \c relates command is seen.
1161 */
1162
1163/*! \fn void Node::addMember(Node *node)
1164 In a CollectionNode, this function adds \a node to the collection
1165 node's members list. It does nothing if this node is not a CollectionNode.
1166 */
1167
1168/*! \fn bool Node::hasNamespaces() const
1169 Returns \c true if this is a CollectionNode and its members list
1170 contains namespace nodes. Otherwise it returns \c false.
1171 */
1172
1173/*! \fn bool Node::hasClasses() const
1174 Returns \c true if this is a CollectionNode and its members list
1175 contains class nodes. Otherwise it returns \c false.
1176 */
1177
1178/*! \fn void Node::setAbstract(bool b)
1179 If this node is a ClassNode or a QmlTypeNode, the node's abstract flag
1180 data member is set to \a b.
1181 */
1182
1183/*! \fn void Node::setWrapper()
1184 If this node is a ClassNode or a QmlTypeNode, the node's wrapper flag
1185 data member is set to \c true.
1186 */
1187
1188/*! \fn void Node::setDataType(const QString &dataType)
1189 If this node is a PropertyNode or a QmlPropertyNode, its
1190 data type data member is set to \a dataType. Otherwise,
1191 this function does nothing.
1192 */
1193
1194/*! \fn bool Node::wasSeen() const
1195 Returns the \c seen flag data member of this node if it is a NamespaceNode
1196 or a CollectionNode. Otherwise it returns \c false. If \c true is returned,
1197 it means that the location where the namespace or collection is to be
1198 documented has been found.
1199 */
1200
1201/*! \fn void appendGroupName(const QString &t)
1202 If this node is a PageNode, the group name \a t is appended to the node's
1203 list of group names. It is not clear to me what this list of group names
1204 is used for, but it is written to the index file, and it is used in the
1205 navigation bar.
1206 */
1207
1208/*! \fn QString Node::element() const
1209 If this node is a QmlPropertyNode or a FunctionNode, this function
1210 returns the name of the parent node. Otherwise it returns an empty
1211 string.
1212 */
1213
1214/*! \fn bool Node::docMustBeGenerated() const
1215 This function is called to perform a test to decide if the node must have
1216 documentation generated. In the Node base class, it always returns \c false.
1217
1218 In the ProxyNode class it always returns \c true. There aren't many proxy
1219 nodes, but when one appears, it must generate documentation. In the overrides
1220 in NamespaceNode and ClassNode, a meaningful test is performed to decide if
1221 documentation must be generated.
1222 */
1223
1224/*! \fn QString Node::title() const
1225 Returns a string that can be used to print a title in the documentation for
1226 whatever this Node is. In the Node base class, the node's name() is returned.
1227 In a PageNode, the function returns the title data member. In a HeaderNode,
1228 if the title() is empty, the name() is returned.
1229 */
1230
1231/*! \fn QString Node::subtitle() const { return QString(); }
1232 Returns a string that can be used to print a subtitle in the documentation for
1233 whatever this Node is. In the Node base class, the empty string is returned.
1234 In a PageNode, the function returns the subtitle data member. In a HeaderNode,
1235 the subtitle data member is returned.
1236 */
1237
1238/*! \fn QString Node::fullTitle() const
1239 Returns a string that can be used as the full title for the documentation of
1240 this node. In this base class, the name() is returned. In a PageNode, title()
1241 is returned. In a HeaderNode, if the title() is empty, the name() is returned.
1242 If the title() is not empty then name-title is returned. In a CollectionNode,
1243 the title() is returned.
1244 */
1245
1246/*! \fn bool Node::setTitle(const QString &title)
1247 Sets the node's \a title, which is used for the title of
1248 the documentation page, if one is generated for this node.
1249 Returns \c true if the title is set. In this base class,
1250 there is no title string stored, so in the base class,
1251 nothing happens and \c false is returned. The override in
1252 the PageNode class is where the title is set.
1253 */
1254
1255/*! \fn bool Node::setSubtitle(const QString &subtitle)
1256 Sets the node's \a subtitle, which is used for the subtitle
1257 of the documentation page, if one is generated for this node.
1258 Returns \c true if the subtitle is set. In this base class,
1259 there is no subtitle string stored, so in the base class,
1260 nothing happens and \c false is returned. The override in
1261 the PageNode and HeaderNode classes is where the subtitle is
1262 set.
1263 */
1264
1265/*! \fn void Node::markDefault()
1266 If this node is a QmlPropertyNode, it is marked as the default property.
1267 Otherwise the function does nothing.
1268 */
1269
1270/*! \fn void Node::markReadOnly(bool flag)
1271 If this node is a QmlPropertyNode, then the property's read-only
1272 flag is set to \a flag.
1273 */
1274
1275/*! \fn Aggregate *Node::parent() const
1276 Returns the node's parent pointer.
1277*/
1278
1279/*! \fn const QString &Node::name() const
1280 Returns the node's name data member.
1281*/
1282
1283/*! \fn void Node::setQtVariable(const QString &v)
1284 If this node is a CollectionNode, its QT variable is set to \a v.
1285 Otherwise the function does nothing. I don't know what the QT variable
1286 is used for.
1287 */
1288
1289/*! \fn QString Node::qtVariable() const
1290 If this node is a CollectionNode, its QT variable is returned.
1291 Otherwise an empty string is returned. I don't know what the QT
1292 variable is used for.
1293 */
1294
1295/*! \fn bool Node::hasTag(const QString &t) const
1296 If this node is a FunctionNode, the function returns \c true if
1297 the function has the tag \a t. Otherwise the function returns
1298 \c false. I don't know what the tag is used for.
1299 */
1300
1301/*! \fn const QMap<LinkType, std::pair<QString, QString> > &Node::links() const
1302 Returns a reference to this node's link map. The link map should
1303 probably be moved to the PageNode, because it contains links to the
1304 start page, next page, previous page, and contents page, and these
1305 are only used in PageNode, I think.
1306 */
1307
1308/*! \fn Access Node::access() const
1309 Returns the node's Access setting, which can be \c Public,
1310 \c Protected, or \c Private.
1311 */
1312
1313/*! \fn const Location& Node::declLocation() const
1314 Returns the Location where this node's declaration was seen.
1315 Normally the declaration location is in an \e include file.
1316 The declaration location is used in qdoc error/warning messages
1317 about the declaration.
1318 */
1319
1320/*! \fn const Location& Node::defLocation() const
1321 Returns the Location where this node's dedefinition was seen.
1322 Normally the definition location is in a \e .cpp file.
1323 The definition location is used in qdoc error/warning messages
1324 when the error is discovered at the location of the definition,
1325 although the way to correct the problem often requires changing
1326 the declaration.
1327 */
1328
1329/*! \fn const Location& Node::location() const
1330 If this node's definition location is empty, this function
1331 returns this node's declaration location. Otherwise it
1332 returns the definition location.
1333
1334 \sa Location
1335 */
1336
1337/*! \fn const Doc &Node::doc() const
1338 Returns a reference to the node's Doc data member.
1339
1340 \sa Doc
1341 */
1342
1343/*! \fn Status Node::status() const
1344 Returns the node's status value.
1345
1346 \sa Status
1347 */
1348
1349/*! \fn QString Node::since() const
1350 Returns the node's since string, which can be empty.
1351 */
1352
1353/*! \fn QString Node::templateStuff() const
1354 Returns the node's template parameters string, if this node
1355 represents a templated element.
1356 */
1357
1358/*! \fn bool Node::isSharingComment() const
1359 This function returns \c true if the node is sharing a comment
1360 with other nodes. For example, multiple functions can be documented
1361 with a single qdoc comment by listing the \c {\\fn} signatures for
1362 all the functions in the single qdoc comment.
1363 */
1364
1365/*! \fn QString Node::qmlTypeName() const
1366 If this is a QmlPropertyNode or a FunctionNode representing a QML
1367 method, this function returns the qmlTypeName() of
1368 the parent() node. Otherwise it returns the name data member.
1369 */
1370
1371/*! \fn QString Node::qmlFullBaseName() const
1372 If this is a QmlTypeNode, this function returns the QML full
1373 base name. Otherwise it returns an empty string.
1374 */
1375
1376/*! \fn QString Node::logicalModuleName() const
1377 If this is a CollectionNode, this function returns the logical
1378 module name. Otherwise it returns an empty string.
1379 */
1380
1381/*! \fn QString Node::logicalModuleVersion() const
1382 If this is a CollectionNode, this function returns the logical
1383 module version number. Otherwise it returns an empty string.
1384 */
1385
1386/*! \fn QString Node::logicalModuleIdentifier() const
1387 If this is a CollectionNode, this function returns the logical
1388 module identifier. Otherwise it returns an empty string.
1389 */
1390
1391/*! \fn void Node::setLogicalModuleInfo(const QString &arg)
1392 If this node is a CollectionNode, this function splits \a arg
1393 on the blank character to get a logical module name and version
1394 number. If the version number is present, it splits the version
1395 number on the '.' character to get a major version number and a
1396 minor version number. If the version number is present, both the
1397 major and minor version numbers should be there, but the minor
1398 version number is not absolutely necessary.
1399
1400 The strings are stored in the appropriate data members for use
1401 when the QML module page is generated.
1402 */
1403
1404/*! \fn void Node::setLogicalModuleInfo(const QStringList &info)
1405 If this node is a CollectionNode, this function accepts the
1406 logical module \a info as a string list. If the logical module
1407 info contains the version number, it splits the version number
1408 on the '.' character to get the major and minor version numbers.
1409 Both major and minor version numbers should be provided, but
1410 the minor version number is not strictly necessary.
1411
1412 The strings are stored in the appropriate data members for use
1413 when the QML module page is generated. This overload
1414 of the function is called when qdoc is reading an index file.
1415 */
1416
1417/*! \fn CollectionNode *Node::logicalModule() const
1418 If this is a QmlTypeNode, a pointer to its QML module is returned,
1419 which is a pointer to a CollectionNode. Otherwise the \c nullptr
1420 is returned.
1421 */
1422
1423/*! \fn void Node::setQmlModule(CollectionNode *t)
1424 If this is a QmlTypeNode, this function sets the QML type's QML module
1425 pointer to the CollectionNode \a t. Otherwise the function does nothing.
1426 */
1427
1428/*! \fn ClassNode *Node::classNode()
1429 If this is a QmlTypeNode, this function returns the pointer to
1430 the C++ ClassNode that this QML type represents. Otherwise the
1431 \c nullptr is returned.
1432 */
1433
1434/*! \fn void Node::setClassNode(ClassNode *cn)
1435 If this is a QmlTypeNode, this function sets the C++ class node
1436 to \a cn. The C++ ClassNode is the C++ implementation of the QML
1437 type.
1438 */
1439
1440/*! \fn NodeType Node::goal(const QString &t)
1441 When a square-bracket parameter is used in a qdoc command, this
1442 function might be called to convert the text string \a t obtained
1443 from inside the square brackets to be a Goal value, which is returned.
1444
1445 \sa Goal
1446 */
1447
1448QT_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: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
@ 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:236
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:989
bool isPrivate() const
Returns true if this node's access is Private.
Definition node.h:112
virtual bool isAbstract() const
Returns true if the ClassNode or QmlTypeNode is marked abstract.
Definition node.h:136
QString nodeTypeString() const
Returns this node's type as a string for use as an attribute value in XML or HTML.
Definition node.cpp:682
bool isQmlType() const
Returns true if the node type is QmlType or QmlValueType.
Definition node.h:122
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:868
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:149
virtual Status status() const
Returns the node's status value.
Definition node.h:240
virtual bool isTextPageNode() const
Returns true if the node is a PageNode but not an Aggregate.
Definition node.h:154
Aggregate * parent() const
Returns the node's parent pointer.
Definition node.h:209
static bool fromFlagValue(FlagValue fv, bool defaultValue)
Converts the enum fv back to a boolean value.
Definition node.cpp:767
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:909
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:979
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:957
ThreadSafeness inheritedThreadSafeness() const
If this node has a parent, the parent's thread safeness value is returned.
Definition node.cpp:857
const Location & location() const
If this node's definition location is empty, this function returns this node's declaration location.
Definition node.h:232
Access access() const
Returns the node's Access setting, which can be Public, Protected, or Private.
Definition node.h:229
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:845
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:927
QString fullDocumentName() const
Construct the full document name for this node and return it.
Definition node.cpp:997
virtual Tree * tree() const
Returns a pointer to the Tree this node is in.
Definition node.cpp:899
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:117
bool hasDoc() const
Returns true if this node is documented, or it represents a documented node read from the index ('had...
Definition node.cpp:942
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:756
bool isRelatedNonmember() const
Returns true if this is a related nonmember of something.
Definition node.h:123
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:797
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:817
void setDeprecated(const QString &sinceVersion)
Sets the Node status to Node::Deprecated, unless sinceVersion represents a future version.
Definition node.cpp:1044
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:968
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