From d7345bbf71eefb20bc2fb15dbf6595314d65f860 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Wed, 1 May 2024 08:07:36 +0200 Subject: Handle int32 and int64 explicitly in Json --- lib/Json.cpp | 14 ++++++++++---- lib/Json.h | 6 ++++-- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/Json.cpp b/lib/Json.cpp index 4dc2f25..361a149 100644 --- a/lib/Json.cpp +++ b/lib/Json.cpp @@ -84,11 +84,17 @@ namespace json { else if (std::holds_alternative(value.v)) { ss << std::fixed << std::get(value.v); } - else if (std::holds_alternative(value.v)) { - ss << std::get(value.v); + else if (std::holds_alternative(value.v)) { + ss << std::get(value.v); } - else if (std::holds_alternative(value.v)) { - ss << std::get(value.v); + else if (std::holds_alternative(value.v)) { + ss << std::get(value.v); + } + else if (std::holds_alternative(value.v)) { + ss << std::get(value.v); + } + else if (std::holds_alternative(value.v)) { + ss << std::get(value.v); } else if (std::holds_alternative(value.v)) { ss << (std::get(value.v) ? "true" : "false"); diff --git a/lib/Json.h b/lib/Json.h index 65aa668..b082f92 100644 --- a/lib/Json.h +++ b/lib/Json.h @@ -50,8 +50,10 @@ namespace json { std::vector, std::string, double, - size_t, - ssize_t, + int64_t, + uint64_t, + int32_t, + uint32_t, bool, std::nullopt_t> v; }; -- cgit v1.2.3