21#ifndef CUTELEE_SAFESTRING_H
22#define CUTELEE_SAFESTRING_H
24#include "cutelee_templates_export.h"
26#include <QtCore/QString>
27#include <QtCore/QVariant>
136 void setNeedsEscape(
bool needsEscape);
142 bool needsEscape()
const;
153 void setSafety(Safety safety);
175#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 2)
179#ifndef QT_NO_CAST_FROM_ASCII
184 return *m_safeString;
191 return *m_safeString;
211 QChar::UnicodeVersion version)
const;
216#ifndef QT_NO_CAST_FROM_ASCII
221 return *m_safeString;
228 return *m_safeString;
305#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
307 QString::SplitBehavior behavior = QString::KeepEmptyParts,
310 QString::SplitBehavior behavior = QString::KeepEmptyParts,
312 QStringList split(
const QChar &sep, QString::SplitBehavior behavior = QString::KeepEmptyParts,
315 QString::SplitBehavior behavior = QString::KeepEmptyParts)
const;
350 operator QString()
const {
return m_nestedString; }
390 bool operator==(
const SafeString &other)
const;
397 bool operator==(
const QString &other)
const;
406 NestedString m_nestedString;
The NestedString is a QString whose methods always return a SafeString.
A QString wrapper class for containing whether a string is safe or needs to be escaped.
const NestedString & get() const
@ IsSafe
The string is safe and requires no further escaping.
The Cutelee namespace holds all public Cutelee API.
QString & append(QChar ch)
QString & fill(QChar ch, qsizetype size)
QString & insert(qsizetype position, QChar ch)
QString left(qsizetype n) &&
QString leftJustified(qsizetype width, QChar fill, bool truncate) const const
QString mid(qsizetype position, qsizetype n) &&
QString normalized(QString::NormalizationForm mode, int version) const const
QString & prepend(QChar ch)
void push_front(QChar ch)
QString & remove(QChar ch, Qt::CaseSensitivity cs)
QString repeated(qsizetype times) const const
QString & replace(QChar before, QChar after, Qt::CaseSensitivity cs)
QString right(qsizetype n) &&
QString rightJustified(qsizetype width, QChar fill, bool truncate) const const
QString section(QChar sep, qsizetype start, qsizetype end, QString::SectionFlags flags) const const
QString & setNum(double n, char format, int precision)
QString & setUnicode(const QChar *unicode, qsizetype size)
QString & setUtf16(const char16_t *unicode, qsizetype size)
QString simplified() const const
qsizetype size() const const
QStringList split(QChar sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const const
QString toLower() const const
QString toUpper() const const
QString trimmed() const const
void truncate(qsizetype position)
const QChar * unicode() const const
QVariant fromValue(T &&value)