1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 08:44:58 +00:00

AK: Make JsonValue and JsonObjectSerializer speak int/long/long long

While width-oriented integer types are nicer from the programmer's
perspective, we have to accept that C++ thinks in int/long/long long.
This commit is contained in:
Andreas Kling 2020-05-22 13:57:23 +02:00
parent ba390f9b34
commit a1db1e6664
3 changed files with 46 additions and 12 deletions

View file

@ -85,25 +85,37 @@ public:
m_builder.append(value ? "true" : "false");
}
void add(const StringView& key, i32 value)
void add(const StringView& key, int value)
{
begin_item(key);
m_builder.appendf("%d", value);
}
void add(const StringView& key, u32 value)
void add(const StringView& key, unsigned value)
{
begin_item(key);
m_builder.appendf("%u", value);
}
void add(const StringView& key, i64 value)
void add(const StringView& key, long value)
{
begin_item(key);
m_builder.appendf("%ld", value);
}
void add(const StringView& key, long unsigned value)
{
begin_item(key);
m_builder.appendf("%lu", value);
}
void add(const StringView& key, long long value)
{
begin_item(key);
m_builder.appendf("%lld", value);
}
void add(const StringView& key, u64 value)
void add(const StringView& key, long long unsigned value)
{
begin_item(key);
m_builder.appendf("%llu", value);