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.brief =
std::move(pm.brief);
214 ir.body =
std::move(pm.body);
215 ir.summarySections =
std::move(pm.summarySections);
216 ir.detailSections =
std::move(pm.detailSections);
218 if (pm.qmlTypeData) {
219 const auto &src = *pm.qmlTypeData;
221 info.importStatement = src.importStatement;
228 src.inherits->name, src.inherits->href, src.inherits->moduleName
232 for (
const auto &entry : src.inheritedBy)
233 info.inheritedBy.append({entry.name, entry.href});
238 ir.qmlTypeInfo =
std::move(info);
241 if (pm.collectionData) {
242 const auto &src = *pm.collectionData;
244 info.logicalModuleName = src.logicalModuleName;
245 info.logicalModuleVersion = src.logicalModuleVersion;
246 info.qtVariable = src.qtVariable;
247 info.cmakePackage = src.cmakePackage;
248 info.cmakeComponent = src.cmakeComponent;
249 info.cmakeTargetItem = src.cmakeTargetItem;
250 info.state = src.state;
258 for (
const auto &entry : src.namespaces)
259 info.namespaces.append({entry.name, entry.href, entry.brief});
260 for (
const auto &entry : src.classes)
261 info.classes.append({entry.name, entry.href, entry.brief});
262 for (
const auto &entry : src.members)
263 info.members.append({entry.name, entry.href, entry.brief});
265 ir.collectionInfo =
std::move(info);
268 if (pm.cppReferenceData) {
269 const auto &src = *pm.cppReferenceData;
272 info.headerInclude = src.headerInclude;
273 info.cmakeFindPackage = src.cmakeFindPackage;
274 info.cmakeTargetLinkLibraries = src.cmakeTargetLinkLibraries;
275 info.qmakeVariable = src.qmakeVariable;
276 info.statusText = src.statusText;
277 info.statusCssClass = src.statusCssClass;
279 if (src.qmlNativeType)
281 src.qmlNativeType->name, src.qmlNativeType->href};
283 for (
const auto &bc : src.baseClasses)
284 info.baseClasses.append({bc.name, bc.href, bc.access});
285 for (
const auto &dc : src.derivedClasses)
286 info.derivedClasses.append({dc.name, dc.href});
289 info.templateDeclSpans = src.templateDeclSpans;
290 info.referencedConcepts = src.referencedConcepts;
297 info.fullNamespaceHref = src.fullNamespaceHref;
298 info.fullNamespaceModuleName = src.fullNamespaceModuleName;
300 info.typeWord = src.typeWord;
301 info.ancestorNames = src.ancestorNames;
303 info.selfComparisonCategory = src.selfComparisonCategory;
304 for (
const auto &ce : src.comparisonEntries)
305 info.comparisonEntries.append({ce.category, ce.comparableTypes, ce.description});
307 if (src.threadSafety) {
309 ts.level = src.threadSafety->level;
310 for (
const auto &e : src.threadSafety->reentrantExceptions)
311 ts.reentrantExceptions.append({e.name, e.href});
312 for (
const auto &e : src.threadSafety->threadSafeExceptions)
313 ts.threadSafeExceptions.append({e.name, e.href});
314 for (
const auto &e : src.threadSafety->nonReentrantExceptions)
315 ts.nonReentrantExceptions.append({e.name, e.href});
316 info.threadSafety =
std::move(ts);
317 info.threadSafetyAdmonition = buildThreadSafetyAdmonition(
318 *src.threadSafety, src.typeWord);
321 for (
const auto &g : src.groups)
322 info.groups.append({g.name, g.href});
330 ir.cppReferenceInfo =
std::move(info);
334 const auto &src = pm.navigationData;
336 for (
const auto &bc : src.breadcrumbs) {
337 NavigationInfo::BreadcrumbEntry entry;
338 entry.title = bc.title;
339 entry.href = bc.href;
341 case NavigationData::CrumbState::Link:
342 entry.state = NavigationInfo::CrumbState::Link;
344 case NavigationData::CrumbState::Current:
345 entry.state = NavigationInfo::CrumbState::Current;
347 case NavigationData::CrumbState::Unresolved:
348 entry.state = NavigationInfo::CrumbState::Unresolved;
351 info.breadcrumbs.append(std::move(entry));
353 if (src.previousLink)
355 src.previousLink->title, src.previousLink->href};
358 src.nextLink->title, src.nextLink->href};
361 src.startLink->title, src.startLink->href};
368 for (
const auto &s : ir.summarySections) {
369 if (!s.title.isEmpty() && !s.id.isEmpty())
370 info.tocEntries.append({s.title, s.id, 2});
372 if ((ir.cppReferenceInfo || ir.qmlTypeInfo) && !ir.body.isEmpty())
373 info.tocEntries.append(
374 {u"Detailed Description"_s, u"details"_s, 2});
375 gatherBodyTocEntries(ir.body, info.tocEntries);
376 for (
const auto &s : ir.detailSections) {
377 if (!s.title.isEmpty() && !s.id.isEmpty())
378 info.tocEntries.append({s.title, s.id, 2});
381 const bool hasAnyNavigation = !info.breadcrumbs.isEmpty()
382 || info.previousLink || info.nextLink || info.startLink
383 || !info.tocEntries.isEmpty() || info
.tocDepth != -1;
384 if (hasAnyNavigation)
385 ir.navigationInfo =
std::move(info);
393 QStringList paragraphs;
394 for (
const auto &block : ir.body) {
395 const QString text = block.plainText();
397 paragraphs.append(text);
399 const QString joined = paragraphs.join(
"\n\n"_L1);
400 if (!joined.isEmpty())
401 ir.contentJson[
"text"_L1] = joined;