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;
254 for (
const auto &entry : src.namespaces)
255 info.namespaces.append({entry.name, entry.href, entry.brief});
256 for (
const auto &entry : src.classes)
257 info.classes.append({entry.name, entry.href, entry.brief});
258 for (
const auto &entry : src.members)
259 info.members.append({entry.name, entry.href, entry.brief});
261 ir.collectionInfo =
std::move(info);
264 if (pm.cppReferenceData) {
265 const auto &src = *pm.cppReferenceData;
268 info.headerInclude = src.headerInclude;
269 info.cmakeFindPackage = src.cmakeFindPackage;
270 info.cmakeTargetLinkLibraries = src.cmakeTargetLinkLibraries;
271 info.qmakeVariable = src.qmakeVariable;
272 info.statusText = src.statusText;
273 info.statusCssClass = src.statusCssClass;
275 if (src.qmlNativeType)
277 src.qmlNativeType->name, src.qmlNativeType->href};
279 for (
const auto &bc : src.baseClasses)
280 info.baseClasses.append({bc.name, bc.href, bc.access});
281 for (
const auto &dc : src.derivedClasses)
282 info.derivedClasses.append({dc.name, dc.href});
285 info.templateDeclSpans = src.templateDeclSpans;
292 info.fullNamespaceHref = src.fullNamespaceHref;
293 info.fullNamespaceModuleName = src.fullNamespaceModuleName;
295 info.typeWord = src.typeWord;
296 info.ancestorNames = src.ancestorNames;
298 info.selfComparisonCategory = src.selfComparisonCategory;
299 for (
const auto &ce : src.comparisonEntries)
300 info.comparisonEntries.append({ce.category, ce.comparableTypes, ce.description});
302 if (src.threadSafety) {
304 ts.level = src.threadSafety->level;
305 for (
const auto &e : src.threadSafety->reentrantExceptions)
306 ts.reentrantExceptions.append({e.name, e.href});
307 for (
const auto &e : src.threadSafety->threadSafeExceptions)
308 ts.threadSafeExceptions.append({e.name, e.href});
309 for (
const auto &e : src.threadSafety->nonReentrantExceptions)
310 ts.nonReentrantExceptions.append({e.name, e.href});
311 info.threadSafety =
std::move(ts);
312 info.threadSafetyAdmonition = buildThreadSafetyAdmonition(
313 *src.threadSafety, src.typeWord);
316 for (
const auto &g : src.groups)
317 info.groups.append({g.name, g.href});
325 ir.cppReferenceInfo =
std::move(info);
329 const auto &src = pm.navigationData;
331 for (
const auto &bc : src.breadcrumbs) {
332 NavigationInfo::BreadcrumbEntry entry;
333 entry.title = bc.title;
334 entry.href = bc.href;
336 case NavigationData::CrumbState::Link:
337 entry.state = NavigationInfo::CrumbState::Link;
339 case NavigationData::CrumbState::Current:
340 entry.state = NavigationInfo::CrumbState::Current;
342 case NavigationData::CrumbState::Unresolved:
343 entry.state = NavigationInfo::CrumbState::Unresolved;
346 info.breadcrumbs.append(std::move(entry));
348 if (src.previousLink)
350 src.previousLink->title, src.previousLink->href};
353 src.nextLink->title, src.nextLink->href};
356 src.startLink->title, src.startLink->href};
363 for (
const auto &s : ir.summarySections) {
364 if (!s.title.isEmpty() && !s.id.isEmpty())
365 info.tocEntries.append({s.title, s.id, 2});
367 if ((ir.cppReferenceInfo || ir.qmlTypeInfo) && !ir.body.isEmpty())
368 info.tocEntries.append(
369 {u"Detailed Description"_s, u"details"_s, 2});
370 gatherBodyTocEntries(ir.body, info.tocEntries);
371 for (
const auto &s : ir.detailSections) {
372 if (!s.title.isEmpty() && !s.id.isEmpty())
373 info.tocEntries.append({s.title, s.id, 2});
376 const bool hasAnyNavigation = !info.breadcrumbs.isEmpty()
377 || info.previousLink || info.nextLink || info.startLink
378 || !info.tocEntries.isEmpty() || info
.tocDepth != -1;
379 if (hasAnyNavigation)
380 ir.navigationInfo =
std::move(info);
388 QStringList paragraphs;
389 for (
const auto &block : ir.body) {
390 const QString text = block.plainText();
392 paragraphs.append(text);
394 const QString joined = paragraphs.join(
"\n\n"_L1);
395 if (!joined.isEmpty())
396 ir.contentJson[
"text"_L1] = joined;