mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:37:45 +00:00
JSON: Templatize the JSON serialization code
This makes it possible to use something other than a StringBuilder for serialization (and to produce something other than a String.) :^)
This commit is contained in:
parent
43ec733b61
commit
f6998b1817
11 changed files with 145 additions and 109 deletions
|
@ -1,6 +1,7 @@
|
|||
#include <AK/JsonArray.h>
|
||||
#include <AK/JsonObject.h>
|
||||
#include <AK/JsonValue.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <LibCore/CFile.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
@ -65,6 +66,6 @@ void print(const JsonValue& value, int indent)
|
|||
printf("\033[32;1m");
|
||||
else if (value.is_null() || value.is_undefined())
|
||||
printf("\033[34;1m");
|
||||
printf("%s", value.serialized().characters());
|
||||
printf("%s", value.to_string().characters());
|
||||
printf("\033[0m");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue