mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 21:07:36 +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
|
@ -8,6 +8,8 @@ namespace AK {
|
|||
|
||||
class StringBuilder {
|
||||
public:
|
||||
using OutputType = String;
|
||||
|
||||
explicit StringBuilder(int initial_capacity = 16);
|
||||
~StringBuilder() {}
|
||||
|
||||
|
@ -17,6 +19,8 @@ public:
|
|||
void appendf(const char*, ...);
|
||||
void appendvf(const char*, va_list);
|
||||
|
||||
String build() { return to_string(); }
|
||||
|
||||
String to_string();
|
||||
ByteBuffer to_byte_buffer();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue