//! QMetaData is optional data about current data to enable optimized processing (e.g. tag, , style, etc.) and/or transmission (QAbstractItemModel headers, CBOR tags, XML attribute, CSS, numpy.ndarray shapes, etc.)
// meta(QIdentifierLiteral name, QAsciiData value) is optional meta-data about current data to enable optimized processing (e.g. tag, , style, etc.) and/or transmission (QAbstractItemModel headers, CBOR tags, XML attribute, CSS, numpy.ndarray shapes, etc.)
staticQIdentifierLiteralqmDataStreamVersion("qmDataStreamVersion");//!< Allows IBind support of QDataStream
staticconstQIdentifierLiteralqmDataStreamVersion("qmDataStreamVersion");//!< Allows IBind support of QDataStream
// N-dimensional data structures for which specific IWriter may have optimized implementations
// BEWARE though that nested calls to IWriter are not guaranteed to follow the declared structure (this would prevent reusing general QBind functors for nested data structures)
//! Sequence of records can be implemented as table with columns below (record item names are always the same in a fixed order)
//! \warning QMetaData is ignored by default and subject to various interpretation, so users should define or adopt existing meta data standards like XSD for sake of interoperability
virtualvoid_meta(QMetaData&){}
//! \warning meta() is ignored by default and subject to various interpretation, so users should define or adopt existing meta data standards like XSD for sake of interoperability
classQCborWriter:publicIWriter// TODO Support CBOR tags for IBind BindNative types and multi-dimensional QMetaData (e.g. support qmColumns with http://cbor.schmorp.de/stringref, qmSizes with https://datatracker.ietf.org/doc/draft-ietf-cbor-array-tags/?include_text=1 )
classQCborWriter:publicIWriter// TODO Support CBOR tags for IBind BindNative types and multi-dimensional meta() (e.g. support qmColumns with http://cbor.schmorp.de/stringref, qmSizes with https://datatracker.ietf.org/doc/draft-ietf-cbor-array-tags/?include_text=1 )
//! \warning As with QDataStream, QDataWriter and QDataReader must bind compatible C++ data types, and QDataStream ByteOrder, FloatingPointPrecision and Version
//! \remark When not statically known, such information can be transmitted using meta({{"type",...}}) although some IBind implementations may not support it
classQDataWriter:publicIWriter// allows runtime flexibility but requires QBind<T> in addition to T::operator<<(QDataStream&) and does not warrant QDataStream operators compatibility if QBind<T> ignores qmDataStreamVersion in meta(QMetaData&)
//! \remark When not statically known, such information can be transmitted using meta("type",...) although some IBind implementations may not support it
classQDataWriter:publicIWriter// allows runtime flexibility but requires QBind<T> in addition to T::operator<<(QDataStream&) and does not warrant QDataStream operators compatibility if QBind<T> ignores qmDataStreamVersion in meta()
introw=0,col=0;//!< Allows handling {null} equally to {} (but not equally to null) without requiring QModelIndex to reference rows/columns before they actually exist
// Various possible designs for flexible custom bind
#if 0
...
...
@@ -1038,12 +1041,12 @@ void doGuiExample() {
});
#else
// More expressive design similar to Python list comprehensions that does not work by default for Read/Write
QModelWriter<>(&customModel).sequence().with([&](Seq<Cursor>&&s){// See https://stackoverflow.com/questions/18889028/a-positive-lambda-what-sorcery-is-this