-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
368 lines (363 loc) · 7.95 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
<!DOCTYPE html>
<html lang="en">
<head>
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
<title>
JsonWax for Qt
</title>
<link href='css/style.css' rel='stylesheet'>
</head>
<body>
<h1>
JsonWax for Qt
</h1>
<h2>
NOW WITH SERIALIZATION
</h2>
<div id='blackspace'></div>
<svg height='7.5em' id='SVG' viewBox='20 20 50 50' width='100%'>
<text fill='red' id='jsonwaxtext' transform='translate(420, -57) rotate(45) scale(1.2)'>
<tspan dy='1em' x='-1.1em'>
------
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-2.1em'>
---
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-3.1em'>
------------
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-4.1em'>
----
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-5.1em'>
-------------
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-6.1em'>
----------
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-7.1em'>
-----------
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-8.1em'>
--------
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-9.1em'>
------------
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-10.1em'>
-------
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-11.1em'>
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-12.1em'>
---------
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-13.1em'>
-----------
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-14.1em'>
--
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-15.1em'>
--------------
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-16.1em'>
----------
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-17.1em'>
--------
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-18.1em'>
----
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-19.1em'>
---------
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-20.1em'>
----
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-21.1em'>
--
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-22.1em'>
----------
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-23.1em'>
---------
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-24.1em'>
-------------
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-25.1em'>
-
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-26.1em'>
----------
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-27.1em'>
-----------
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-28.1em'>
------------
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-29.1em'>
----------
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-30.1em'>
--------------
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-31.1em'>
-------
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-32.1em'>
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-33.1em'>
--------
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-34.1em'>
-----
JsonWax JsonWax JsonWax
</tspan>
<tspan dy='1em' x='-35.1em'>
JsonWax JsonWax JsonWax
</tspan>
</text>
</svg>
<div id='menucontainer'>
<div id='menu'>
<div class='MENU_ELEMENT' id='menu_element0'>
<a href='index.html'>
WHAT IS IT?
</a>
</div>
<div class='MENU_ELEMENT' id='menu_element1'>
<a href='start.html'>
GETTING STARTED
</a>
</div>
<div class='MENU_ELEMENT' id='menu_element2'>
<a href='examples.html'>
EXAMPLES
</a>
</div>
<div class='MENU_ELEMENT' id='menu_element3'>
<a href='func.html'>
FUNCTIONALITY
</a>
</div>
<div class='MENU_ELEMENT' id='menu_element4'>
<a href='behav.html'>
BEHAVIOR
</a>
</div>
</div>
</div>
<div id='content'>
<nav>
<i>
functions:<br>
</i>
<a href='func.html#append'>
append
</a>
<a href='func.html#copy'>
copy
</a>
<a href='func.html#deserializeBytes'>
deserializeBytes
</a>
<a href='func.html#deserializeJson'>
deserializeJson
</a>
<a href='func.html#errorCode'>
errorCode
</a>
<a href='func.html#errorMsg'>
errorMsg
</a>
<a href='func.html#errorPos'>
errorPos
</a>
<a href='func.html#exists'>
exists
</a>
<a href='func.html#fromByteArray'>
fromByteArray
</a>
<a href='func.html#isArray'>
isArray
</a>
<a href='func.html#isNullValue'>
isNullValue
</a>
<a href='func.html#isObject'>
isObject
</a>
<a href='func.html#isValue'>
isValue
</a>
<a href='func.html#keys'>
keys
</a>
<a href='func.html#loadFile'>
loadFile
</a>
<a href='func.html#move'>
move
</a>
<a href='func.html#popFirst'>
popFirst
</a>
<a href='func.html#popLast'>
popLast
</a>
<a href='func.html#prepend'>
prepend
</a>
<a href='func.html#remove'>
remove
</a>
<a href='func.html#save'>
save
</a>
<a href='func.html#saveAs'>
saveAs
</a>
<a href='func.html#serializeToBytes'>
serializeToBytes
</a>
<a href='func.html#serializeToJson'>
serializeToJson
</a>
<a href='func.html#setEmptyArray'>
setEmptyArray
</a>
<a href='func.html#setEmptyObject'>
setEmptyObject
</a>
<a href='func.html#setNull'>
setNull
</a>
<a href='func.html#setValue'>
setValue
</a>
<a href='func.html#size'>
size
</a>
<a href='func.html#toString'>
toString
</a>
<a href='func.html#type'>
type
</a>
<a href='func.html#value'>
value
</a>
</nav>
<div id='articles'>
<article class='narrow'>
<h3>
WHAT IS IT?
</h3>
<p>
JsonWax is a Qt C++ library for handling JSON-documents.
It's an alternative to Qt's built-in set of JSON classes, made for Qt 5.7 or later.<br><br>
The purpose is to shorten your JSON-handling code, and keep your mind on
the structure of your document.<br><br>
Essentially, finding a value in a JSON-document is like finding
a file, where the path is a sequence of strings and/or numbers, which here is expressed as
a <em>QVariantList</em>.<br><br>
Instead of extracting objects from objects, you write the whole "directory" in one line, which makes
nested JSON-documents easy to manage.<br><br>
I have created easy-to-use functions for common operations such as: Setting/retrieving/deleting values, loading/saving the document to/from file, copying/moving data from one
part of the document to another, and much more.<br><br>
Furthermore, you can even serialize QObjects and other Qt data types to JSON.
Both as readable strings (based on <em>QTextStream</em>), and as a Base64-encoded byte array (based on <em>QDataStream</em>).<br><br>
Unfortunately this ease of use comes at the price of being slower than <em>QJsonDocument</em>.<br><br><br>
</p>
<a href='http://json.org/'>
JSON-document format
</a>
<a href='https://github.com/doublejim/JsonWax/'>
JsonWax Github Repository
</a>
<p>
<br>
</p>
</article>
<article class='narrow'>
<h3>
HOW DOES IT WORK?
</h3>
<p>
When loading a JSON-document, JsonWax parses it, and converts it to an internal format,
which allows for easy manipulation. All double, integer, bool and string values are
converted to their actual types (a string is stored as a QString). Therefore, loading and saving a document will not always
give the exact same data, because of the limitations of the types (double can only use so and so many digits; 10e2 will be converted
to 1000, and such things). However, this means that you can easily store and retrieve basic values
in/from a JSON-document.<br>
When converting JsonWax's internal format back to a string, the
JSON-Object will always have its keys sorted alphabetically, and JSON-Arrays will always
keep the same order.
</p>
</article>
<article class='narrow'>
<h3>
KNOWN BUGS
</h3>
<p>
• (2018-02-25) JsonWax finds the working path in its constructor. That should instead be delayed until
the first actual attempt at saving the file, as this current configuration will cause problems if QApplication
hasn't been initialized.<br>
• (2018-02-25) Fix compiling on Windows XP (since I started using thread_local this has been a problem).<br>
• Currently, if you use special characters, and load a file using <em>loadFile()</em>, you'll need to make sure that the file is UTF-8 encoded.
Fx. æ, ø, å can be stored in ANSI, but expecting them to be UTF-8 characters
results in losing them. They would be shown as "�".<br>
So make sure that the characters are preserved!
</p>
</article>
<article class='narrow'>
<h3>
FUTURE GOALS FOR THIS PROJECT
</h3>
<p>
• JSON schema validation.<br>
• Remake the internal data structure, so that there will be better performance (back to the drawing board).
</p>
</article>
</div></div>
<footer></footer>
</body></html>