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);
177#ifndef QT_NO_CAST_FROM_ASCII
182 return *m_safeString;
189 return *m_safeString;
214#ifndef QT_NO_CAST_FROM_ASCII
219 return *m_safeString;
226 return *m_safeString;
335 operator QString()
const {
return m_nestedString; }
375 bool operator==(
const SafeString &other)
const;
382 bool operator==(
const QString &other)
const;
391 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, QChar::UnicodeVersion 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)