20#include <QtCore/quuid.h>
21#include <QtCore/qversionnumber.h>
27using namespace Qt::StringLiterals;
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
53
54
55
56
59#define LT_RETURN_IF_NOT_EQUAL(a, b)
87
88
89
90
91
92
93
94
95
96
97
98
101 const QString default_sortkey{QChar{QChar::LastValidCodePoint}};
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) {
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
164
165
166
167
168
169
170
171
172
173
174
175
176
179
180
181
182
183
184
185
188
189
190
191
192
193
194
197
198
199
200
201
202
203
204
207
208
209
210
211
212
213
214
215
216
217
220
221
222
223
224
225
226
227
228
231
232
233
234
235
236
237
238
239
242
243
244
245
246
247
248
249
250
251
252
255
256
257
258
259
262
263
266
267
270
271
274
275
278
279
282
283
286
287
290
291
294
295
298
299
302
303
306
307
310
311
314
315
318
319
322
323
326
327
330
331
334
335
338
339
342
343
346
347
350
351
354
355
358
359
362
363
366
367
370
371
374
375
378
379
382
383
386
387
390
391
394
395
398
399
402
403
404
407
408
411
412
415
416
419
420
423
424
427
428
431
432
433
436
437
438
439
442
443
444
445
448
449
450
451
454
455
456
459
460
463
464
467
468
469
470
473 if (isFunction() && !isMacro())
474 return m_name + QLatin1String(
"()");
479
480
481
482
483
484
487 if (m_name.isEmpty())
488 return QLatin1String(
"global");
493 const Node *node =
this;
495 parts.prepend(node->plainName());
500 return parts.join(QLatin1String(
"::"));
504
505
506
507
508
511 if (m_name.isEmpty())
512 return QLatin1String(
"global");
515 const Node *node =
this;
520 fullName.prepend(QLatin1String(
"::"));
527
528
529
530
533 if ((isTextPageNode() || isGroup()) && !title().isEmpty())
535 return plainFullName(relative);
539
540
541
542
543
544
545
549 doc
.location().warning(QStringLiteral(
"Overrides a previous doc"),
550 QStringLiteral(
"from here: %1").arg(m_doc
.location().toString()));
556
557
558
559
568 if (Config::instance().showInternal())
572 m_url = QStringLiteral(
"");
580
581
582
583
586 m_indexNodeFlag(
false),
587 m_relatedNonmember(
false),
599
600
601
602
603
604
605
606
642
643
644
645
646
647
648
651
652
653
654
655
656
657
658
661
662
663
667 const auto *fn =
static_cast<
const FunctionNode *>(
this);
668 return fn->kindString();
670 return nodeTypeString(nodeType());
674
675
676
681 return QLatin1String(
"namespace");
683 return QLatin1String(
"class");
685 return QLatin1String(
"struct");
687 return QLatin1String(
"union");
689 return QLatin1String(
"header");
691 return QLatin1String(
"page");
693 return QLatin1String(
"enum");
695 return QLatin1String(
"example");
697 return QLatin1String(
"external page");
700 return QLatin1String(
"typedef");
702 return QLatin1String(
"function");
704 return QLatin1String(
"property");
706 return QLatin1String(
"proxy");
708 return QLatin1String(
"variable");
710 return QLatin1String(
"group");
712 return QLatin1String(
"module");
715 return QLatin1String(
"QML type");
717 return QLatin1String(
"QML value type");
719 return QLatin1String(
"QML module");
721 return QLatin1String(
"QML property");
724 return QLatin1String(
"shared comment");
726 return QLatin1String(
"collection");
734
735
736
743
744
745
746
747
761
762
763
764
765void Node::setLink(LinkType linkType,
const QString &link,
const QString &desc)
767 std::pair<QString, QString> linkPair;
768 linkPair.first = link;
769 linkPair.second = desc;
770 m_linkMap[linkType] = linkPair;
774
775
776
777
780 QStringList parts = since.split(QLatin1Char(
' '));
782 if (parts.size() > 1)
783 project = Config::dot + parts.first();
785 QVersionNumber cutoff =
786 QVersionNumber::fromString(Config::instance().get(
CONFIG_IGNORESINCE + project).asString())
789 if (!cutoff.isNull() && QVersionNumber::fromString(parts.last()).normalized() < cutoff)
792 m_since = parts.join(QLatin1Char(
' '));
796
797
801 for (
int i = 0; i <= string.size(); ++i) {
803 if (i != string.size())
806 QChar lower = ch.toLower();
807 if ((lower >= QLatin1Char(
'a') && lower <= QLatin1Char(
'z')) || ch.digitValue() >= 0
808 || ch == QLatin1Char(
'_') || ch == QLatin1Char(
':')) {
810 }
else if (!result.isEmpty()) {
811 if (result != QLatin1String(
"const"))
820
821
822
823
824
825
834
835
836
837
846
847
848
857
858
861
862
874
875
882
883
884
885
888 QString suffix = t.fileSuffix();
891 else if (suffix ==
"cpp")
900
901
902
903
904
905
914 return (m_sharedCommentNode && m_sharedCommentNode
->hasDoc());
918
919
920
923 if (m_parent && m_parent->isNamespace() && !m_parent->name().isEmpty())
924 return m_parent->name() +
"::" + m_name;
929
930
931
934 if (m_parent && !m_parent->name().isEmpty())
935 return m_parent->name() +
"::" + m_name;
940
941
942
945 return logicalModuleName() +
"::" + m_name;
949
950
951
952
955 return m_parent !=
nullptr && m_parent
->isWrapper();
959
960
964 const Node *n =
this;
967 if (!n->name().isEmpty())
968 pieces.insert(0, n->name());
971 pieces.insert(0, n->logicalModuleName());
986 QString concatenator =
"::";
988 concatenator = QLatin1Char(
'.');
991 concatenator = QLatin1Char(
'#');
993 return pieces.join(concatenator);
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
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;
1018 if (!sinceVersion.isEmpty()) {
1019 QVersionNumber since = QVersionNumber::fromString(sinceVersion).normalized();
1020 QVersionNumber current = QVersionNumber::fromString(
1023 if (!current.isNull() && !since.isNull()) {
1024 if (current < since)
1032
1033
1034
1035
1036
1037
1038
1039
1042
1043
1044
1045
1048
1049
1050
1051
1054
1055
1058
1059
1060
1061
1062
1063
1064
1065
1068
1069
1070
1073
1074
1075
1076
1079
1080
1081
1084
1085
1086
1087
1090
1091
1092
1093
1096
1097
1100
1101
1102
1103
1106
1107
1108
1109
1110
1111
1114
1115
1116
1117
1118
1119
1120
1123
1124
1125
1128
1129
1130
1133
1134
1135
1138
1139
1140
1143
1144
1145
1148
1149
1150
1153
1154
1155
1156
1159
1160
1161
1162
1163
1166
1167
1168
1169
1170
1173
1174
1175
1176
1179
1180
1181
1182
1183
1184
1185
1186
1189
1190
1191
1192
1193
1196
1197
1198
1199
1200
1203
1204
1205
1206
1207
1208
1211
1212
1213
1214
1215
1216
1217
1220
1221
1222
1223
1224
1225
1226
1227
1230
1231
1232
1235
1236
1237
1240
1241
1244
1245
1248
1249
1250
1251
1254
1255
1256
1257
1260
1261
1262
1263
1266
1267
1268
1269
1270
1273
1274
1275
1278
1279
1280
1281
1282
1285
1286
1287
1288
1289
1290
1291
1294
1295
1296
1297
1298
1299
1302
1303
1304
1305
1308
1309
1310
1311
1314
1315
1318
1319
1320
1323
1324
1325
1326
1327
1330
1331
1332
1333
1336
1337
1338
1341
1342
1343
1346
1347
1348
1351
1352
1353
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1382
1383
1384
1385
1388
1389
1390
1393
1394
1395
1396
1399
1400
1401
1402
1405
1406
1407
1408
1409
1410
void addChild(Node *child)
Adds the child to this node's child list and sets the child's parent pointer to this Aggregate.
const Location & location() const
Returns the starting location of a qdoc comment.
Doc & operator=(const Doc &doc)
bool isMarkedReimp() const
Returns true if the set of metacommands used in the doc comment contains {reimp}.
QStringMultiMap * metaTagMap() const
This node is used to represent any kind of function being documented.
The Location class provides a way to mark a location in a file.
QString plainName() const
Returns this node's name member.
const Doc & doc() const
Returns a reference to the node's Doc data member.
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...
QString fullName(const Node *relative=nullptr) const
Constructs and returns this node's full name.
virtual bool isAbstract() const
Returns true if the ClassNode or QmlTypeNode is marked abstract.
NodeType
An unsigned char value that identifies an object as a particular subclass of Node.
QString nodeTypeString() const
Returns this node's type as a string for use as an attribute value in XML or HTML.
bool isFunction(Genus g=DontCare) const
Returns true if this is a FunctionNode and its Genus is set to g.
bool isQmlType() const
Returns true if the node type is QmlType or QmlValueType.
virtual bool isInternal() const
Returns true if the node's status is Internal, or if its parent is a class with Internal status.
bool isHeader() const
Returns true if the node type is HeaderFile.
virtual bool isPageNode() const
Returns true if this node represents something that generates a documentation page.
virtual bool isTextPageNode() const
Returns true if the node is a PageNode but not an Aggregate.
Aggregate * parent() const
Returns the node's parent pointer.
static bool fromFlagValue(FlagValue fv, bool defaultValue)
Converts the enum fv back to a boolean value.
void setLocation(const Location &t)
Sets the node's declaration location, its definition location, or both, depending on the suffix of th...
QString plainFullName(const Node *relative=nullptr) const
Constructs and returns the node's fully qualified name by recursively ascending the parent links and ...
virtual bool isAggregate() const
Returns true if this node is an aggregate, which means it inherits Aggregate and can therefore have c...
NodeType nodeType() const
Returns this node's type.
FlagValue
A value used in PropertyNode and QmlPropertyNode that can be -1, 0, or +1.
QString qualifyQmlName()
Returns the QML node's qualified name by prepending the logical module name.
static bool nodeNameLessThan(const Node *first, const Node *second)
Returns true if the node n1 is less than node n2.
QString qualifyCppName()
Returns the CPP node's qualified name by prepending the namespaces name + "::" if there isw a namespa...
ThreadSafeness inheritedThreadSafeness() const
If this node has a parent, the parent's thread safeness value is returned.
const Location & location() const
If this node's definition location is empty, this function returns this node's declaration location.
Access access() const
Returns the node's Access setting, which can be Public, Protected, or Private.
ThreadSafeness threadSafeness() const
Returns the thread safeness value for whatever this node represents.
Genus
An unsigned char value that specifies whether the Node represents a C++ element, a QML element,...
QString fullDocumentName() const
Construct the full document name for this node and return it.
virtual Tree * tree() const
Returns a pointer to the Tree this node is in.
void setDoc(const Doc &doc, bool replace=false)
Sets this Node's Doc to doc.
Node(NodeType type, Aggregate *parent, QString name)
Construct a node with the given type and having the given parent and name.
ThreadSafeness
An unsigned char that specifies the degree of thread-safeness of the element.
bool hasDoc() const
Returns true if this node is documented, or it represents a documented node read from the index ('had...
static FlagValue toFlagValue(bool b)
Converts the boolean value b to an enum representation of the boolean type, which includes an enum va...
LinkType
An unsigned char value that probably should be moved out of the Node base class.
bool isRelatedNonmember() const
Returns true if this is a related nonmember of something.
void setSince(const QString &since)
Sets the information about the project and version a node was introduced in, unless the version is lo...
void setStatus(Status t)
Sets the node's status to t.
QString extractClassName(const QString &string) const
Extract a class name from the type string and return it.
void setDeprecated(const QString &sinceVersion)
Sets the Node status to Node::Deprecated, unless sinceVersion represents a future version.
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.
Status
An unsigned char that specifies the status of the documentation element in the documentation set.
QString qualifyWithParentName()
Return the name of this node qualified with the parent name and "::" if there is a parent name.
QString plainSignature() const
Constructs and returns the node's fully qualified signature by recursively ascending the parent links...
Status status() const
Returns the node's status value.
static Genus getGenus(NodeType t)
Determines the appropriate Genus value for the NodeType value t and returns that Genus value.
This class constructs and maintains a tree of instances of the subclasses of Node.
#define CONFIG_IGNORESINCE
Combined button and popup list for selecting options.
#define LT_RETURN_IF_NOT_EQUAL(a, b)