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.brief =
std::move(pm.brief);
212 ir.body =
std::move(pm.body);
213 ir.summarySections =
std::move(pm.summarySections);
214 ir.detailSections =
std::move(pm.detailSections);
216 if (pm.qmlTypeData) {
217 const auto &src = *pm.qmlTypeData;
219 info.importStatement = src.importStatement;
225 src.inherits->name, src.inherits->href, src.inherits->moduleName
229 for (
const auto &entry : src.inheritedBy)
230 info.inheritedBy.append({entry.name, entry.href});
235 ir.qmlTypeInfo =
std::move(info);
238 if (pm.collectionData) {
239 const auto &src = *pm.collectionData;
241 info.logicalModuleName = src.logicalModuleName;
242 info.logicalModuleVersion = src.logicalModuleVersion;
243 info.qtVariable = src.qtVariable;
244 info.cmakePackage = src.cmakePackage;
245 info.cmakeComponent = src.cmakeComponent;
246 info.cmakeTargetItem = src.cmakeTargetItem;
247 info.state = src.state;
255 for (
const auto &entry : src.namespaces)
256 info.namespaces.append({entry.name, entry.href, entry.brief});
257 for (
const auto &entry : src.classes)
258 info.classes.append({entry.name, entry.href, entry.brief});
259 for (
const auto &entry : src.members)
260 info.members.append({entry.name, entry.href, entry.brief});
262 ir.collectionInfo =
std::move(info);
265 if (pm.cppReferenceData) {
266 const auto &src = *pm.cppReferenceData;
269 info.headerInclude = src.headerInclude;
270 info.cmakeFindPackage = src.cmakeFindPackage;
271 info.cmakeTargetLinkLibraries = src.cmakeTargetLinkLibraries;
272 info.qmakeVariable = src.qmakeVariable;
273 info.statusText = src.statusText;
274 info.statusCssClass = src.statusCssClass;
276 if (src.qmlNativeType)
278 src.qmlNativeType->name, src.qmlNativeType->href};
280 for (
const auto &bc : src.baseClasses)
281 info.baseClasses.append({bc.name, bc.href, bc.access});
282 for (
const auto &dc : src.derivedClasses)
283 info.derivedClasses.append({dc.name, dc.href});
286 info.templateDeclSpans = src.templateDeclSpans;
287 info.referencedConcepts = src.referencedConcepts;
294 info.fullNamespaceHref = src.fullNamespaceHref;
295 info.fullNamespaceModuleName = src.fullNamespaceModuleName;
297 info.typeWord = src.typeWord;
298 info.ancestorNames = src.ancestorNames;
300 info.selfComparisonCategory = src.selfComparisonCategory;
301 for (
const auto &ce : src.comparisonEntries)
302 info.comparisonEntries.append({ce.category, ce.comparableTypes, ce.description});
304 if (src.threadSafety) {
306 ts.level = src.threadSafety->level;
307 for (
const auto &e : src.threadSafety->reentrantExceptions)
308 ts.reentrantExceptions.append({e.name, e.href});
309 for (
const auto &e : src.threadSafety->threadSafeExceptions)
310 ts.threadSafeExceptions.append({e.name, e.href});
311 for (
const auto &e : src.threadSafety->nonReentrantExceptions)
312 ts.nonReentrantExceptions.append({e.name, e.href});
313 info.threadSafety =
std::move(ts);
314 info.threadSafetyAdmonition = buildThreadSafetyAdmonition(
315 *src.threadSafety, src.typeWord);
318 for (
const auto &g : src.groups)
319 info.groups.append({g.name, g.href});
327 ir.cppReferenceInfo =
std::move(info);
331 const auto &src = pm.navigationData;
333 for (
const auto &bc : src.breadcrumbs) {
334 NavigationInfo::BreadcrumbEntry entry;
335 entry.title = bc.title;
336 entry.href = bc.href;
338 case NavigationData::CrumbState::Link:
339 entry.state = NavigationInfo::CrumbState::Link;
341 case NavigationData::CrumbState::Current:
342 entry.state = NavigationInfo::CrumbState::Current;
344 case NavigationData::CrumbState::Unresolved:
345 entry.state = NavigationInfo::CrumbState::Unresolved;
348 info.breadcrumbs.append(std::move(entry));
350 if (src.previousLink)
352 src.previousLink->title, src.previousLink->href};
355 src.nextLink->title, src.nextLink->href};
358 src.startLink->title, src.startLink->href};
365 for (
const auto &s : ir.summarySections) {
366 if (!s.title.isEmpty() && !s.id.isEmpty())
367 info.tocEntries.append({s.title, s.id, 2});
369 if ((ir.cppReferenceInfo || ir.qmlTypeInfo) && !ir.body.isEmpty())
370 info.tocEntries.append(
371 {u"Detailed Description"_s, u"details"_s, 2});
372 gatherBodyTocEntries(ir.body, info.tocEntries);
373 for (
const auto &s : ir.detailSections) {
374 if (!s.title.isEmpty() && !s.id.isEmpty())
375 info.tocEntries.append({s.title, s.id, 2});
378 const bool hasAnyNavigation = !info.breadcrumbs.isEmpty()
379 || info.previousLink || info.nextLink || info.startLink
380 || !info.tocEntries.isEmpty() || info
.tocDepth != -1;
381 if (hasAnyNavigation)
382 ir.navigationInfo =
std::move(info);
390 QStringList paragraphs;
391 for (
const auto &block : ir.body) {
392 const QString text = block.plainText();
394 paragraphs.append(text);
396 const QString joined = paragraphs.join(
"\n\n"_L1);
397 if (!joined.isEmpty())
398 ir.contentJson[
"text"_L1] = joined;