![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
Pure string helpers with no dependencies on QDoc driver types. More...
Functions | |
| QString | separator (qsizetype wordPosition, qsizetype numberOfWords) |
| QString | comma (qsizetype wordPosition, qsizetype numberOfWords) |
| QString | asAsciiPrintable (const QString &str) |
| Returns an ASCII-printable representation of str. | |
| QString | protect (const QString &string) |
Variables | |
| static constexpr QLatin1StringView | samp = "&"_L1 |
| static constexpr QLatin1StringView | slt = "<"_L1 |
| static constexpr QLatin1StringView | sgt = ">"_L1 |
| static constexpr QLatin1StringView | squot = """_L1 |
Pure string helpers with no dependencies on QDoc driver types.
TextUtils groups text-manipulation helpers that the IR builders, the template generator, and the legacy generators all need, but that do not touch Node, Tree, Config, or Generator. Keeping them here lets QDocLib components call them without dragging in the rest of QDoc.
Returns an ASCII-printable representation of str.
Replaces non-ASCII-printable characters in str from a subset of such characters. The subset includes alphanumeric (alnum) characters ([a-zA-Z0-9]), space, punctuation characters, and common symbols. Non-alnum characters in this subset are replaced by a single hyphen. Leading, trailing, and consecutive hyphens are removed, such that the resulting string does not start or end with a hyphen. All characters are converted to lowercase.
If any character in str is non-latin, or latin and not found in the aforementioned subset (e.g. 'ß', 'å', or 'ö'), a hash of str is appended to the final string.
Returns a string that is normalized for use where ASCII-printable strings are required, such as file names or fragment identifiers in URLs.
Definition at line 80 of file textutils.cpp.
Returns the inter-item punctuation for a list of numberOfWords words at wordPosition.
For a list of length one, returns an empty QString. For a list of length two, returns " and ". For longer lists, returns ", " for early items and ", and " for the item before the last. The last position returns an empty QString; its punctuation is the period returned by separator().
Definition at line 51 of file textutils.cpp.
HTML-escapes the ampersand, less-than, greater-than, and double-quote characters in str, leaving other characters untouched.
Definition at line 127 of file textutils.cpp.
Returns the punctuation character for the word at wordPosition in a list of numberOfWords length. For the last position, returns "." (full stop). For any other word, delegates to comma().
Definition at line 30 of file textutils.cpp.
|
staticconstexpr |
Definition at line 37 of file textutils.h.
|
staticconstexpr |
Definition at line 39 of file textutils.h.
|
staticconstexpr |
Definition at line 38 of file textutils.h.
|
staticconstexpr |
Definition at line 40 of file textutils.h.