32#include <QtCore/qxmlstream.h>
49
50
51
52
53
56
57
58
59
60
61
62
65
66
67
70
71
72
75
76
77
80
81
82
85
86
87
88
89
90
91
92
95
96
97
98
99
102
103
104
109
110
117
118
125
126
127
130 if (s_qdocIndexFiles ==
nullptr)
132 return s_qdocIndexFiles;
136
137
140 if (s_qdocIndexFiles !=
nullptr) {
141 delete s_qdocIndexFiles;
142 s_qdocIndexFiles =
nullptr;
147
148
151 for (
const QString &file : indexFiles) {
152 qCDebug(lcQdoc) <<
"Loading index file: " << file;
158
159
165 if (!file.open(QFile::ReadOnly)) {
166 qWarning() <<
"Could not read index file" << path;
170 QXmlStreamReader reader(&file);
171 reader.setNamespaceProcessing(
false);
173 if (!reader.readNextStartElement())
176 if (reader.name() != QLatin1String(
"INDEX"))
179 QXmlStreamAttributes attrs = reader.attributes();
181 QString indexUrl {attrs.value(QLatin1String(
"url")).toString()};
188 if (!Config::installDir.isEmpty() && indexUrl == Config::instance().get(
CONFIG_URL).asString()) {
191 QDir installDir(path.section(
'/', 0, -3) +
'/' + Generator::outputSubdir());
192 indexUrl = installDir.relativeFilePath(path).section(
'/', 0, -2);
194 state.project = attrs.value(QLatin1String(
"project")).toString();
195 QString indexTitle = attrs.value(QLatin1String(
"indexTitle")).toString();
199 qWarning() <<
"Issue parsing index tree" << path;
203 root
->tree()->setIndexTitle(indexTitle);
207 while (reader.readNextStartElement()) {
208 readIndexSection(reader, root, indexUrl, state);
217
218
219
220
221
223 const QString &indexUrl, ReadState &state)
225 QXmlStreamAttributes attributes = reader.attributes();
226 QStringView elementName = reader.name();
228 QString name = attributes.value(QLatin1String(
"name")).toString();
229 QString href = attributes.value(QLatin1String(
"href")).toString();
233 bool hasReadChildren =
false;
236 parent =
static_cast<Aggregate *>(current);
238 if (attributes.hasAttribute(QLatin1String(
"related"))) {
239 bool isIntTypeRelatedValue =
false;
240 int relatedIndex = attributes.value(QLatin1String(
"related")).toInt(&isIntTypeRelatedValue);
241 if (isIntTypeRelatedValue) {
242 if (adoptRelatedNode(parent, relatedIndex, state)) {
243 reader.skipCurrentElement();
247 QList<Node *>::iterator nodeIterator =
248 std::find_if(state.relatedNodes.begin(), state.relatedNodes.end(), [&](
const Node *relatedNode) {
249 return (name == relatedNode->name() && href == relatedNode->url().section(QLatin1Char(
'/'), -1));
252 if (nodeIterator != state.relatedNodes.end() && parent) {
254 reader.skipCurrentElement();
262 if (attributes.hasAttribute(QLatin1String(
"filepath"))) {
263 filePath = attributes.value(QLatin1String(
"filepath")).toString();
264 lineNo = attributes.value(
"lineno").toInt();
266 if (parent && elementName == QLatin1String(
"namespace")) {
268 node = namespaceNode;
269 if (!indexUrl.isEmpty())
270 location
= Location(indexUrl + QLatin1Char(
'/') + name.toLower() +
".html");
271 else if (!indexUrl.isNull())
272 location
= Location(name.toLower() +
".html");
273 }
else if (parent && (elementName == QLatin1String(
"class") || elementName == QLatin1String(
"struct")
274 || elementName == QLatin1String(
"union"))) {
276 if (elementName == QLatin1String(
"class"))
278 else if (elementName == QLatin1String(
"struct"))
280 else if (elementName == QLatin1String(
"union"))
282 node =
new ClassNode(type, parent, name);
283 if (attributes.hasAttribute(QLatin1String(
"bases"))) {
284 QString bases = attributes.value(QLatin1String(
"bases")).toString();
285 if (!bases.isEmpty())
287 std::pair<ClassNode *, QString>(
static_cast<ClassNode *>(node), bases));
289 if (!indexUrl.isEmpty())
290 location
= Location(indexUrl + QLatin1Char(
'/') + name.toLower() +
".html");
291 else if (!indexUrl.isNull())
292 location
= Location(name.toLower() +
".html");
293 bool abstract =
false;
294 if (attributes.value(QLatin1String(
"abstract")) == QLatin1String(
"true"))
297 }
else if (parent && elementName == QLatin1String(
"header")) {
300 if (attributes.hasAttribute(QLatin1String(
"location")))
301 name = attributes.value(QLatin1String(
"location")).toString();
303 if (!indexUrl.isEmpty())
304 location
= Location(indexUrl + QLatin1Char(
'/') + name);
305 else if (!indexUrl.isNull())
307 }
else if (parent && ((elementName == QLatin1String(
"qmlclass") || elementName == QLatin1String(
"qmlvaluetype")
308 || elementName == QLatin1String(
"qmlbasictype")))) {
311 QString logicalModuleName = attributes.value(QLatin1String(
"qml-module-name")).toString();
312 if (!logicalModuleName.isEmpty())
313 m_qdb->addToQmlModule(logicalModuleName, qmlTypeNode);
314 bool abstract =
false;
315 if (attributes.value(QLatin1String(
"abstract")) == QLatin1String(
"true"))
317 qmlTypeNode->setAbstract(abstract);
318 if (attributes.value(QLatin1String(
"singleton")) == QLatin1String(
"true"))
319 qmlTypeNode->setSingleton();
320 else if (attributes.value(QLatin1String(
"uncreatable")) == QLatin1String(
"true"))
321 qmlTypeNode->setUncreatable();
322 QString qmlFullBaseName = attributes.value(QLatin1String(
"qml-base-type")).toString();
323 if (!qmlFullBaseName.isEmpty()) {
324 qmlTypeNode->setQmlBaseName(qmlFullBaseName);
326 if (attributes.hasAttribute(QLatin1String(
"location")))
327 name = attributes.value(
"location").toString();
328 if (!indexUrl.isEmpty())
329 location
= Location(indexUrl + QLatin1Char(
'/') + name);
330 else if (!indexUrl.isNull())
333 }
else if (parent && elementName == QLatin1String(
"qmlproperty")) {
335 QString propertyGroup = attributes.value(
"inpropertygroup").toString();
337 if (attributes.value(
"propertygroup") ==
"true") {
339 propertyGroup = attributes.value(
"fullname").toString();
341 QString type = attributes.value(QLatin1String(
"type")).toString();
342 bool attached =
false;
343 if (attributes.value(QLatin1String(
"attached")) == QLatin1String(
"true"))
345 bool readonly =
false;
346 if (attributes.value(QLatin1String(
"writable")) == QLatin1String(
"false"))
349 qmlPropertyNode->markReadOnly(readonly);
350 if (attributes.value(QLatin1String(
"required")) == QLatin1String(
"true"))
351 qmlPropertyNode->setRequired();
353 node = qmlPropertyNode;
356 if (!propertyGroup.isEmpty()) {
361 scn =
new SharedCommentNode(
static_cast<QmlTypeNode *>(parent), 0, propertyGroup.split(
".").last());
362 state.sharedDocNodes[propertyGroup] = scn;
369 hasReadChildren =
true;
372 }
else if (elementName == QLatin1String(
"group")) {
373 auto *collectionNode = m_qdb->addGroup(name);
374 collectionNode->setTitle(attributes.value(QLatin1String(
"title")).toString());
375 collectionNode->setSubtitle(attributes.value(QLatin1String(
"subtitle")).toString());
376 if (attributes.value(QLatin1String(
"seen")) == QLatin1String(
"true"))
377 collectionNode->markSeen();
378 node = collectionNode;
379 }
else if (elementName == QLatin1String(
"module")) {
380 auto *collectionNode = m_qdb->addModule(name);
381 collectionNode->setTitle(attributes.value(QLatin1String(
"title")).toString());
382 collectionNode->setSubtitle(attributes.value(QLatin1String(
"subtitle")).toString());
383 if (attributes.value(QLatin1String(
"seen")) == QLatin1String(
"true"))
384 collectionNode->markSeen();
385 node = collectionNode;
386 }
else if (elementName == QLatin1String(
"concept")) {
387 auto *collectionNode = m_qdb->addConcept(name);
388 collectionNode->setTitle(attributes.value(QLatin1String(
"title")).toString());
389 collectionNode->setSubtitle(attributes.value(QLatin1String(
"subtitle")).toString());
390 if (attributes.value(QLatin1String(
"seen")) == QLatin1String(
"true"))
391 collectionNode->markSeen();
392 node = collectionNode;
393 }
else if (elementName == QLatin1String(
"qmlmodule")) {
394 auto *collectionNode = m_qdb->addQmlModule(name);
395 const QStringList info = QStringList()
397 << QString(attributes.value(QLatin1String(
"qml-module-version")).toString());
398 collectionNode->setLogicalModuleInfo(info);
399 collectionNode->setTitle(attributes.value(QLatin1String(
"title")).toString());
400 collectionNode->setSubtitle(attributes.value(QLatin1String(
"subtitle")).toString());
401 if (attributes.value(QLatin1String(
"seen")) == QLatin1String(
"true"))
402 collectionNode->markSeen();
403 node = collectionNode;
404 }
else if (elementName == QLatin1String(
"page")) {
406 QString attr = attributes.value(QLatin1String(
"subtype")).toString();
407 if (attr == QLatin1String(
"attribution")) {
409 }
else if (attr == QLatin1String(
"example")) {
411 }
else if (attr == QLatin1String(
"file")) {
413 }
else if (attr == QLatin1String(
"image")) {
415 }
else if (attr == QLatin1String(
"page")) {
417 }
else if (attr == QLatin1String(
"externalpage")) {
423 auto *exampleNode =
static_cast<ExampleNode *>(current);
425 exampleNode->appendFile(name);
428 exampleNode->appendImage(name);
438 pageNode =
new PageNode(parent, name);
442 pageNode->setTitle(attributes.value(QLatin1String(
"title")).toString());
444 if (attributes.hasAttribute(QLatin1String(
"location")))
445 name = attributes.value(QLatin1String(
"location")).toString();
447 if (!indexUrl.isEmpty())
448 location
= Location(indexUrl + QLatin1Char(
'/') + name);
449 else if (!indexUrl.isNull())
454 }
else if (parent && (elementName == QLatin1String(
"enum") || elementName == QLatin1String(
"qmlenum"))) {
456 if (elementName == QLatin1String(
"enum"))
457 enumNode =
new EnumNode(parent, name, attributes.hasAttribute(
"scoped"));
461 if (!indexUrl.isEmpty())
462 location
= Location(indexUrl + QLatin1Char(
'/') + parent->name().toLower() +
".html");
463 else if (!indexUrl.isNull())
464 location
= Location(parent->name().toLower() +
".html");
466 if (attributes.value(
"anonymous") ==
"true")
469 while (reader.readNextStartElement()) {
470 QXmlStreamAttributes childAttributes = reader.attributes();
471 if (reader.name() == QLatin1String(
"value")) {
472 EnumItem item(childAttributes.value(QLatin1String(
"name")).toString(),
473 childAttributes.value(QLatin1String(
"value")).toString(),
474 childAttributes.value(QLatin1String(
"since")).toString()
477 }
else if (reader.name() == QLatin1String(
"keyword")) {
479 }
else if (reader.name() == QLatin1String(
"target")) {
482 reader.skipCurrentElement();
487 hasReadChildren =
true;
488 }
else if (parent && elementName == QLatin1String(
"typedef")) {
490 if (attributes.hasAttribute(
"aliasedtype"))
491 typedefNode =
new TypeAliasNode(parent, name, attributes.value(QLatin1String(
"aliasedtype")).toString());
496 if (attributes.hasAttribute(
"enum")) {
497 auto path = attributes.value(QLatin1String(
"enum")).toString();
498 const Node *enode = m_qdb->findNodeForTarget(path, typedefNode);
500 const EnumNode *n =
static_cast<
const EnumNode *>(enode);
506 if (!indexUrl.isEmpty())
507 location
= Location(indexUrl + QLatin1Char(
'/') + parent->name().toLower() +
".html");
508 else if (!indexUrl.isNull())
509 location
= Location(parent->name().toLower() +
".html");
510 }
else if (parent && elementName == QLatin1String(
"property")) {
513 if (attributes.value(QLatin1String(
"bindable")) == QLatin1String(
"true"))
516 propNode->setWritable(attributes.value(QLatin1String(
"writable")) != QLatin1String(
"false"));
517 propNode->setDataType(attributes.value(QLatin1String(
"dataType")).toString());
519 if (attributes.value(QLatin1String(
"constant")) == QLatin1String(
"true"))
520 propNode->setConstant();
522 if (!indexUrl.isEmpty())
523 location
= Location(indexUrl + QLatin1Char(
'/') + parent->name().toLower() +
".html");
524 else if (!indexUrl.isNull())
525 location
= Location(parent->name().toLower() +
".html");
527 }
else if (parent && elementName == QLatin1String(
"function")) {
528 QString t = attributes.value(QLatin1String(
"meta")).toString();
529 bool attached =
false;
532 metaness = FunctionNode::getMetaness(t);
533 if (attributes.value(QLatin1String(
"attached")) == QLatin1String(
"true"))
535 auto *fn =
new FunctionNode(metaness, parent, name, attached);
537 fn->setReturnType(attributes.value(QLatin1String(
"type")).toString());
539 const auto &declaredTypeAttr = attributes.value(QLatin1String(
"declaredtype"));
540 if (!declaredTypeAttr.isEmpty())
541 fn->setDeclaredReturnType(declaredTypeAttr.toString());
543 if (fn->isCppNode()) {
544 fn->setVirtualness(attributes.value(QLatin1String(
"virtual")).toString());
545 fn->setConst(attributes.value(QLatin1String(
"const")) == QLatin1String(
"true"));
546 fn->setStatic(attributes.value(QLatin1String(
"static")) == QLatin1String(
"true"));
547 fn->setFinal(attributes.value(QLatin1String(
"final")) == QLatin1String(
"true"));
548 fn->setOverride(attributes.value(QLatin1String(
"override")) == QLatin1String(
"true"));
550 if (attributes.value(QLatin1String(
"explicit")) == QLatin1String(
"true"))
553 if (attributes.value(QLatin1String(
"constexpr")) == QLatin1String(
"true"))
556 if (attributes.value(QLatin1String(
"explicitly-defaulted")) == QLatin1String(
"true"))
557 fn->markExplicitlyDefaulted();
559 if (attributes.value(QLatin1String(
"deleted")) == QLatin1String(
"true"))
560 fn->markDeletedAsWritten();
561 if (attributes.value(QLatin1String(
"hidden-friend")) == QLatin1String(
"true"))
562 fn->setHiddenFriend(
true);
564 if (attributes.value(QLatin1String(
"noexcept")) == QLatin1String(
"true")) {
565 fn->markNoexcept(attributes.value(
"noexcept_expression").toString());
568 if (attributes.hasAttribute(QLatin1String(
"trailing_requires")))
569 fn->setTrailingRequiresClause(attributes.value(QLatin1String(
"trailing_requires")).toString());
571 qsizetype refness = attributes.value(QLatin1String(
"refness")).toUInt();
574 else if (refness == 2)
577
578
579
580
581
582 if (attributes.value(QLatin1String(
"overload")) == QLatin1String(
"true"))
583 fn->setOverloadNumber(attributes.value(QLatin1String(
"overload-number")).toUInt());
585 fn->setOverloadNumber(0);
589
590
591
592
593
594
595 while (reader.readNextStartElement()) {
596 QXmlStreamAttributes childAttributes = reader.attributes();
597 if (reader.name() == QLatin1String(
"parameter")) {
598 QString type = childAttributes.value(QLatin1String(
"type")).toString();
599 QString name = childAttributes.value(QLatin1String(
"name")).toString();
600 QString default_ = childAttributes.value(QLatin1String(
"default")).toString();
601 fn->parameters().append(type, name, default_);
602 }
else if (reader.name() == QLatin1String(
"keyword")) {
604 }
else if (reader.name() == QLatin1String(
"target")) {
607 reader.skipCurrentElement();
611 if (!indexUrl.isEmpty())
612 location
= Location(indexUrl + QLatin1Char(
'/') + parent->name().toLower() +
".html");
613 else if (!indexUrl.isNull())
614 location
= Location(parent->name().toLower() +
".html");
616 hasReadChildren =
true;
617 }
else if (parent && elementName == QLatin1String(
"variable")) {
619 varNode->setLeftType(attributes.value(
"type").toString());
620 varNode->setStatic((attributes.value(
"static").toString() ==
"true") ?
true :
false);
622 if (!indexUrl.isEmpty())
623 location
= Location(indexUrl + QLatin1Char(
'/') + parent->name().toLower() +
".html");
624 else if (!indexUrl.isNull())
625 location
= Location(parent->name().toLower() +
".html");
626 }
else if (elementName == QLatin1String(
"keyword")) {
629 }
else if (elementName == QLatin1String(
"target")) {
632 }
else if (elementName == QLatin1String(
"contents")) {
635 }
else if (parent && elementName == QLatin1String(
"proxy")) {
637 if (!indexUrl.isEmpty())
638 location
= Location(indexUrl + QLatin1Char(
'/') + name.toLower() +
".html");
639 else if (!indexUrl.isNull())
640 location
= Location(name.toLower() +
".html");
648 auto *cn =
static_cast<CollectionNode *>(node);
649 if (attributes.hasAttribute(QLatin1String(
"cmakepackage")))
650 cn->setCMakePackage(attributes.value(QLatin1String(
"cmakepackage")).toString());
651 if (attributes.hasAttribute(QLatin1String(
"cmakecomponent")))
652 cn->setCMakeComponent(attributes.value(QLatin1String(
"cmakecomponent")).toString());
653 if (attributes.hasAttribute(QLatin1String(
"cmaketargetitem")))
654 cn->setCMakeTargetItem(attributes.value(QLatin1String(
"cmaketargetitem")).toString());
655 if (attributes.hasAttribute(QLatin1String(
"qtvariable")))
656 cn->setQtVariable(attributes.value(QLatin1String(
"qtvariable")).toString());
658 if (node
->isAggregate() && attributes.hasAttribute(QLatin1String(
"includefile"))) {
659 auto *agg =
static_cast<Aggregate *>(node);
660 agg->setIncludeFile(attributes.value(QLatin1String(
"includefile")).toString());
663 if (!href.isEmpty()) {
667 node->setUrl(indexUrl + QLatin1Char(
'/') + href);
670 const QString access = attributes.value(QLatin1String(
"access")).toString();
671 if (access ==
"protected")
673 else if (access ==
"private")
678 if (attributes.hasAttribute(QLatin1String(
"related"))) {
680 state.relatedNodes << node;
683 if (attributes.hasAttribute(QLatin1String(
"relatedto"))) {
684 const auto targets = attributes.value(QLatin1String(
"relatedto")).split(u',');
685 for (
const auto &target : targets)
686 node->tree()->addExternalRelates(node, target.toString());
689 if (attributes.hasAttribute(QLatin1String(
"threadsafety"))) {
690 QString threadSafety = attributes.value(QLatin1String(
"threadsafety")).toString();
691 if (threadSafety == QLatin1String(
"non-reentrant"))
693 else if (threadSafety == QLatin1String(
"reentrant"))
695 else if (threadSafety == QLatin1String(
"thread safe"))
702 const QString category = attributes.value(QLatin1String(
"comparison_category")).toString();
705 QString status = attributes.value(QLatin1String(
"status")).toString();
707 if (status == QLatin1String(
"obsolete") || status == QLatin1String(
"deprecated"))
709 else if (status == QLatin1String(
"preliminary"))
711 else if (status == QLatin1String(
"internal"))
713 else if (status == QLatin1String(
"internal-auto"))
715 else if (status == QLatin1String(
"ignored"))
720 QString physicalModuleName = attributes.value(QLatin1String(
"module")).toString();
721 if (!physicalModuleName.isEmpty())
722 m_qdb->addToModule(physicalModuleName, node);
724 QString since = attributes.value(QLatin1String(
"since")).toString();
725 if (!since.isEmpty()) {
726 node->setSince(since);
729 if (attributes.hasAttribute(QLatin1String(
"documented"))) {
730 if (attributes.value(QLatin1String(
"documented")) == QLatin1String(
"true"))
734 QString groupsAttr = attributes.value(QLatin1String(
"groups")).toString();
735 if (!groupsAttr.isEmpty()) {
736 const QStringList groupNames = groupsAttr.split(QLatin1Char(
','));
737 for (
const auto &group : groupNames) {
738 m_qdb->addToGroup(group, node);
743 QSet<QString> emptySet;
745 if (!filePath.isEmpty()) {
750 Doc doc(location, location, QString(), emptySet, emptySet);
751 if (attributes.value(QLatin1String(
"auto-generated")) == QLatin1String(
"true"))
755 QString briefAttr = attributes.value(QLatin1String(
"brief")).toString();
756 if (!briefAttr.isEmpty()) {
757 node->setReconstitutedBrief(briefAttr);
760 if (
const auto sortKey = attributes.value(QLatin1String(
"sortkey")).toString(); !sortKey.isEmpty()) {
763 metaMap->insert(
"sortkey", sortKey);
765 if (!hasReadChildren) {
766 bool useParent = (elementName == QLatin1String(
"namespace") && name.isEmpty());
767 while (reader.readNextStartElement()) {
769 readIndexSection(reader, parent, indexUrl, state);
771 readIndexSection(reader, node, indexUrl, state);
777 while (!reader.isEndElement()) {
778 if (reader.readNext() == QXmlStreamReader::Invalid) {
785 const QXmlStreamAttributes &attributes,
Node *node)
802 QString name = attributes.value(QLatin1String(
"name")).toString();
803 QString title = attributes.value(QLatin1String(
"title")).toString();
804 m_qdb->insertTarget(name, title, type, node, priority);
808
809
810
811
812
813
814
815
816
817
818
819
820
823 for (
const auto &pair : std::as_const(state.bases)) {
824 const QStringList bases = pair.second.split(QLatin1Char(
','));
825 for (
const auto &base : bases) {
826 QStringList basePath = base.split(QString(
"::"));
827 Node *n = m_qdb->findClassNode(basePath);
829 pair.first->addResolvedBaseClass(Access::Public,
static_cast<ClassNode *>(n));
831 pair.first->addUnresolvedBaseClass(Access::Public, basePath);
841 return QLatin1String(
"public");
842 case Access::Protected:
843 return QLatin1String(
"protected");
844 case Access::Private:
845 return QLatin1String(
"private");
849 return QLatin1String(
"public");
856 return QLatin1String(
"deprecated");
858 return QLatin1String(
"preliminary");
860 return QLatin1String(
"active");
862 return QLatin1String(
"internal");
864 return QLatin1String(
"internal-auto");
866 return QLatin1String(
"ignored");
870 return QLatin1String(
"active");
877 return QLatin1String(
"non-reentrant");
879 return QLatin1String(
"reentrant");
881 return QLatin1String(
"thread safe");
886 return QLatin1String(
"unspecified");
890
891
892
893
896 qsizetype i = state.relatedNodes.indexOf(node);
898 i = state.relatedNodes.size();
899 state.relatedNodes << node;
905
906
907
908static void writeNonEmpty(QXmlStreamWriter &writer,
const QString &name,
const QString &value)
910 if (!value.isEmpty())
911 writer.writeAttribute(name, value);
915
916
917
918
919
920
921
924 QStringList targets = node
->tree()->externalRelates().values(node);
926 writeNonEmpty(writer,
"relatedto", targets.join(u','));
930
931
932
933
936 Node *related = state.relatedNodes.value(index);
938 if (adoptiveParent && related) {
947
948
949
950
951
955 for (
const Atom *target : std::as_const(node->doc().targets())) {
956 const QString &title = target->string();
957 const QString name = target->count() >= 2 ? target->string(1)
958 : TextUtils::asAsciiPrintable(title);
959 writer.writeStartElement(
"target");
960 writer.writeAttribute(
"name", node->isExternalPage() ? title : name);
962 writer.writeAttribute(
"title", title);
963 writer.writeEndElement();
967 for (
const Atom *keyword : std::as_const(node->doc().keywords())) {
968 const QString &title = keyword->string();
969 const QString &name{TextUtils::asAsciiPrintable(title)};
970 writer.writeStartElement(
"keyword");
971 writer.writeAttribute(
"name", name);
973 writer.writeAttribute(
"title", title);
974 writer.writeEndElement();
980
981
982
983
984
985
986
987
988
989
990
995 Q_ASSERT(context.documentLocation);
997
998
1003 QString logicalModuleName;
1004 QString logicalModuleVersion;
1005 QString qmlFullBaseName;
1006 QString baseNameAttr;
1007 QString moduleNameAttr;
1008 QString moduleVerAttr;
1012 nodeName =
"namespace";
1018 nodeName =
"struct";
1024 nodeName =
"header";
1027 nodeName =
"qmlenum";
1032 logicalModuleName = node->logicalModuleName();
1033 baseNameAttr =
"qml-base-type";
1034 moduleNameAttr =
"qml-module-name";
1035 moduleVerAttr =
"qml-module-version";
1036 qmlFullBaseName = node->qmlFullBaseName();
1047 nodeName =
"module";
1050 nodeName =
"concept";
1053 nodeName =
"qmlmodule";
1054 moduleNameAttr =
"qml-module-name";
1055 moduleVerAttr =
"qml-module-version";
1056 logicalModuleName = node->logicalModuleName();
1057 logicalModuleVersion = node->logicalModuleVersion();
1064 nodeName =
"typedef";
1067 nodeName =
"property";
1070 nodeName =
"variable";
1076 nodeName =
"qmlproperty";
1079 nodeName =
"qmlproperty";
1089 QString objName = node->name();
1094 writer.writeStartElement(nodeName);
1098 writer.writeAttribute(
"threadsafety", getThreadSafenessString(node->threadSafeness()));
1101 writer.writeAttribute(
"name", objName);
1104 writer.writeAttribute(
"propertygroup",
"true");
1109 if (!moduleNameAttr.isEmpty()) {
1110 if (!logicalModuleName.isEmpty())
1111 writer.writeAttribute(moduleNameAttr, logicalModuleName);
1112 if (!logicalModuleVersion.isEmpty())
1113 writer.writeAttribute(moduleVerAttr, logicalModuleVersion);
1115 if (!baseNameAttr.isEmpty() && !qmlFullBaseName.isEmpty())
1116 writer.writeAttribute(baseNameAttr, qmlFullBaseName);
1117 else if (!baseNameAttr.isEmpty()) {
1118 const auto &qmlBase =
static_cast<QmlTypeNode *>(node)->qmlBaseName();
1119 writeNonEmpty(writer, baseNameAttr, qmlBase);
1124 QString fullName = node->fullDocumentName();
1125 if (fullName != objName)
1126 writer.writeAttribute(
"fullname", fullName);
1127 href = context.documentLocation(node);
1129 href = node->name();
1135 writeNonEmpty(writer,
"href", href);
1137 writer.writeAttribute(
"status", getStatusString(node->status()));
1139 writer.writeAttribute(
"access", getAccessString(node->access()));
1141 writer.writeAttribute(
"abstract",
"true");
1144 writeNonEmpty(writer,
"location", declLocation.fileName());
1146 writer.writeAttribute(
"filepath", declLocation.filePath());
1147 writer.writeAttribute(
"lineno", QString(
"%1").arg(declLocation
.lineNo()));
1151 writer.writeAttribute(
"related", QString::number(indexForNode(node, state)));
1155 writeNonEmpty(writer,
"since", node->since());
1158 writer.writeAttribute(
"documented",
"true");
1160 QStringList groups = m_qdb->groupNamesForNode(node);
1161 if (!groups.isEmpty())
1162 writer.writeAttribute(
"groups", groups.join(QLatin1Char(
',')));
1165 if (
const auto sortKey = metamap->value(
"sortkey"); !sortKey.isEmpty())
1166 writer.writeAttribute(
"sortkey", sortKey);
1170 auto *cn =
static_cast<CollectionNode *>(node);
1171 writeNonEmpty(writer,
"cmakepackage", cn->cmakePackage());
1172 writeNonEmpty(writer,
"cmakecomponent", cn->cmakeComponent());
1173 writeNonEmpty(writer,
"cmaketargetitem", cn->cmakeTargetItem());
1174 writeNonEmpty(writer,
"qtvariable", cn->qtVariable());
1178 auto *agg =
static_cast<Aggregate *>(node);
1179 if (agg->includeFile())
1180 writer.writeAttribute(
"includefile", *agg->includeFile());
1183 QString brief = node
->doc().trimmedBriefText(node->name()).toString();
1189 const auto *classNode =
static_cast<
const ClassNode *>(node);
1190 const QList<RelatedClass> &bases = classNode->baseClasses();
1191 QSet<QString> baseStrings;
1192 for (
const auto &related : bases) {
1193 ClassNode *n = related.m_node;
1195 baseStrings.insert(n->fullName());
1196 else if (!related.m_path.isEmpty())
1197 baseStrings.insert(related.m_path.join(QLatin1String(
"::")));
1199 if (!baseStrings.isEmpty()) {
1200 QStringList baseStringsAsList = baseStrings.values();
1201 baseStringsAsList.sort();
1202 writer.writeAttribute(
"bases", baseStringsAsList.join(QLatin1Char(
',')));
1204 writeNonEmpty(writer,
"module", node->physicalModuleName());
1205 writeNonEmpty(writer,
"brief", brief);
1210 const auto *headerNode =
static_cast<
const HeaderNode *>(node);
1211 writeNonEmpty(writer,
"module", headerNode->physicalModuleName());
1212 writeNonEmpty(writer,
"brief", brief);
1213 writer.writeAttribute(
"title", headerNode->title());
1214 writer.writeAttribute(
"fulltitle", headerNode->fullTitle());
1215 writer.writeAttribute(
"subtitle", headerNode->subtitle());
1218 const auto *namespaceNode =
static_cast<
const NamespaceNode *>(node);
1219 writeNonEmpty(writer,
"module", namespaceNode->physicalModuleName());
1220 writeNonEmpty(writer,
"brief", brief);
1221 writeNonEmpty(writer,
"whereDocumented", namespaceNode->whereDocumented());
1225 const auto *qmlTypeNode =
static_cast<
const QmlTypeNode *>(node);
1226 writeNonEmpty(writer,
"title", qmlTypeNode->title());
1227 writeNonEmpty(writer,
"fulltitle", qmlTypeNode->fullTitle());
1228 writeNonEmpty(writer,
"subtitle", qmlTypeNode->subtitle());
1229 if (qmlTypeNode->isSingleton())
1230 writer.writeAttribute(
"singleton",
"true");
1231 if (qmlTypeNode->isUncreatable())
1232 writer.writeAttribute(
"uncreatable",
"true");
1233 writeNonEmpty(writer,
"brief", brief);
1234 if (
ClassNode *cn = qmlTypeNode->classNode()) {
1235 writer.writeAttribute(
"class", cn->fullDocumentName());
1242 writer.writeAttribute(
"subtype",
"example");
1244 writer.writeAttribute(
"subtype",
"externalpage");
1246 writer.writeAttribute(
"subtype", (
static_cast<PageNode*>(node)->isAttribution() ?
"attribution" :
"page"));
1248 const auto *pageNode =
static_cast<
const PageNode *>(node);
1249 writeNonEmpty(writer,
"title", pageNode->title());
1250 writeNonEmpty(writer,
"fulltitle", pageNode->fullTitle());
1251 writeNonEmpty(writer,
"subtitle", pageNode->subtitle());
1252 writeNonEmpty(writer,
"brief", brief);
1258 const auto *collectionNode =
static_cast<
const CollectionNode *>(node);
1259 writer.writeAttribute(
"seen", collectionNode->wasSeen() ?
"true" :
"false");
1260 writeNonEmpty(writer,
"title", collectionNode->title());
1261 writeNonEmpty(writer,
"subtitle", collectionNode->subtitle());
1262 writeNonEmpty(writer,
"module", collectionNode->physicalModuleName());
1263 writeNonEmpty(writer,
"brief", brief);
1266 auto *qmlPropertyNode =
static_cast<QmlPropertyNode *>(node);
1267 writer.writeAttribute(
"type", qmlPropertyNode->dataType());
1268 writer.writeAttribute(
"attached", qmlPropertyNode->isAttached() ?
"true" :
"false");
1269 writer.writeAttribute(
"writable", qmlPropertyNode->isReadOnly() ?
"false" :
"true");
1270 if (qmlPropertyNode->isRequired())
1271 writer.writeAttribute(
"required",
"true");
1272 writeNonEmpty(writer,
"brief", brief);
1275 const auto *propertyNode =
static_cast<
const PropertyNode *>(node);
1278 writer.writeAttribute(
"bindable",
"true");
1280 if (!propertyNode->isWritable())
1281 writer.writeAttribute(
"writable",
"false");
1283 if (propertyNode->isConstant())
1284 writer.writeAttribute(
"constant",
"true");
1286 writer.writeAttribute(
"dataType", propertyNode->dataType());
1288 writeNonEmpty(writer,
"brief", brief);
1290 for (qsizetype i{0}; i < (qsizetype)PropertyNode::FunctionRole::NumFunctionRoles; ++i) {
1292 for (
const auto *fnNode : propertyNode->functions(role)) {
1293 writer.writeStartElement(PropertyNode::roleName(role));
1294 writer.writeAttribute(
"name", fnNode->name());
1295 writer.writeEndElement();
1300 const auto *variableNode =
static_cast<
const VariableNode *>(node);
1301 writer.writeAttribute(
"type", variableNode->dataType());
1302 writer.writeAttribute(
"static", variableNode->isStatic() ?
"true" :
"false");
1303 writeNonEmpty(writer,
"brief", brief);
1307 const auto *enumNode =
static_cast<
const EnumNode *>(node);
1308 if (enumNode->isScoped())
1309 writer.writeAttribute(
"scoped",
"true");
1310 if (enumNode->flagsType())
1311 writer.writeAttribute(
"typedef", enumNode->flagsType()->fullDocumentName());
1312 if (enumNode->isAnonymous())
1313 writer.writeAttribute(
"anonymous",
"true");
1314 const auto &items = enumNode->items();
1315 for (
const auto &item : items) {
1316 writer.writeStartElement(
"value");
1317 writer.writeAttribute(
"name", item.name());
1318 if (node->isEnumType(Genus::CPP))
1319 writer.writeAttribute(
"value", item.value());
1320 writeNonEmpty(writer,
"since", item.since());
1321 writer.writeEndElement();
1325 const auto *typedefNode =
static_cast<
const TypedefNode *>(node);
1326 if (typedefNode->associatedEnum())
1327 writer.writeAttribute(
"enum", typedefNode->associatedEnum()->fullDocumentName());
1330 writer.writeAttribute(
"aliasedtype",
static_cast<
const TypeAliasNode *>(node)->aliasedType());
1337 writeTargets(writer, node);
1340
1341
1342
1343
1344
1345
1348 for (
int i = 0; i < node
->doc().tableOfContents().size(); ++i) {
1350 int level = node
->doc().tableOfContentsLevels()[i];
1352 writer.writeStartElement(
"contents");
1353 writer.writeAttribute(
"name", Tree::refForAtom(item));
1354 writer.writeAttribute(
"title", title);
1355 writer.writeAttribute(
"level", QString::number(level));
1356 writer.writeEndElement();
1363 Q_ASSERT(context.exampleFileLocation);
1364 const auto *exampleNode =
static_cast<
const ExampleNode *>(node);
1365 const auto &files = exampleNode->files();
1366 const auto &images = exampleNode->images();
1367 for (
const QString &file : files) {
1368 writer.writeStartElement(
"page");
1369 writer.writeAttribute(
"name", file);
1370 writer.writeAttribute(
"href", context.exampleFileLocation(file));
1371 writer.writeAttribute(
"status",
"active");
1372 writer.writeAttribute(
"subtype",
"file");
1373 writer.writeAttribute(
"title",
"");
1374 writer.writeAttribute(
"fulltitle", Utilities::exampleFileTitle(file, Utilities::ExampleFileKind::File));
1375 writer.writeAttribute(
"subtitle", file);
1376 writer.writeEndElement();
1378 for (
const QString &file : images) {
1379 writer.writeStartElement(
"page");
1380 writer.writeAttribute(
"name", file);
1381 writer.writeAttribute(
"href", context.exampleFileLocation(file));
1382 writer.writeAttribute(
"status",
"active");
1383 writer.writeAttribute(
"subtype",
"image");
1384 writer.writeAttribute(
"title",
"");
1385 writer.writeAttribute(
"fulltitle", Utilities::exampleFileTitle(file, Utilities::ExampleFileKind::Image));
1386 writer.writeAttribute(
"subtitle", file);
1387 writer.writeEndElement();
1398
1399
1400
1401
1410 const QString objName = fn->name();
1411 writer.writeStartElement(
"function");
1412 writer.writeAttribute(
"name", objName);
1414 const QString fullName = fn->fullDocumentName();
1415 if (fullName != objName)
1416 writer.writeAttribute(
"fullname", fullName);
1417 const QString href = context.documentLocation(fn);
1418 writeNonEmpty(writer,
"href", href);
1420 writer.writeAttribute(
"threadsafety", getThreadSafenessString(fn->threadSafeness()));
1421 writer.writeAttribute(
"status", getStatusString(fn->status()));
1422 writer.writeAttribute(
"access", getAccessString(fn->access()));
1425 writeNonEmpty(writer,
"location", declLocation.fileName());
1427 writer.writeAttribute(
"filepath", declLocation.filePath());
1428 writer.writeAttribute(
"lineno", QString(
"%1").arg(declLocation
.lineNo()));
1432 writer.writeAttribute(
"documented",
"true");
1434 writer.writeAttribute(
"auto-generated",
"true");
1436 writer.writeAttribute(
"related", QString::number(indexForNode(fn, state)));
1437 writeExternalRelates(writer, fn);
1439 writeNonEmpty(writer,
"since", fn->since());
1441 const QString brief = fn
->doc().trimmedBriefText(fn->name()).toString();
1442 writer.writeAttribute(
"meta", fn->metanessString());
1445 writer.writeAttribute(
"virtual", fn->virtualness());
1448 writer.writeAttribute(
"const",
"true");
1450 writer.writeAttribute(
"static",
"true");
1452 writer.writeAttribute(
"final",
"true");
1454 writer.writeAttribute(
"override",
"true");
1456 writer.writeAttribute(
"explicit",
"true");
1458 writer.writeAttribute(
"constexpr",
"true");
1460 writer.writeAttribute(
"explicitly-defaulted",
"true");
1462 writer.writeAttribute(
"deleted",
"true");
1464 writer.writeAttribute(
"hidden-friend",
"true");
1466 if (
auto noexcept_info = fn->getNoexcept()) {
1467 writer.writeAttribute(
"noexcept",
"true");
1468 writeNonEmpty(writer,
"noexcept_expression", *noexcept_info);
1471 if (
const auto &trailing_requires = fn->trailingRequiresClause(); trailing_requires && !trailing_requires->isEmpty())
1472 writer.writeAttribute(
"trailing_requires", *trailing_requires);
1475
1476
1477
1478
1479
1481 writer.writeAttribute(
"overload",
"true");
1482 writer.writeAttribute(
"overload-number", QString::number(fn->overloadNumber()));
1485 writer.writeAttribute(
"refness", QString::number(1));
1487 writer.writeAttribute(
"refness", QString::number(2));
1489 QStringList associatedProperties;
1490 for (
const auto *node : fn->associatedProperties()) {
1491 associatedProperties << node->name();
1493 associatedProperties.sort();
1494 writer.writeAttribute(
"associated-property",
1495 associatedProperties.join(QLatin1Char(
',')));
1499 writer.writeAttribute(
"attached",
"true");
1502 const auto &return_type = fn->returnType();
1503 if (!return_type.isEmpty())
1504 writer.writeAttribute(
"type",
std::move(return_type));
1506 const auto &declared_return_type = fn->declaredReturnType();
1507 if (declared_return_type.has_value())
1508 writer.writeAttribute(
"declaredtype", declared_return_type.value());
1511 writeNonEmpty(writer,
"brief", brief);
1514
1515
1516
1517
1518 const QString signature = appendAttributesToSignature(fn);
1519 writer.writeAttribute(
"signature", signature);
1521 QStringList groups = m_qdb->groupNamesForNode(fn);
1522 if (!groups.isEmpty())
1523 writer.writeAttribute(
"groups", groups.join(QLatin1Char(
',')));
1528 writer.writeStartElement(
"parameter");
1529 writer.writeAttribute(
"type", parameter.type());
1530 writer.writeAttribute(
"name", parameter.name());
1531 writer.writeAttribute(
"default", parameter.defaultValue());
1532 writer.writeEndElement();
1535 writeTargets(writer, fn);
1541 writer.writeEndElement();
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1560 signature +=
" final";
1562 signature +=
" override";
1564 signature +=
" = 0";
1565 if (
const auto &req = fn->trailingRequiresClause(); req && !req->isEmpty())
1566 signature +=
" requires " + *req;
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1590 for (
auto functions : std::as_const(aggregate->functionMap())) {
1591 std::for_each(functions.begin(), functions.end(),
1592 [
this, &writer, &context, &state, post](FunctionNode *fn) {
1593 generateFunctionSection(writer, fn, context, state, post);
1607
1608
1609
1610
1611
1612
1617 Q_ASSERT(context.documentLocation);
1620
1621
1622
1631 if (generateIndexSection(writer, node, context, state, post)) {
1633 auto *aggregate =
static_cast<Aggregate *>(node);
1635 generateFunctionSections(writer, aggregate, context, state, post);
1636 auto nonFunctionChildren = sortedNonFunctionChildren(aggregate);
1637 for (
auto *node : nonFunctionChildren)
1638 generateIndexSections(writer, node, context, state, post);
1641 if (node == state.root) {
1643
1644
1645
1646
1647
1648
1650 if (!groups.isEmpty()) {
1651 for (
auto it = groups.constBegin(); it != groups.constEnd(); ++it) {
1652 if (generateIndexSection(writer, it.value(), context, state, post))
1653 writer.writeEndElement();
1658 if (!modules.isEmpty()) {
1659 for (
auto it = modules.constBegin(); it != modules.constEnd(); ++it) {
1660 if (generateIndexSection(writer, it.value(), context, state, post))
1661 writer.writeEndElement();
1666 if (!qmlModules.isEmpty()) {
1667 for (
auto it = qmlModules.constBegin(); it != qmlModules.constEnd(); ++it) {
1668 if (generateIndexSection(writer, it.value(), context, state, post))
1669 writer.writeEndElement();
1674 if (!concepts.isEmpty()) {
1675 for (
auto it = concepts.constBegin(); it != concepts.constEnd(); ++it) {
1676 if (generateIndexSection(writer, it.value(), context, state, post))
1677 writer.writeEndElement();
1681 for (
auto *p : m_qdb->primaryTree()->proxies()) {
1682 if (generateIndexSection(writer, p, context, state, post)) {
1683 auto aggregate =
static_cast<Aggregate *>(p);
1684 generateFunctionSections(writer, aggregate, context, state, post);
1685 auto nonFunctionChildren = sortedNonFunctionChildren(aggregate);
1686 for (
auto *n : nonFunctionChildren)
1687 generateIndexSections(writer, n, context, state, post);
1688 writer.writeEndElement();
1693 writer.writeEndElement();
1698
1699
1700
1701
1702
1703
1704
1705void QDocIndexFiles::generateIndex(
const QString &fileName,
const QString &url,
1708 Q_ASSERT(context.documentLocation);
1710 QFile file(fileName);
1711 if (!file.open(QFile::WriteOnly | QFile::Text))
1714 qCDebug(lcQdoc) <<
"Writing index file:" << fileName;
1720 QXmlStreamWriter writer(&file);
1721 writer.setAutoFormatting(
true);
1722 writer.writeStartDocument();
1723 writer.writeDTD(
"<!DOCTYPE QDOCINDEX>");
1725 writer.writeStartElement(
"INDEX");
1726 writer.writeAttribute(
"url", url);
1727 writer.writeAttribute(
"title", title);
1728 writer.writeAttribute(
"version", m_qdb->version());
1729 writer.writeAttribute(
"project", context.project);
1731 writeNonEmpty(writer,
"indexTitle", state.root
->tree()->indexTitle());
1733 generateIndexSections(writer, state.root, context, state);
1735 writer.writeEndElement();
1736 writer.writeEndElement();
1737 writer.writeEndDocument();
NodeList nonFunctionChildren() const
Returns a copy of the child nodes of this aggregate that are not function nodes, in the order they ap...
void adoptChild(Node *child)
This Aggregate becomes the adoptive parent of child.
The Atom class is the fundamental unit for representing documents internally.
The ClassNode represents a C++ class.
bool hasTableOfContents() const
void markAutoGenerated()
Marks this documentation as auto-generated by QDoc.
QStringMultiMap * metaTagMap() const
void constructExtra() const
void setFlagsType(TypedefNode *typedefNode)
void addItem(const EnumItem &item)
Add item to the enum type's item list.
void setAnonymous(bool anonymous)
The ExternalPageNode represents an external documentation page.
This node is used to represent any kind of function being documented.
signed short overloadNumber() const
Returns the overload number for this function.
bool isPureVirtual() const override
bool isNonvirtual() const
bool isHiddenFriend() const
bool isAttached() const override
Returns true if the QML property or QML method node is marked as attached.
bool isDeletedAsWritten() const
bool isStatic() const override
Returns true if the FunctionNode represents a static function.
bool isExplicitlyDefaulted() const
Parameters & parameters()
bool hasAssociatedProperties() const
static bool isPubliclyVisible(const InclusionPolicy &policy, const NodeContext &context)
virtual void append(QXmlStreamWriter &writer, Node *node)=0
The Location class provides a way to mark a location in a file.
int lineNo() const
Returns the current line number.
Location & operator=(const Location &other)
The assignment operator does a deep copy of the entire state of other into this Location.
This class represents a C++ namespace.
Tree * tree() const override
Returns a pointer to the Tree that contains this NamespaceNode.
A PageNode is a Node that generates a documentation page.
The Parameter class describes one function parameter.
This class describes one instance of using the Q_PROPERTY macro.
A class for representing an Aggregate that is documented in a different module.
This class provides exclusive access to the qdoc database, which consists of a forrest of trees and a...
static QDocDatabase * qdocDB()
Creates the singleton.
const CNMap & qmlModules()
Returns a const reference to the collection of all QML module nodes in the primary tree.
NamespaceNode * primaryTreeRoot()
Returns a pointer to the root node of the primary tree.
const CNMap & modules()
Returns a const reference to the collection of all module nodes in the primary tree.
const CNMap & groups()
Returns a const reference to the collection of all group nodes in the primary tree.
This class imports QDoc index files and serializes index sections for module indexes and WebXML outpu...
Status
Specifies the status of the QQmlIncubator.
static Text sectionHeading(const Atom *sectionBegin)
static std::string comparisonCategoryAsString(ComparisonCategory category)
Metaness
Specifies the kind of function a FunctionNode represents.
Combined button and popup list for selecting options.
QMap< QString, CollectionNode * > CNMap
static QString getAccessString(Access t)
static NodeList sortedNonFunctionChildren(const Aggregate *aggregate)
static void writeExternalRelates(QXmlStreamWriter &writer, Node *node)
Writes the relatedto attribute for node using the writer, if node is related to aggregates in other m...
static QString getThreadSafenessString(Node::ThreadSafeness t)
static QString getStatusString(Status t)
static void writeNonEmpty(QXmlStreamWriter &writer, const QString &name, const QString &value)
Write an attribute to the current element using the writer for the attribute with the given name if t...
ExampleEntries exampleEntries
The Node class is the base class for all the nodes in QDoc's parse tree.
bool isExternalPage() const
Returns true if the node type is ExternalPage.
const Doc & doc() const
Returns a reference to the node's Doc data member.
bool isQmlNode() const
Returns true if this node's Genus value is QML.
bool isGroup() const
Returns true if the node type is Group.
void setAccess(Access t)
Sets the node's access type to t.
void setIndexNodeFlag(bool isIndexNode=true)
Sets a flag in this Node that indicates the node was created for something in an index file.
virtual bool isAbstract() const
Returns true if the ClassNode or QmlTypeNode is marked abstract.
SharedCommentNode * sharedCommentNode()
ComparisonCategory comparisonCategory() const
bool isQmlType() const
Returns true if the node type is QmlType or QmlValueType.
bool isHeader() const
Returns true if the node type is HeaderFile.
NodeType nodeType() const override
Returns this node's type.
Genus genus() const override
Returns this node's Genus.
virtual bool isPageNode() const
Returns true if this node represents something that generates a documentation page.
bool isEnumType() const
Returns true if the node type is Enum.
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, that is, the aggregate under which the node is documented.
void setLocation(const Location &t)
Sets the node's declaration location, its definition location, or both, depending on the suffix of th...
virtual bool isAggregate() const
Returns true if this node is an aggregate, which means it inherits Aggregate and can therefore have c...
virtual void setRelatedNonmember(bool b)
Sets a flag in the node indicating whether this node is a related nonmember of something.
void setComparisonCategory(const ComparisonCategory &category)
bool isProxyNode() const
Returns true if the node type is Proxy.
ThreadSafeness threadSafeness() const
Returns the thread safeness value for whatever this node represents.
virtual Tree * tree() const
Returns a pointer to the Tree this node is in.
const Location & declLocation() const
Returns the Location where this node's declaration was seen.
NodeContext createContext() const
void setDoc(const Doc &doc, bool replace=false)
Sets this Node's Doc to doc.
bool isModule() const
Returns true if the node type is Module.
virtual bool isPropertyGroup() const
Returns true if the node is a SharedCommentNode for documenting multiple C++ properties or multiple Q...
ThreadSafeness
An unsigned char that specifies the degree of thread-safeness of the element.
bool isSharingComment() const
This function returns true if the node is sharing a comment with other nodes.
virtual void setAbstract(bool)
If this node is a ClassNode or a QmlTypeNode, the node's abstract flag data member is set to b.
bool hasDoc() const
Returns true if this node is documented, or it represents a documented node read from the index ('had...
bool isRelatedNonmember() const
Returns true if this is a related nonmember of something.
virtual bool isClassNode() const
Returns true if this is an instance of ClassNode.
bool isCppNode() const
Returns true if this node's Genus value is CPP.
virtual void setStatus(Status t)
Sets the node's status to t.
virtual bool isCollectionNode() const
Returns true if this is an instance of CollectionNode.
void setThreadSafeness(ThreadSafeness t)
Sets the node's thread safeness to t.
bool isQmlModule() const
Returns true if the node type is QmlModule.
bool isExample() const
Returns true if the node type is Example.
bool isIndexNode() const
Returns true if this node was created from something in an index file.
static bool nodeLessThan(const Node *first, const Node *second)
Returns true if the node n1 is less than node n2.
const Parameter & at(int i) const
A record of a linkable target within the documentation.
TargetType
A type of a linkable target record.