Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 15204fb8 authored by EXT Arnaud Clère's avatar EXT Arnaud Clère
Browse files

WIP: trigger qBindUnexpectedEnd when fluent interface is not used until

QValueEnd
parent fa1426e4
#include "QValue.h" #include "QValue.h"
QIdentifierLiteral qBindUnexpectedValue ("UnexpectedValue" ); QIdentifierLiteral qBindUnexpectedValue ("UnexpectedValue" );
QIdentifierLiteral qBindUnexpectedEnd ("qBindUnexpectedEnd" );
QIdentifierLiteral qBindExpectedItem ("ExpectedItem" ); QIdentifierLiteral qBindExpectedItem ("ExpectedItem" );
QIdentifierLiteral qBindExpectedNull ("ExpectedNull" ); QIdentifierLiteral qBindExpectedNull ("ExpectedNull" );
......
...@@ -53,6 +53,8 @@ ...@@ -53,6 +53,8 @@
// Standard error names // Standard error names
extern QIdentifierLiteral qBindUnexpectedValue; //!< Values that cannot be bound (invalid or not supported by the bound data type or our data model) extern QIdentifierLiteral qBindUnexpectedValue; //!< Values that cannot be bound (invalid or not supported by the bound data type or our data model)
extern QIdentifierLiteral qBindUnexpectedEnd;
extern QIdentifierLiteral qBindExpectedItem; extern QIdentifierLiteral qBindExpectedItem;
extern QIdentifierLiteral qBindExpectedNull; extern QIdentifierLiteral qBindExpectedNull;
extern QIdentifierLiteral qBindExpectedSequence; extern QIdentifierLiteral qBindExpectedSequence;
...@@ -277,12 +279,13 @@ public: ...@@ -277,12 +279,13 @@ public:
explicit QCur(QAbstractValue* i) : impl(i) { Q_ASSERT(impl); } explicit QCur(QAbstractValue* i) : impl(i) { Q_ASSERT(impl); }
QValueMode mode() const noexcept { return impl ? impl->mode() : QValueMode::Invalid; } QValueMode mode() const noexcept { return impl ? impl->mode() : QValueMode::Invalid; }
explicit operator bool() const noexcept { return impl && impl->isValid(); } //!< Drives QTransmogrifier<T>::bind() traversal explicit operator bool() const noexcept { return isValid(); }
bool isValid() const noexcept { return impl && impl->isValid(); } //!< Drives QTransmogrifier<T>::bind() traversal
QCur* operator ->() noexcept { return this; } QCur* operator ->() noexcept { return this; }
QVal<QCur> value() noexcept ; QVal<QCur> value() noexcept ;
operator QValueEnd() { operator QValueEnd() {
bool isValid = impl && impl->isValid(); bool isValid = impl && impl->isValid();
impl=nullptr; impl = nullptr;
return QValueEnd{isValid}; return QValueEnd{isValid};
} }
...@@ -355,7 +358,8 @@ public: ...@@ -355,7 +358,8 @@ public:
Q_ENABLE_MOVE_DEFAULT(QVal) Q_ENABLE_MOVE_DEFAULT(QVal)
explicit QVal(T_&& out) noexcept { std::swap(outer, out); } explicit QVal(T_&& out) noexcept { std::swap(outer, out); }
explicit operator bool() const noexcept { return outer.operator bool(); } //!< Drives QTransmogrifier<T>::bind() traversal explicit operator bool() const noexcept { return isValid(); }
bool isValid() const noexcept { return outer.operator bool(); } //!< Drives QTransmogrifier<T>::bind() traversal
QCur* operator->() noexcept { return outer.operator ->(); } QCur* operator->() noexcept { return outer.operator ->(); }
QVal<T_> meta (QIdentifierLiteral& n, QAsciiData& m) { outer->_meta(n,m); return std::move(*this); } QVal<T_> meta (QIdentifierLiteral& n, QAsciiData& m) { outer->_meta(n,m); return std::move(*this); }
...@@ -402,9 +406,10 @@ template<class T_> class QSeq ...@@ -402,9 +406,10 @@ template<class T_> class QSeq
Q_DISABLE_COPY(QSeq) Q_DISABLE_COPY(QSeq)
public: public:
Q_ENABLE_MOVE_DEFAULT(QSeq) Q_ENABLE_MOVE_DEFAULT(QSeq)
~QSeq() { Q_UNUSED(QValueEnd(*this)) } ~QSeq() {if (operator QValueEnd().isValid()) { Q_UNUSED(outer->handleError(qBindUnexpectedEnd)); } }
explicit operator bool() const noexcept { return outer.operator bool(); } //!< Drives QTransmogrifier<T>::bind() traversal explicit operator bool() const noexcept { return isValid(); }
bool isValid() const noexcept { return outer.operator bool(); } //!< Drives QTransmogrifier<T>::bind() traversal
QCur* operator->() noexcept { return outer.operator ->(); } QCur* operator->() noexcept { return outer.operator ->(); }
operator QValueEnd() { return out(); /* calls T_::operator QValueEnd() if T_ != QValueEnd */ } operator QValueEnd() { return out(); /* calls T_::operator QValueEnd() if T_ != QValueEnd */ }
...@@ -450,9 +455,10 @@ template<class T_> class QRec ...@@ -450,9 +455,10 @@ template<class T_> class QRec
Q_DISABLE_COPY(QRec) Q_DISABLE_COPY(QRec)
public: public:
Q_ENABLE_MOVE_DEFAULT(QRec) Q_ENABLE_MOVE_DEFAULT(QRec)
~QRec() { Q_UNUSED(QValueEnd(*this)) } ~QRec() { if (operator QValueEnd().isValid()) { Q_UNUSED(outer->handleError(qBindUnexpectedEnd)); } }
explicit operator bool() const noexcept { return outer.operator bool(); } //!< Drives QTransmogrifier<T>::bind() traversal explicit operator bool() const noexcept { return isValid(); }
bool isValid() const noexcept { return outer.operator bool(); } //!< Drives QTransmogrifier<T>::bind() traversal
QCur* operator->() noexcept { return outer.operator ->(); } QCur* operator->() noexcept { return outer.operator ->(); }
operator QValueEnd() { return out(); /* calls T_::operator QValueEnd() if T_ != QValueEnd */ } operator QValueEnd() { return out(); /* calls T_::operator QValueEnd() if T_ != QValueEnd */ }
...@@ -461,22 +467,21 @@ public: ...@@ -461,22 +467,21 @@ public:
QVal<QRec<T_>> item(const char* n) { return outer->tryItem(QIdentifierLiteral(n)) ? QVal<QRec<T_>>(std::move(*this)) : QVal<QRec<T_>>(); } QVal<QRec<T_>> item(const char* n) { return outer->tryItem(QIdentifierLiteral(n)) ? QVal<QRec<T_>>(std::move(*this)) : QVal<QRec<T_>>(); }
// Shortcuts // Shortcuts
QSeq<QRec<T_>> sequence(const char* n, quint32* s=nullptr) { return item(n).sequence (s) ; } QSeq<QRec<T_>> sequence(const char* n, quint32* s=nullptr) { auto i = item(n); if (i) { return i.sequence (s) ; } Q_UNUSED(outer->handleError(qBindIgnoredItem, n)); return QSeq<QRec<T_>>(); }
QRec<QRec<T_>> record (const char* n, quint32* s=nullptr) { return item(n).record (s) ; } QRec<QRec<T_>> record (const char* n, quint32* s=nullptr) { auto i = item(n); if (i) { return i.record (s) ; } Q_UNUSED(outer->handleError(qBindIgnoredItem, n)); return QRec<QRec<T_>>(); }
/**/ QRec<T_> null (const char* n ) { return item(n).null ( ) ; } /**/ QRec<T_> null (const char* n ) { auto i = item(n); if (i) { return i.null ( ) ; } Q_UNUSED(outer->handleError(qBindIgnoredItem, n)); return QRec<T_> (); }
/**/ QRec<T_> bind (const char* n, const char* u) { auto i = item(n); if (i) { return i.bind(QUtf8DataView(u)); } Q_UNUSED(outer->handleError(qBindIgnoredItem, n)); return QRec<T_> (); }
/**/ QRec<T_> bind (const char* n, const char* u) { return item(n).bind(QUtf8DataView(u)); } /**/ QRec<T_> bind (const char* n, QUtf8DataView u) { auto i = item(n); if (i) { return i.bind (u) ; } Q_UNUSED(outer->handleError(qBindIgnoredItem, n)); return QRec<T_> (); }
/**/ QRec<T_> bind (const char* n, QUtf8DataView u) { return item(n).bind (u) ; } /**/ QRec<T_> bind (const char* n, QAsciiDataView a) { auto i = item(n); if (i) { return i.bind (a) ; } Q_UNUSED(outer->handleError(qBindIgnoredItem, n)); return QRec<T_> (); }
/**/ QRec<T_> bind (const char* n, QAsciiDataView a) { return item(n).bind (a) ; } /**/ QRec<T_> bind (const char* n, QLatin1String l) { auto i = item(n); if (i) { return i.bind (l) ; } Q_UNUSED(outer->handleError(qBindIgnoredItem, n)); return QRec<T_> (); }
/**/ QRec<T_> bind (const char* n, QLatin1String l) { return item(n).bind (l) ; } /**/ QRec<T_> bind (const char* n, QStringView u) { auto i = item(n); if (i) { return i.bind (u) ; } Q_UNUSED(outer->handleError(qBindIgnoredItem, n)); return QRec<T_> (); }
/**/ QRec<T_> bind (const char* n, QStringView u) { return item(n).bind (u) ; }
template<typename T> QRec<T_> bind (const char* n, T&& t) { auto i = item(n); if (i) { return i.bind( std::forward<T>( t)); } Q_UNUSED(outer->handleError(qBindIgnoredItem, n)); return QRec<T_>(); }
template<typename T> QRec<T_> bind (const char* n, T&& t) { return item(n).bind( std::forward<T>( t)); } template<typename T> QRec<T_> bind (const char* n, T& t, T&& defaultT) { auto i = item(n); if (i) { return i.bind(t, std::forward<T>(defaultT)); } Q_UNUSED(outer->handleError(qBindIgnoredItem, n)); return QRec<T_>(); }
template<typename T> QRec<T_> bind (const char* n, T& t, T&& defaultT) { return item(n).bind(t, std::forward<T>(defaultT)); }
// Custom bind support // Custom bind support
/**/ QRec<T_> with (const char* n, QValLambda customBind) { return item(n).with( customBind); } /**/ QRec<T_> with (const char* n, QValLambda customBind) { auto i = item(n); if (i) { return i.with( customBind); } Q_UNUSED(outer->handleError(qBindIgnoredItem, n)); return QRec<T_>(); }
template<typename T> QRec<T_> with (const char* n, T& t, QValFunction<T> customBind) { return item(n).bind(t, customBind); } template<typename T> QRec<T_> with (const char* n, T& t, QValFunction<T> customBind) { auto i = item(n); if (i) { return i.bind(t, customBind); } Q_UNUSED(outer->handleError(qBindIgnoredItem, n)); return QRec<T_>(); }
private: private:
template<class T_> friend class QVal; template<class T_> friend class QVal;
explicit QRec(T_&& out) noexcept { std::swap(outer, out); } explicit QRec(T_&& out) noexcept { std::swap(outer, out); }
...@@ -912,8 +917,7 @@ QValueEnd qMetaZap(QValue&& v, T* t) { ...@@ -912,8 +917,7 @@ QValueEnd qMetaZap(QValue&& v, T* t) {
QAsciiData(p.enumerator().valueToKeys(pv.value<int>())) : QAsciiData(p.enumerator().valueToKeys(pv.value<int>())) :
QAsciiData(p.enumerator().valueToKey (pv.value<int>()))); QAsciiData(p.enumerator().valueToKey (pv.value<int>())));
} }
if (pv.userType()==qMetaTypeId<QUtf8Data>() // TODO pv.type if QUtf8Data becomes a Qt type if (pv.userType()==qMetaTypeId<QUtf8Data>() ) r = i.bind(pv.value< QUtf8Data>());
) r = i.bind(pv.value< QUtf8Data>());
else if (pv.type()==QVariant::String ) r = i.bind(pv.value< QString>()); else if (pv.type()==QVariant::String ) r = i.bind(pv.value< QString>());
else if (pv.type()==QVariant::Char ) r = i.bind(pv. toString()); else if (pv.type()==QVariant::Char ) r = i.bind(pv. toString());
else if (pv.type()==QVariant::Bool ) r = i.bind(pv.value< bool>()); else if (pv.type()==QVariant::Bool ) r = i.bind(pv.value< bool>());
...@@ -923,7 +927,7 @@ QValueEnd qMetaZap(QValue&& v, T* t) { ...@@ -923,7 +927,7 @@ QValueEnd qMetaZap(QValue&& v, T* t) {
else if (pv.type()==int(QMetaType::Long )) r = i.bind(pv.value< qint32>()); else if (pv.type()==int(QMetaType::Long )) r = i.bind(pv.value< qint32>());
else if (pv.type()==int(QMetaType::Short )) r = i.bind(pv.value< short>()); else if (pv.type()==int(QMetaType::Short )) r = i.bind(pv.value< short>());
else if (pv.type()==int(QMetaType::Char )) r = i.bind(pv.value< char>()); else if (pv.type()==int(QMetaType::Char )) r = i.bind(pv.value< char>());
else if (pv.type()==int(QMetaType::UShort)) r = i.bind(pv.value< ushort>()); else if (pv.type()==int(QMetaType::UShort )) r = i.bind(pv.value< ushort>());
else if (pv.type()==int(QMetaType::UChar )) r = i.bind(pv.value< uchar>()); else if (pv.type()==int(QMetaType::UChar )) r = i.bind(pv.value< uchar>());
else if (pv.type()==int(QMetaType::SChar )) r = i.bind(pv.value< signed char>()); else if (pv.type()==int(QMetaType::SChar )) r = i.bind(pv.value< signed char>());
else if (pv.type()==QVariant::UInt ) r = i.bind(pv.value< uint>()); else if (pv.type()==QVariant::UInt ) r = i.bind(pv.value< uint>());
...@@ -934,7 +938,7 @@ QValueEnd qMetaZap(QValue&& v, T* t) { ...@@ -934,7 +938,7 @@ QValueEnd qMetaZap(QValue&& v, T* t) {
else if (pv.canConvert<QVariantList>() ) r = i.bind(pv.value<QVariantList>()); // TODO avoid interim data structure else if (pv.canConvert<QVariantList>() ) r = i.bind(pv.value<QVariantList>()); // TODO avoid interim data structure
else if (pv.canConvert<QVariantMap >() ) r = i.bind(pv.value<QVariantMap >()); // TODO avoid interim data structure else if (pv.canConvert<QVariantMap >() ) r = i.bind(pv.value<QVariantMap >()); // TODO avoid interim data structure
else if (pv.isNull() ) r = i.null(); else if (pv.isNull() ) r = i.null();
else if (!pv.isValid() || v->handleError(qBindUnexpectedValue)) r = i.any(); else if (v->handleError(qBindUnexpectedValue)) r = i.any();
} }
} }
else { Q_ASSERT_X(!v, Q_FUNC_INFO, "Unsupported v->mode()"); return v.any(); } else { Q_ASSERT_X(!v, Q_FUNC_INFO, "Unsupported v->mode()"); return v.any(); }
...@@ -1047,7 +1051,7 @@ struct QTransmogrifier<QVector<T>> { ...@@ -1047,7 +1051,7 @@ struct QTransmogrifier<QVector<T>> {
for (auto&& t : ts) { for (auto&& t : ts) {
s = s.bind(t); s = s.bind(t);
} }
return s; return s.out();
} }
else if (v->mode()==Read) { else if (v->mode()==Read) {
auto s(v.sequence()); auto s(v.sequence());
...@@ -1065,7 +1069,7 @@ struct QTransmogrifier<QVector<T>> { ...@@ -1065,7 +1069,7 @@ struct QTransmogrifier<QVector<T>> {
ts[it++] = t; ts[it++] = t;
} }
} }
return s; return s.out();
} }
else { Q_ASSERT_X(!v, Q_FUNC_INFO, "Unsupported v->mode()"); return v.any(); } else { Q_ASSERT_X(!v, Q_FUNC_INFO, "Unsupported v->mode()"); return v.any(); }
} }
...@@ -1082,7 +1086,7 @@ struct QTransmogrifier<QList<T>> { ...@@ -1082,7 +1086,7 @@ struct QTransmogrifier<QList<T>> {
for (auto&& t : ts) { for (auto&& t : ts) {
s = s.bind(t); s = s.bind(t);
} }
return s; return s.out();
} }
else { Q_ASSERT_X(!v, Q_FUNC_INFO, "Unsupported v->mode()"); return v.any(); } else { Q_ASSERT_X(!v, Q_FUNC_INFO, "Unsupported v->mode()"); return v.any(); }
} }
...@@ -1093,7 +1097,7 @@ struct QTransmogrifier<QList<T>> { ...@@ -1093,7 +1097,7 @@ struct QTransmogrifier<QList<T>> {
for (auto&& t : ts) { for (auto&& t : ts) {
s = s.bind(t); s = s.bind(t);
} }
return s; return s.out();
} }
else if (v->mode()==Read) { else if (v->mode()==Read) {
auto s(v.sequence()); auto s(v.sequence());
...@@ -1110,7 +1114,7 @@ struct QTransmogrifier<QList<T>> { ...@@ -1110,7 +1114,7 @@ struct QTransmogrifier<QList<T>> {
ts[it++] = t; ts[it++] = t;
} }
} }
return s; return s.out();
} }
else { Q_ASSERT_X(!v, Q_FUNC_INFO, "Unsupported v->mode()"); return v.any(); } else { Q_ASSERT_X(!v, Q_FUNC_INFO, "Unsupported v->mode()"); return v.any(); }
} }
...@@ -1125,22 +1129,22 @@ struct QTransmogrifier<QMap<QString,T>> { ...@@ -1125,22 +1129,22 @@ struct QTransmogrifier<QMap<QString,T>> {
static QValueEnd zap(QValue&& v, QMap<QString,T>&& ts) { static QValueEnd zap(QValue&& v, QMap<QString,T>&& ts) {
if (v->mode()==Write) { if (v->mode()==Write) {
quint32 size=quint32(ts.size()); quint32 size=quint32(ts.size());
auto s(v.record(&size)); auto r(v.record(&size));
for (QString key : ts.keys()) { for (QString key : ts.keys()) {
s = s.bind(key.toLatin1().constData(),ts[key]); r = r.bind(key.toLatin1().constData(),ts[key]);
} }
return s; return r.out();
} }
else { Q_ASSERT_X(!v, Q_FUNC_INFO, "Unsupported v->mode()"); return v.any(); } else { Q_ASSERT_X(!v, Q_FUNC_INFO, "Unsupported v->mode()"); return v.any(); }
} }
static QValueEnd zap(QValue&& v, QMap<QString,T>& ts) { static QValueEnd zap(QValue&& v, QMap<QString,T>& ts) {
if (v->mode()==Write) { if (v->mode()==Write) {
quint32 size=quint32(ts.size()); quint32 size=quint32(ts.size());
auto s(v.record(&size)); auto r(v.record(&size));
for (QString key : ts.keys()) { for (QString key : ts.keys()) {
s = s.bind(key.toLatin1().constData(),ts[key]); r = r.bind(key.toLatin1().constData(),ts[key]);
} }
return s; return r.out();
} }
else if (v->mode()==Read) { else if (v->mode()==Read) {
auto r(v.record()); auto r(v.record());
...@@ -1150,7 +1154,7 @@ struct QTransmogrifier<QMap<QString,T>> { ...@@ -1150,7 +1154,7 @@ struct QTransmogrifier<QMap<QString,T>> {
if ((r = i.bind(value))) if ((r = i.bind(value)))
ts.insert(name.latin1(),value); ts.insert(name.latin1(),value);
} }
return r; return r.out();
} }
else { Q_ASSERT_X(!v, Q_FUNC_INFO, "Unsupported v->mode()"); return v.any(); } else { Q_ASSERT_X(!v, Q_FUNC_INFO, "Unsupported v->mode()"); return v.any(); }
} }
......
...@@ -96,7 +96,7 @@ struct Person ...@@ -96,7 +96,7 @@ struct Person
.bind("phones" ,phones ) // recursive calls to QTransmogrifier will take care of that part .bind("phones" ,phones ) // recursive calls to QTransmogrifier will take care of that part
.bind("comments",comments) .bind("comments",comments)
.bind("children",children) .bind("children",children)
; // automagically closes opened record() .out(); // not calling this would still automagically close opened record() but always trigger a qBindUnexpectedEnd to help write explicitly correct code
} }
}; };
...@@ -416,13 +416,14 @@ int main(int argc, char *argv[]) ...@@ -416,13 +416,14 @@ int main(int argc, char *argv[])
STOP("QDebug",s) STOP("QDebug",s)
START { START {
ba.resize(0); ba.resize(0);
TextWriter(&ba) auto s = TextWriter(&ba)
<< 1.333333333333f << 1.333333333333f
<< PI << PI
<< ascii << ascii
<< false << false
<< color << color
; ;
s.out(); // to prevent the Q_ASSERT triggered by the implicit sequence() started by the first <<
} }
STOP("Text",b.buffer()) STOP("Text",b.buffer())
START { START {
...@@ -433,7 +434,7 @@ int main(int argc, char *argv[]) ...@@ -433,7 +434,7 @@ int main(int argc, char *argv[])
.bind(ascii) .bind(ascii)
.bind(false) .bind(false)
.bind(color) .bind(color)
; .out();
} }
STOP("Json",ba) STOP("Json",ba)
START { START {
...@@ -445,7 +446,7 @@ int main(int argc, char *argv[]) ...@@ -445,7 +446,7 @@ int main(int argc, char *argv[])
.bind(ascii) .bind(ascii)
.bind(false) .bind(false)
.bind(color) .bind(color)
; .out();
} }
STOP("Xml",ba) STOP("Xml",ba)
START { START {
...@@ -456,7 +457,7 @@ int main(int argc, char *argv[]) ...@@ -456,7 +457,7 @@ int main(int argc, char *argv[])
.bind(ascii) .bind(ascii)
.bind(false) .bind(false)
.bind(color) .bind(color)
; .out();
} }
STOP("Variant",Text(v).utf8()) STOP("Variant",Text(v).utf8())
START { START {
...@@ -467,7 +468,7 @@ int main(int argc, char *argv[]) ...@@ -467,7 +468,7 @@ int main(int argc, char *argv[])
.bind(ascii) .bind(ascii)
.bind(false) .bind(false)
.bind(color) .bind(color)
; .out();
} }
STOP("Cbor",ba.toHex()) STOP("Cbor",ba.toHex())
START { START {
...@@ -498,7 +499,7 @@ int main(int argc, char *argv[]) ...@@ -498,7 +499,7 @@ int main(int argc, char *argv[])
.bind(ascii) .bind(ascii)
.bind(false) .bind(false)
.bind(color) .bind(color)
; .out();
} }
STOP("Data",b.buffer().toHex()) STOP("Data",b.buffer().toHex())
START { START {
......
...@@ -30,7 +30,7 @@ Person> |================================================================= ...@@ -30,7 +30,7 @@ Person> |=================================================================
QDebug |Person("John", "Doe", 1.75, 18, QVector(), "unicode is likely U+01 \u0001 + U+1F \u001F + U+A4 ¤ U+B0 ° U+D8 Ø U+FF ÿ", ()) QDebug |Person("John", "Doe", 1.75, 18, QVector(), "unicode is likely U+01 \u0001 + U+1F \u001F + U+A4 ¤ U+B0 ° U+D8 Ø U+FF ÿ", ())
Text |(Person) names:[ John Doe] height:1.75 age:18 phones:[] comments:unicode is likely U+01  + U+1F  + U+A4 ¤ U+B0 ° U+D8 Ø U+FF ÿ children:[] Text |(Person) names:[ John Doe] height:1.75 age:18 phones:[] comments:unicode is likely U+01  + U+1F  + U+A4 ¤ U+B0 ° U+D8 Ø U+FF ÿ children:[]
Json |{"names":["John","Doe"],"height":1.75,"age":18,"phones":[],"comments":"unicode is likely U+01 \u0001 + U+1F \u001F + U+A4 ¤ U+B0 ° U+D8 Ø U+FF ÿ","children":[]} Json |{"names":["John","Doe"],"height":1.75,"age":18,"phones":[],"comments":"unicode is likely U+01 \u0001 + U+1F \u001F + U+A4 ¤ U+B0 ° U+D8 Ø U+FF ÿ","children":[]}
Xml |<Person><names><string>John</string><string>Doe</string></names><height>1.75</height><age>18</age><phones/><comments>unicode is likely U+01 + U+1F + U+A4 ¤ U+B0 ° U+D8 Ø U+FF ÿ</comments><children/></Person> Xml |<Person><names><string>John</string><string>Doe</string></names><height>1.75</height><age>18</age><phones/><comments>unicode is likely U+01 + U+1F + U+A4 ¤ U+B0 ° U+D8 Ø U+FF ÿ</comments></Person>
Variant | age:18 children:[] comments:unicode is likely U+01  + U+1F  + U+A4 ¤ U+B0 ° U+D8 Ø U+FF ÿ height:1.75 names:[ John Doe] phones:[] Variant | age:18 children:[] comments:unicode is likely U+01  + U+1F  + U+A4 ¤ U+B0 ° U+D8 Ø U+FF ÿ height:1.75 names:[ John Doe] phones:[]
Cbor |bf656e616d65739f644a6f686e63446f65ff66686569676874fb3ffc00000000000063616765126670686f6e65738068636f6d6d656e74737843756e69636f6465206973206c696b656c7920552b30312001202b20552b3146201f202b20552b413420c2a420552b423020c2b020552b443820c39820552b464620c3bf686368696c6472656e80ff Cbor |bf656e616d65739f644a6f686e63446f65ff66686569676874fb3ffc00000000000063616765126670686f6e65738068636f6d6d656e74737843756e69636f6465206973206c696b656c7920552b30312001202b20552b3146201f202b20552b413420c2a420552b423020c2b020552b443820c39820552b464620c3bf686368696c6472656e80ff
QCborStream |bf656e616d65739f644a6f686e63446f65ff66686569676874fb3ffc00000000000063616765126670686f6e65738068636f6d6d656e74737843756e69636f6465206973206c696b656c7920552b30312001202b20552b3146201f202b20552b413420c2a420552b423020c2b020552b443820c39820552b464620c3bf686368696c6472656e80ff QCborStream |bf656e616d65739f644a6f686e63446f65ff66686569676874fb3ffc00000000000063616765126670686f6e65738068636f6d6d656e74737843756e69636f6465206973206c696b656c7920552b30312001202b20552b3146201f202b20552b413420c2a420552b423020c2b020552b443820c39820552b464620c3bf686368696c6472656e80ff
...@@ -64,7 +64,7 @@ JsonValue>P |(Person) names:[ John Doe] height:1.75 age:-1 phones:[] comments: ...@@ -64,7 +64,7 @@ JsonValue>P |(Person) names:[ John Doe] height:1.75 age:-1 phones:[] comments:
Json>JsonValue|{"age":-1,"children":[],"comments":"","height":1.7500000000000004,"names":["John","Doe"],"phones":[]} | Json>JsonValue|{"age":-1,"children":[],"comments":"","height":1.7500000000000004,"names":["John","Doe"],"phones":[]} |
Json>Cbor |bf656e616d65739f644a6f686e63446f65ff66686569676874fa3fe0000063616765206670686f6e65739fff68636f6d6d656e747360686368696c6472656e9fffff Json>Cbor |bf656e616d65739f644a6f686e63446f65ff66686569676874fa3fe0000063616765206670686f6e65739fff68636f6d6d656e747360686368696c6472656e9fffff
Person<>Cbor |================================================================================ Person<>Cbor |================================================================================
Cbor>P |(Person) names:[ John Doe] height:1.75 age:-1 phones:[] comments: children:[] | Cbor>P |(Person) names:[ John Doe] height:1.75 age:-1 phones:[] comments: children:[] | at index:41 commentsIgnoredItem
P>Cbor |bf656e616d65739f644a6f686e63446f65ff66686569676874fb3ffc00000000000063616765206670686f6e65738068636f6d6d656e747360686368696c6472656e80ff P>Cbor |bf656e616d65739f644a6f686e63446f65ff66686569676874fb3ffc00000000000063616765206670686f6e65738068636f6d6d656e747360686368696c6472656e80ff
Cbor>P |(Person) names:[ John Doe] height:1.75 age:-1 phones:[] comments: children:[] | Cbor>P |(Person) names:[ John Doe] height:1.75 age:-1 phones:[] comments: children:[] |
QCborStream>P |(Person) names:[ John Doe] height:1.75 age:-1 phones:[] comments: children:[] | true QCborStream>P |(Person) names:[ John Doe] height:1.75 age:-1 phones:[] comments: children:[] | true
...@@ -75,5 +75,5 @@ CborValue>Cbor|a6656e616d657382644a6f686e63446f6566686569676874fb3ffc00000000000 ...@@ -75,5 +75,5 @@ CborValue>Cbor|a6656e616d657382644a6f686e63446f6566686569676874fb3ffc00000000000
Cbor>Json |{"names":["John","Doe"],"height":1.75,"age":undefined} | Cbor>Json |{"names":["John","Doe"],"height":1.75,"age":undefined} |
Person<>Settings|================================================================================ Person<>Settings|================================================================================
P>Settings |(Person) names:[ John Doe] height:1.75 age:18 phones:[] comments:unicode is likely U+01  + U+1F  + U+A4 ¤ U+B0 ° U+D8 Ø U+FF ÿ children:[] P>Settings |(Person) names:[ John Doe] height:1.75 age:18 phones:[] comments:unicode is likely U+01  + U+1F  + U+A4 ¤ U+B0 ° U+D8 Ø U+FF ÿ children:[]
Settings>P |(Person) names:[ John Doe] height:1.75 age:18 phones:[] comments:unicode is likely U+01  + U+1F  + U+A4 ¤ U+B0 ° U+D8 Ø U+FF ÿ children:[] | Settings>P |(Person) names:[ John Doe] height:1.75 age:18 phones:[] comments:unicode is likely U+01  + U+1F  + U+A4 ¤ U+B0 ° U+D8 Ø U+FF ÿ children:[] | /-1/namesIgnoredItem
P>Settings |QBind P>Settings |QBind
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment