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