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