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