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
183 m_safeString->m_safety = IsNotSafe;
184 return *m_safeString;
190 m_safeString->m_safety = IsNotSafe;
191 return *m_safeString;
206 bool truncate = {})
const;
207 SafeString mid(
int position,
int n = -1)
const;
216#ifndef QT_NO_CAST_FROM_ASCII
220 m_safeString->m_safety = IsNotSafe;
221 return *m_safeString;
227 m_safeString->m_safety = IsNotSafe;
228 return *m_safeString;
246 SafeString &replace(
int position,
int n,
const QChar *unicode,
int size);
281 bool truncate = {})
const;
284 SectionFlags flags = SectionDefault)
const;
286 SectionFlags flags = SectionDefault)
const;
288 SectionFlags flags = SectionDefault)
const;
290 SectionFlags flags = SectionDefault)
const;
295 SafeString &setNum(qlonglong n,
int base = 10);
296 SafeString &setNum(qulonglong n,
int base = 10);
299 SafeString &setNum(
double n,
char format =
'g',
int precision = 6);
300 SafeString &setNum(
float n,
char format =
'g',
int precision = 6);
302 SafeString &setUtf16(
const ushort *unicode,
int size);
305#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
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 & prepend(QChar ch)
QVariant fromValue(const T &value)