8#include <QtCore/qregularexpression.h>
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
214
215
216
217
220
221
222
223
224
227
228
229
230
231
234
235
236
237
238
241
242
243
246
247
254
255
256
257
258
259
260
261
262
277
278
279
280
284 while (a && (a
->type() != t || a->string() != s))
290
291
292
295
296
297
304
305
306
313
314
315
318
319
320
323
324
325
326
327
328
329
332 static bool deja =
false;
336 while (atms[i]
.english !=
nullptr) {
338 Location::internalError(QStringLiteral(
"QDoc::Atom: atom %1 missing").arg(i));
344 int i =
static_cast<
int>(
type());
345 if (i < 0 || i >
static_cast<
int>(
Last))
346 return QLatin1String(
"Invalid");
347 return QLatin1String(atms[i]
.english);
351
352
353
354
355
356
359
360
361
370 result += atom->string();
380
381
382
383
384
385
386
387
394 resolveSquareBracketParams(p2);
398
399
400
401
402
403
411 resolveSquareBracketParams(p2);
415
416
417
420 m_squareBracketParams = text.toLower().split(QLatin1Char(
' '));
421 for (
const auto ¶m : m_squareBracketParams) {
423 m_domain = QDocDatabase::qdocDB()->findTree(param);
429 if (param ==
"qml") {
430 m_genus = Genus::QML;
433 if (param ==
"cpp") {
434 m_genus = Genus::CPP;
437 if (param ==
"doc") {
438 m_genus = Genus::DOC;
441 if (param ==
"api") {
442 m_genus = Genus::API;
450
451
454 return new LinkAtom
(*
this);
460 if (m_squareBracketParams.contains(
"attached"))
#define ATOM_FORMATTING_LINK
The Atom class is the fundamental unit for representing documents internally.
AtomType type() const
Return the type of this atom.
AtomType
\value AnnotatedList \value AutoLink \value BaseName \value BriefLeft \value BriefRight \value C \val...
const Atom * next(AtomType t, const QString &s) const
Return the next Atom in the list if it is of AtomType t and its string part is s.
QString linkText() const
For a link atom, returns the string representing the link text if one exist in the list of atoms.
virtual Atom * clone() const
Creates and returns a detached copy of this Atom.
const Atom * next() const
Return the next atom in the atom list.
const Atom * next(AtomType t) const
Return the next Atom in the list if it is of AtomType t.
const Atom * find(AtomType t, qsizetype *offset=nullptr) const
Starting from this Atom, searches the linked list for the atom of specified type t and returns it.
const Atom * find(AtomType t, const QString &s) const
Starting from this Atom, searches the linked list for the atom of specified type t and string s,...
QString typeString() const
Return the type of this atom as a string.
LinkAtom * clone() const override
Creates and returns a detached copy of this LinkAtom.
virtual int flags() const override
LinkAtom(Atom::AtomType type, const QString &p1, const QString &p2, Location location=Location())
Constructs a LinkAtom carrying an explicit atom type.
LinkAtom(const QString &p1, const QString &p2, Location location=Location())
Constructs a LinkAtom of type Atom::Link.
void resolveSquareBracketParams(const QString &text) override
Resolves the parameters that were enclosed in square brackets, supplied as text, setting the domain a...
LinkAtom(const LinkAtom &)=default
The Location class provides a way to mark a location in a file.
Combined button and popup list for selecting options.