109 const QString &typeWord)
111 QList<InlineContent> inlines;
112 const bool hasExceptions = !ts.reentrantExceptions.isEmpty()
113 || ts.threadSafeExceptions.isEmpty() ==
false
114 || !ts.nonReentrantExceptions.isEmpty();
116 if (ts.level ==
"non-reentrant"_L1) {
117 inlines.append(makeTextInline(
"This "_L1 + typeWord +
" is not "_L1));
118 inlines.append(makeTopicLink(
"reentrant"_L1));
119 inlines.append(makeTextInline(
"."_L1));
120 appendExceptionList(inlines,
" These functions are "_L1,
"reentrant"_L1,
121 ts.reentrantExceptions);
122 }
else if (ts.level ==
"reentrant"_L1) {
123 inlines.append(makeTextInline(
"All functions in this "_L1 + typeWord +
" are "_L1));
124 inlines.append(makeTopicLink(
"reentrant"_L1));
125 const bool hasThreadSafe = !ts.threadSafeExceptions.isEmpty();
126 if (hasExceptions && !hasThreadSafe)
127 inlines.append(makeTextInline(
" with the following exceptions:"_L1));
129 inlines.append(makeTextInline(
"."_L1));
130 appendExceptionList(inlines,
" These functions are not "_L1,
"reentrant"_L1,
131 ts.nonReentrantExceptions);
132 appendExceptionList(inlines,
" These functions are also "_L1,
"thread-safe"_L1,
133 ts.threadSafeExceptions);
134 }
else if (ts.level ==
"thread-safe"_L1) {
135 inlines.append(makeTextInline(
"All functions in this "_L1 + typeWord +
" are "_L1));
136 inlines.append(makeTopicLink(
"thread-safe"_L1));
138 inlines.append(makeTextInline(
" with the following exceptions:"_L1));
140 inlines.append(makeTextInline(
"."_L1));
141 appendExceptionList(inlines,
" These functions are only "_L1,
"reentrant"_L1,
142 ts.reentrantExceptions);
143 appendExceptionList(inlines,
" These functions are not "_L1,
"reentrant"_L1,
144 ts.nonReentrantExceptions);
149 block.inlineContent =
std::move(inlines);
205 ir.title =
std::move(pm.title);
206 ir.fullTitle =
std::move(pm.fullTitle);
207 ir.url =
std::move(pm.url);
208 ir.since =
std::move(pm.since);
209 ir.deprecatedSince =
std::move(pm.deprecatedSince);
210 ir.typeNoun =
std::move(pm.typeNoun);
211 ir.deprecatedSinceQualified =
std::move(pm.deprecatedSinceQualified);
212 ir.deprecationNote =
std::move(pm.deprecationNote);
213 ir.brief =
std::move(pm.brief);
215 ir.body =
std::move(pm.body);
216 ir.summarySections =
std::move(pm.summarySections);
217 ir.detailSections =
std::move(pm.detailSections);
219 if (pm.qmlTypeData) {
220 const auto &src = *pm.qmlTypeData;
222 info.importStatement = src.importStatement;
229 src.inherits->name, src.inherits->href, src.inherits->moduleName
233 for (
const auto &entry : src.inheritedBy)
234 info.inheritedBy.append({entry.name, entry.href});
239 ir.qmlTypeInfo =
std::move(info);
242 if (pm.collectionData) {
243 const auto &src = *pm.collectionData;
245 info.logicalModuleName = src.logicalModuleName;
246 info.logicalModuleVersion = src.logicalModuleVersion;
247 info.qtVariable = src.qtVariable;
248 info.cmakePackage = src.cmakePackage;
249 info.cmakeComponent = src.cmakeComponent;
250 info.cmakeTargetItem = src.cmakeTargetItem;
251 info.state = src.state;
259 for (
const auto &entry : src.namespaces)
260 info.namespaces.append({entry.name, entry.href, entry.brief});
261 for (
const auto &entry : src.classes)
262 info.classes.append({entry.name, entry.href, entry.brief});
263 for (
const auto &entry : src.members)
264 info.members.append({entry.name, entry.href, entry.brief});
266 ir.collectionInfo =
std::move(info);
269 if (pm.cppReferenceData) {
270 const auto &src = *pm.cppReferenceData;
273 info.headerInclude = src.headerInclude;
274 info.cmakeFindPackage = src.cmakeFindPackage;
275 info.cmakeTargetLinkLibraries = src.cmakeTargetLinkLibraries;
276 info.qmakeVariable = src.qmakeVariable;
277 info.statusText = src.statusText;
278 info.statusCssClass = src.statusCssClass;
280 if (src.qmlNativeType)
282 src.qmlNativeType->name, src.qmlNativeType->href};
284 for (
const auto &bc : src.baseClasses)
285 info.baseClasses.append({bc.name, bc.href, bc.access});
286 for (
const auto &dc : src.derivedClasses)
287 info.derivedClasses.append({dc.name, dc.href});
290 info.templateDeclSpans = src.templateDeclSpans;
291 info.referencedConcepts = src.referencedConcepts;
298 info.fullNamespaceHref = src.fullNamespaceHref;
299 info.fullNamespaceModuleName = src.fullNamespaceModuleName;
301 info.typeWord = src.typeWord;
302 info.ancestorNames = src.ancestorNames;
304 info.selfComparisonCategory = src.selfComparisonCategory;
305 for (
const auto &ce : src.comparisonEntries)
306 info.comparisonEntries.append({ce.category, ce.comparableTypes, ce.description});
308 if (src.threadSafety) {
310 ts.level = src.threadSafety->level;
311 for (
const auto &e : src.threadSafety->reentrantExceptions)
312 ts.reentrantExceptions.append({e.name, e.href});
313 for (
const auto &e : src.threadSafety->threadSafeExceptions)
314 ts.threadSafeExceptions.append({e.name, e.href});
315 for (
const auto &e : src.threadSafety->nonReentrantExceptions)
316 ts.nonReentrantExceptions.append({e.name, e.href});
317 info.threadSafety =
std::move(ts);
318 info.threadSafetyAdmonition = buildThreadSafetyAdmonition(
319 *src.threadSafety, src.typeWord);
322 for (
const auto &g : src.groups)
323 info.groups.append({g.name, g.href});
331 ir.cppReferenceInfo =
std::move(info);
335 const auto &src = pm.navigationData;
337 for (
const auto &bc : src.breadcrumbs) {
338 NavigationInfo::BreadcrumbEntry entry;
339 entry.title = bc.title;
340 entry.href = bc.href;
342 case NavigationData::CrumbState::Link:
343 entry.state = NavigationInfo::CrumbState::Link;
345 case NavigationData::CrumbState::Current:
346 entry.state = NavigationInfo::CrumbState::Current;
348 case NavigationData::CrumbState::Unresolved:
349 entry.state = NavigationInfo::CrumbState::Unresolved;
352 info.breadcrumbs.append(std::move(entry));
354 if (src.previousLink)
356 src.previousLink->title, src.previousLink->href};
359 src.nextLink->title, src.nextLink->href};
362 src.startLink->title, src.startLink->href};
369 for (
const auto &s : ir.summarySections) {
370 if (!s.title.isEmpty() && !s.id.isEmpty())
371 info.tocEntries.append({s.title, s.id, 2});
373 if ((ir.cppReferenceInfo || ir.qmlTypeInfo) && !ir.body.isEmpty())
374 info.tocEntries.append(
375 {u"Detailed Description"_s, u"details"_s, 2});
376 gatherBodyTocEntries(ir.body, info.tocEntries);
377 for (
const auto &s : ir.detailSections) {
378 if (!s.title.isEmpty() && !s.id.isEmpty())
379 info.tocEntries.append({s.title, s.id, 2});
382 const bool hasAnyNavigation = !info.breadcrumbs.isEmpty()
383 || info.previousLink || info.nextLink || info.startLink
384 || !info.tocEntries.isEmpty() || info
.tocDepth != -1;
385 if (hasAnyNavigation)
386 ir.navigationInfo =
std::move(info);
394 QStringList paragraphs;
395 for (
const auto &block : ir.body) {
396 const QString text = block.plainText();
398 paragraphs.append(text);
400 const QString joined = paragraphs.join(
"\n\n"_L1);
401 if (!joined.isEmpty())
402 ir.contentJson[
"text"_L1] = joined;