You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Import/export of C++ JSON / TOML objects from/to ValueObject of TeaScript (as a Named Tuple)
29
29
30
30
## Example HTTP GET
31
+
**Please, note:** The pre-compiled Windows and Linux packages of the TeaScript Host Application have this feature enabled by default (download link abve).<br>
32
+
For the TeaScript C++ Library it is an opt-in feature and must be enabled first before compilation (see optional feature section below).
31
33
```cpp
32
34
// issue a http GET request (here to a test page for JSON as payload)
33
35
def reply := web_get( "headers.jsontest.com" )
@@ -356,13 +358,19 @@ All compilers are compiling in **C++20** and for **x86_64**.<br>
356
358
357
359
**None** -- for fully C++20 supporting compilers / C++ standard libraries.
358
360
359
-
**Libfmt (as header only)** -- for gcc 11 / clang 14 (tested with **libfmt 10.2.1** and **libfmt 10.1.1**)<br>
361
+
**Libfmt (as header only)** -- for gcc 11 / clang 14 (tested with **libfmt 11.0.2**, **libfmt 10.2.1** and **libfmt 10.1.1**)<br>
360
362
- Libfmt can be downloaded here https://fmt.dev/latest/index.html <br>
361
363
You only need to set the include path in your project(s) / for compilation. Detection is then done automatically.
362
364
363
365
HINT: For Windows with C++20 it is also recommended to use libfmt for the best possible Unicode support for print to stdout.
364
366
365
367
**Optional Features:** <br>
368
+
**Web Preview** - In order to enable the Web Preview module the following steps have to be done:<br>
369
+
1.) Add include <TeaScriptRoot>/modules/include/<br>
370
+
2.) Add include to the Boost Library.<br>
371
+
3.) Add modules/WebPreview.cpp to your project compilation.<br>
372
+
4.) (Optional) If you want the default Engine loads the WebPreview module set the define TEASCRIPT_ENGINE_USE_WEB_PREVIEW to 1.<br>
373
+
366
374
**TOML Support** - for the integrated TOML Support you need the toml++ Library. (tested with **3.4.0**) <br>
367
375
You can find the toml++ library here: https://github.com/marzer/tomlplusplus <br>
368
376
You only need to set the include path in your project(s) / for compilation. Detection is then done automatically. <br>
@@ -371,6 +379,14 @@ See include/teascript/TomlSupport.hpp for some more details.
371
379
**Color and Format String Support** - for colorful output and the format string feature you need the libfmt library.<br>
372
380
See Libfmt section above.
373
381
382
+
**JsonAdapter** - You can change the Json library which is used by TeaScript to one of nlohmann::json, RapidJson or Boost.Json.
383
+
Per default PicoJson is used and is enabled by default.<br>
384
+
For use a different adapter you must do the following steps:<br>
385
+
1.) Add include to <TeaScriptRoot>/extensions/include/.<br>
386
+
2.) Add the corresponding JsonAdapter.cpp to your project, e.g., extenstions/JsonAdapterNlohmann.cpp<br>
387
+
3.) Add include for the json library of use, e.g., <rootpath>/nlohmann_3.11.3/single_inlude/<br>
388
+
4.) Set the define TEASCRIPT_JSON_FLAVOR to the desired Json flavor, e.g., TEASCRIPT_JSON_NLOHMANN<br>
389
+
374
390
# Building the demo app
375
391
376
392
**Windows:** Use the provided VS-project or the settings in compile.props.
0 commit comments