Commit 98d41ca5 authored by EXT Arnaud Clère's avatar EXT Arnaud Clère

Update README.md

parent 513e0fb7
......@@ -4,7 +4,7 @@ QBind was developed to demonstrate the feasibility and advantages of a novel (de
existing [Qt](http://qt.io) data formats (Settings, QDataStream, Json, Cbor, Xml) and generic data types (containers, QVariant, QMetaObject, etc.).
**It would greatly simplify binding C++ data to Qt-supported [data formats](https://doc.qt.io/qt-5/topics-data-storage.html#)
or [data model](https://doc.qt.io/qt-5/model-view-programming.html) while providing more performance than traditional approaches.**
or [data model](https://doc.qt.io/qt-5/model-view-programming.html) while providing more performance than existing approaches.**
QBind requirements below are useful for most (de)serialization use cases. They would be mandatory to implement in Qt a tracing facility
allowing to analyse how software is used in the field and diagnose complex issues. Effectively:
......@@ -101,15 +101,15 @@ struct Person
Cursor bind(Val<Cursor>&& value) { // works with value->mode()==Read as well as Write
return value
.record("Person")
.sequence("names") // to illustrate a basic mapping between concrete struct Person and a more general data schema
.record("Person") // aggregates a usually small number of named items in any order (Person is an optional meta-name for the record that may be ignored)
.sequence("names") // aggregates any number of items in a fixed order, just to illustrate a basic mapping between struct Person and a more general data schema
.bind(firstName)
.bind( lastName)
.out()
.bind("height" ,height ) // keyed items such as "names" and "height" may appear in any order in a record()
.bind("height" ,height ) // remember named items such as "names" and "height" may appear in any order in a record()
.bind("age" ,age ,-1) // reads null() or missing values as the default value: -1
.bind("phones" ,phones ) // recursive calls to QBind will take care of that part
.bind("comments",comments)
.bind("phones" ,phones ) // recursively calls QBind to take care of that part
.bind("comments",comments) // directly calls IBind since it natively supports QString
.bind("children",children)
; // automagically closes opened record()
}
......@@ -117,8 +117,8 @@ struct Person
```
The value argument provides a fluent interface allowing to declaratively bind C++ data to a choice of:
* `sequence` of adjacent data items
* `record` of named data items
* `sequence` of data items in a fixed (meaningful) order, possibly infinite
* `record` of named data items in any order
* Atomic values like `QString firstName`, `double height`, `int age`
* Generically supported T values for which a specialized QBind<T> is defined like `QVector<QString> phones`, `QList<E> children`
......
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