Skip to content

Commit 5d386b4

Browse files
committed
Update README.md
1 parent 3ebc8a0 commit 5d386b4

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,14 @@
1010

1111
## Preface
1212
Please submit pull requests if you don't agree with some behaviour or found a bug, I would appreciate it.
13-
I recently changed the versioning on the releases to indicate that this lib ist still under development and free to change.
13+
The library is further matured now and changes less.
14+
15+
This library can parse and stringify and is designed for easy use.
16+
Nobody wants to write parsing and stringification methods for every class they write. We rather want it
17+
to work "just like that" without thinking about it. This is where this library fits in.
18+
This idea of producing and consuming JSON has become the "Hello World of Introspection".
19+
20+
Since release 0.3, the library also features basic JSON beautification using boost iostreams.
1421

1522
## Introduction
1623
A JSON stringifier / parser that uses boost fusion introspection methods for automagic struct <-> JSON conversion
@@ -19,15 +26,13 @@ Its supports almost all STL contstructs in stringify and the most important for
1926
With the STL as a basis it is an easy to extend mechanism using classes. Use boost fusion and the provided utility
2027
(see example below) or provide your own parse/stringify methods.
2128

22-
INFO: I changed the versions from 1.x something something to 0.x something something, because I realised that I am likely not going to hesitate breaking interface or implementation. This has still very much potential and is wide open for improvements.
23-
24-
NOTE: This library is not fine tuned for speed.
29+
NOTE: The performance of this library is mostly influenced by boost property tree which is used for parsing JSON.
30+
The main focus of this library is not speed, but ease of use and convenience. If you want to be fast, try RapidJson (not saying it is particullarly slow, but probably not suitable for high data frequency or big bulk data application)
2531

2632
Dependencies:
2733
> boost/property_tree <br>
2834
> boost/fusion <br>
2935
> boost/mpl <br>
30-
> boost/phoenix <br>
3136
3237
Code example:
3338
```C++
@@ -103,8 +108,8 @@ There is just one function for stringification. This stringify function is heavi
103108
104109
* The library supports almost all STL containers (stringify supports even more) as well as fundamental types. <br>
105110
* Containers will decay into json arrays, if their value_type is a stringifiable (this is recursive).
106-
* Classes will turn into objects, if it is adapted, derives from FusionStruct<> and each parameter is stringifiable.
107-
* The stringify class member is called if provided, you have to make sure yourself that what you produce makes sense.
111+
* Classes will turn into objects, if it is adapted, derives from FusionStruct<> and each member is stringifiable.
112+
* For other classes, the "stringify" method is called, if provided, but then you will have to make sure on your own to produce a valid output. (The base64 wrapper uses this).
108113
109114
### stringify behaviour (and STL stuff stringification)
110115
It is quite import to know how certain STL constructs translate into JSON and here is a brief summary:
@@ -122,8 +127,7 @@ std::bitset | [1, 0, ...] |
122127
std::string | "..." |
123128
fundamental types | themselves |
124129
JSON::IteratorRange <STL_IteratorT> | [...] |
125-
std::map &lt;T, U> | [[T1, U1], [T2, U2], ...] | General case
126-
std::map &lt;std::string, T> | {"key": "value", "key2": "value2", ...} | Specialization
130+
std::map &lt;std::string, T> | {"key": "value", "key2": "value2", ...} | A map basically represents a JSON object
127131
std::mutex | nothing | Only use if you must!
128132
std::set | [...] |
129133
std::stack | [...] | Don't use if possible, better use deque.

0 commit comments

Comments
 (0)