43 #include <QtCore/qbytearray.h>
44 #include <QtCore/qdatetime.h>
45 #include <QtCore/qcborcommon.h>
46 #if QT_CONFIG(regularexpression)
47 # include <QtCore/qregularexpression.h>
49 #include <QtCore/qstring.h>
50 #include <QtCore/qstringview.h>
51 #include <QtCore/qurl.h>
52 #include <QtCore/quuid.h>
53 #include <QtCore/qvariant.h>
56 #if defined(False) && defined(True)
61 #if 0 && __has_include(<compare>)
90 SortKeysInMaps = 0x01,
92 #ifndef QT_BOOTSTRAPPED
93 UseFloat16 = UseFloat | 0x04,
104 ExtendedFormat = 0x02
149 #if QT_STRINGVIEW_LEVEL < 2
154 #ifndef QT_NO_CAST_FROM_ASCII
167 #ifndef QT_BOOTSTRAPPED
170 #if QT_CONFIG(regularexpression)
191 qt_ptr_swap(container,
other.container);
204 bool isBool()
const {
return isFalse() || isTrue(); }
221 return type() == type_helper(st);
229 {
return isInteger() ? value_helper() : isDouble() ?
qint64(fp_helper()) : defaultValue; }
230 bool toBool(
bool defaultValue =
false)
const
231 {
return isBool() ? isTrue() : defaultValue; }
233 {
return isDouble() ? fp_helper() : isInteger() ? double(value_helper()) : defaultValue; }
241 QUrl toUrl(
const QUrl &defaultValue = {})
const;
242 #if QT_CONFIG(regularexpression)
245 QUuid toUuid(
const QUuid &defaultValue = {})
const;
261 #if 0 && __has_include(<compare>)
265 if (
c > 0)
return std::partial_ordering::greater;
266 if (
c == 0)
return std::partial_ordering::equivalent;
267 return std::partial_ordering::less;
273 {
return !(*
this ==
other); }
283 #if QT_CONFIG(cborstreamreader)
291 #if QT_CONFIG(cborstreamwriter)
296 QString toDiagnosticNotation(DiagnosticNotationOptions opts = Compact)
const;
308 qint64 value_helper()
const
313 double fp_helper()
const
315 static_assert(
sizeof(
double) ==
sizeof(
n));
317 memcpy(&
d, &
n,
sizeof(
d));
326 constexpr
static bool isTag_helper(
Type tt)
328 return tt ==
Tag || tt >= 0x10000;
341 { assign(*
this,
other);
return *
this; }
343 { assign(*
this, std::move(
other));
other.container =
nullptr;
return *
this; }
345 { assign(*
this,
other);
return *
this; }
353 bool isTag()
const {
return QCborValue::isTag_helper(
type()); }
356 bool isBool()
const {
return isFalse() || isTrue(); }
372 return type() == QCborValue::type_helper(st);
376 {
return concrete().tag(defaultValue); }
381 {
return concrete().toInteger(defaultValue); }
382 bool toBool(
bool defaultValue =
false)
const
383 {
return concrete().toBool(defaultValue); }
385 {
return concrete().toDouble(defaultValue); }
388 {
return concrete().toByteArray(defaultValue); }
390 {
return concrete().toString(defaultValue); }
392 {
return concrete().toDateTime(defaultValue); }
393 #ifndef QT_BOOTSTRAPPED
395 {
return concrete().toUrl(defaultValue); }
397 #if QT_CONFIG(regularexpression)
399 {
return concrete().toRegularExpression(defaultValue); }
402 {
return concrete().toUuid(defaultValue); }
418 {
return concrete().compare(
other); }
419 #if 0 && __has_include(<compare>)
423 if (
c > 0)
return std::strong_ordering::greater;
424 if (
c == 0)
return std::strong_ordering::equivalent;
425 return std::strong_ordering::less;
431 {
return !(*
this ==
other); }
439 #if QT_CONFIG(cborstreamwriter)
441 {
return concrete().toCbor(
opt); }
446 {
return concrete().toDiagnosticNotation(
opt); }
453 friend class QCborValueRefPtr;
477 #if !defined(QT_NO_DEBUG_STREAM)
481 #ifndef QT_NO_DATASTREAM
482 #if QT_CONFIG(cborstreamwriter)
490 #if defined(QT_X11_DEFINES_FOUND)
small capitals from c petite p scientific f u
small capitals from c petite p scientific i
[1]
The QByteArray class provides an array of bytes.
The QCborArray class is used to hold an array of CBOR elements.
The QCborMap class is used to hold an associative container representable in CBOR.
The QCborStreamReader class is a simple CBOR stream decoder, operating on either a QByteArray or QIOD...
The QCborStreamWriter class is a simple CBOR encoder operating on a one-way stream.
The QCborValue class encapsulates a value in CBOR.
bool isSimpleType() const
bool operator==(const QCborValue &other) const noexcept
bool operator!=(const QCborValue &other) const noexcept
QCborValue(QCborSimpleType st)
QCborValue(QCborKnownTags t_, const QCborValue &tv=QCborValue())
QCborValue(QCborValue &&other) noexcept
qint64 toInteger(qint64 defaultValue=0) const
bool operator<(const QCborValue &other) const
bool isRegularExpression() const
double toDouble(double defaultValue=0) const
QCborSimpleType toSimpleType(QCborSimpleType defaultValue=QCborSimpleType::Undefined) const
QCborValue(std::nullptr_t)
QCborValue(const void *)=delete
bool isSimpleType(QCborSimpleType st) const
QT_ASCII_CAST_WARN QCborValue(const char *s)
QCborValue taggedValue(const QCborValue &defaultValue=QCborValue()) const
bool toBool(bool defaultValue=false) const
QCborValueRef & operator=(const QCborValueRef &other)
QUuid toUuid(const QUuid &defaultValue={}) const
QCborValue::Type type() const
QString toDiagnosticNotation(QCborValue::DiagnosticNotationOptions opt=QCborValue::Compact)
QCborValueRef & operator=(QCborValue &&other)
bool isSimpleType() const
qint64 toInteger(qint64 defaultValue=0) const
bool operator<(const QCborValue &other) const
QString toString(const QString &defaultValue={}) const
QByteArray toByteArray(const QByteArray &defaultValue={}) const
double toDouble(double defaultValue=0) const
QCborValueRef(const QCborValueRef &) noexcept=default
bool isRegularExpression() const
QCborValue taggedValue(const QCborValue &defaultValue=QCborValue()) const
bool operator==(const QCborValue &other) const
QCborValueRef(QCborValueRef &&) noexcept=default
bool operator!=(const QCborValue &other) const
QDateTime toDateTime(const QDateTime &defaultValue={}) const
bool isSimpleType(QCborSimpleType st) const
int compare(const QCborValue &other) const
QUrl toUrl(const QUrl &defaultValue={}) const
QCborTag tag(QCborTag defaultValue=QCborTag(-1)) const
QVariant toVariant() const
bool toBool(bool defaultValue=false) const
The QDataStream class provides serialization of binary data to a QIODevice.
operator>>(QDataStream &ds, qfloat16 &f)
operator<<(QDataStream &ds, qfloat16 f)
The QDateTime class provides date and time functions.
The QDebug class provides an output stream for debugging information.
template< typename Enum > size_t qHash(QFlags< Enum > flags, size_t seed=0) noexcept
static QCborContainerPrivate * container(const QCborValue &v)
The QJsonValue class encapsulates a value in JSON.
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.
The QRegularExpression class provides pattern matching using regular expressions.
The QString class provides a Unicode character string.
The QStringView class provides a unified view on UTF-16 strings with a read-only subset of the QStrin...
The QUrl class provides a convenient interface for working with URLs.
The QUuid class stores a Universally Unique Identifier (UUID).
The QVariant class acts like a union for the most common Qt data types.
auto it unsigned count const
void toString(QString &appendTo, IPv4Address address)
qsizetype fromUtf8(uchar b, OutputPtr &dst, InputPtr &src, InputPtr end)
QImageReader reader("image.png")
[1]
void swap(SimpleVector< T > &v1, SimpleVector< T > &v2)
#define Q_DECL_PURE_FUNCTION
typedef QByteArray(EGLAPIENTRYP PFNQGSGETDISPLAYSPROC)()
EGLOutputLayerEXT EGLint EGLAttrib value
#define Q_DECLARE_FLAGS(Flags, Enum)
#define QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(Class)
GLsizei const GLfloat * v
[13]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLintptr offset
#define Q_DECLARE_SHARED(TYPE)
QUrl url("http://www.example.com/List of holidays.xml")
[0]
QCborValue(QCborTag(2), QByteArray("\x01\0\0\0\0\0\0\0\0", 9))
[0]
value toMap().value(key)
[3]
value isSimpleType(QCborSimpleType(12))
[1]
The QCborError class holds the error condition found while parsing or validating a CBOR stream.
The QCborParserError is used by QCborValue to report a parsing error.
QString errorString() const
void compare(Input input, FnUnderTest fn_under_test, const QByteArray &output)
XmlOutput::xml_output tag(const QString &name)