Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <text.h>
Public Member Functions | |
Text () | |
Text (const QString &str) | |
Text (const Text &text) | |
~Text () | |
Text & | operator= (const Text &text) |
Atom * | firstAtom () |
Atom * | lastAtom () |
Text & | operator<< (Atom::AtomType atomType) |
Text & | operator<< (const QString &string) |
Text & | operator<< (const Atom &atom) |
Text & | operator<< (const LinkAtom &atom) |
Special output operator for LinkAtom. | |
Text & | operator<< (const Text &text) |
void | stripFirstAtom () |
void | stripLastAtom () |
bool | isEmpty () const |
bool | contains (const QString &str) const |
Returns true if this Text contains the substring str. | |
QString | toString () const |
This function traverses the atom list of the Text object, extracting all the string parts. | |
const Atom * | firstAtom () const |
const Atom * | lastAtom () const |
Text | subText (Atom::AtomType left, Atom::AtomType right, const Atom *from=nullptr, bool inclusive=false) const |
void | dump () const |
Prints a human-readable version of the contained atoms to stderr. | |
void | clear () |
Text | splitAtFirst (Atom::AtomType start) |
Splits the current Text from start to end into a new Text object. | |
Static Public Member Functions | |
static Text | subText (const Atom *begin, const Atom *end=nullptr) |
static Text | sectionHeading (const Atom *sectionBegin) |
static int | compare (const Text &text1, const Text &text2) |
QT_BEGIN_NAMESPACE Text::Text | ( | ) |
Definition at line 12 of file text.cpp.
Referenced by Doc::legaleseText(), sectionHeading(), and splitAtFirst().
Text::Text | ( | const Text & | text | ) |
Definition at line 19 of file text.cpp.
References operator=().
Text::~Text | ( | ) |
void Text::clear | ( | ) |
Definition at line 269 of file text.cpp.
References Atom::next().
Referenced by ~Text(), Generator::generateThreadSafeness(), and operator=().
Definition at line 280 of file text.cpp.
References firstAtom(), isEmpty(), lastAtom(), Atom::next(), and Atom::type().
Referenced by operator!=(), operator<(), operator<=(), operator==(), operator>(), and operator>=().
|
nodiscard |
Returns true if this Text contains the substring str.
Definition at line 140 of file text.cpp.
References Atom::AutoLink, Atom::C, firstAtom(), Atom::next(), Atom::String, and Atom::type().
void Text::dump | ( | ) | const |
Prints a human-readable version of the contained atoms to stderr.
The output is formatted as a linear list of atoms, with each atom being on its own line.
Each atom is represented by its type and its stringified-contents, if any, with a space between the two.
Indentation is used to emphasize the possible block-level relationship between consecutive atoms, increasing after a "Left" atom and decreasing just before a "Right" atom.
For example, if this Text
represented the block-comment containing the text:
{\l
{somelink} {This is a link}}
Then the human-readable output would look like the following:
\badcode ParaLeft Link "somelink" FormattingLeft "link" String "This is a link" FormattingRight "link" String ParaRight
Definition at line 225 of file text.cpp.
References firstAtom(), and Atom::next().
Referenced by Doc::Doc().
|
inline |
Definition at line 21 of file text.h.
Referenced by processComparesWithCommand(), and Doc::trimmedBriefText().
|
inlinenodiscard |
Definition at line 34 of file text.h.
Referenced by WebXMLGenerator::append(), compare(), contains(), dump(), DocBookGenerator::generateText(), Generator::generateText(), operator<<(), subText(), and toString().
|
inlinenodiscard |
Definition at line 31 of file text.h.
Referenced by compare(), Generator::generateComparisonList(), Generator::generateEnumValuesForQmlProperty(), DocBookGenerator::generateHeader(), and writeDescription().
|
inline |
Definition at line 22 of file text.h.
Referenced by DocBookGenerator::generateHeader(), and DocParser::parse().
|
inlinenodiscard |
Text & Text::operator<< | ( | Atom::AtomType | atomType | ) |
Definition at line 48 of file text.cpp.
References Atom::type().
Special output operator for LinkAtom.
It makes a copy of the LinkAtom atom and connects the cop;y to the list in this Text.
Definition at line 71 of file text.cpp.
References LinkAtom::LinkAtom(), and LinkAtom::LinkAtom().
Definition at line 43 of file text.cpp.
References Atom::String.
Definition at line 81 of file text.cpp.
References firstAtom(), and Atom::next().
Definition at line 29 of file text.cpp.
References clear().
Referenced by Text(), and DocBookGenerator::generateHeader().
Definition at line 176 of file text.cpp.
References Text(), Atom::next(), Atom::SectionHeadingLeft, Atom::SectionHeadingRight, subText(), and Atom::type().
Referenced by WebXMLGenerator::addAtomElements(), and Tree::refForAtom().
|
nodiscard |
Splits the current Text from start to end into a new Text object.
Returns a new Text from the first Atom in this Text of atom type start.
Definition at line 313 of file text.cpp.
References Text(), Atom::next(), Atom::setNext(), and Atom::type().
Referenced by processComparesWithCommand().
void Text::stripFirstAtom | ( | ) |
Definition at line 91 of file text.cpp.
References Atom::next().
Referenced by DocParser::parse().
void Text::stripLastAtom | ( | ) |
Definition at line 102 of file text.cpp.
References Atom::next(), and Atom::setNext().
Text Text::subText | ( | Atom::AtomType | left, |
Atom::AtomType | right, | ||
const Atom * | from = nullptr, | ||
bool | inclusive = false ) const |
Definition at line 153 of file text.cpp.
References firstAtom(), Atom::next(), subText(), and Atom::type().
Referenced by Doc::briefText(), and Doc::legaleseText().
Definition at line 257 of file text.cpp.
References Atom::next().
Referenced by sectionHeading(), and subText().
|
nodiscard |
This function traverses the atom list of the Text object, extracting all the string parts.
It concatenates them to a result string and returns it.
Definition at line 124 of file text.cpp.
References Atom::AutoLink, Atom::C, firstAtom(), Atom::next(), Atom::String, and Atom::type().