mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:24:57 +00:00
AK: A few JSON improvements
* Add double number to object serializer * Handle negative double numbers correctly * Handle \r and \n in quoted strings independently This improves the situation when keys contain \r or \n that currently has the effect that "a\rkey" and "a\nkey" in an JSON object are the same key value.
This commit is contained in:
parent
c925aaceb2
commit
c54855682c
2 changed files with 10 additions and 1 deletions
|
@ -109,6 +109,12 @@ public:
|
|||
m_builder.appendf("%llu", value);
|
||||
}
|
||||
|
||||
void add(const StringView& key, double value)
|
||||
{
|
||||
begin_item(key);
|
||||
m_builder.appendf("%f", value);
|
||||
}
|
||||
|
||||
JsonArraySerializer<Builder> add_array(const StringView& key)
|
||||
{
|
||||
begin_item(key);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue