summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2024-05-01 08:07:04 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2024-05-01 08:07:04 +0200
commitecc84973491dd29858eeaf986940d8cfe9986b7c (patch)
treecd91c3e2326777f1f6e30b9e172f51c69e3b0c98
parent8d43776861883e9a6618b9a1cda922aa54443797 (diff)
downloaddabmux-ecc84973491dd29858eeaf986940d8cfe9986b7c.tar.gz
dabmux-ecc84973491dd29858eeaf986940d8cfe9986b7c.tar.bz2
dabmux-ecc84973491dd29858eeaf986940d8cfe9986b7c.zip
Handle int32 and int64 explicitly in Json
-rw-r--r--lib/Json.cpp14
-rw-r--r--lib/Json.h6
2 files changed, 14 insertions, 6 deletions
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<double>(value.v)) {
ss << std::fixed << std::get<double>(value.v);
}
- else if (std::holds_alternative<ssize_t>(value.v)) {
- ss << std::get<ssize_t>(value.v);
+ else if (std::holds_alternative<uint64_t>(value.v)) {
+ ss << std::get<uint64_t>(value.v);
}
- else if (std::holds_alternative<size_t>(value.v)) {
- ss << std::get<size_t>(value.v);
+ else if (std::holds_alternative<int64_t>(value.v)) {
+ ss << std::get<int64_t>(value.v);
+ }
+ else if (std::holds_alternative<uint32_t>(value.v)) {
+ ss << std::get<uint32_t>(value.v);
+ }
+ else if (std::holds_alternative<int32_t>(value.v)) {
+ ss << std::get<int32_t>(value.v);
}
else if (std::holds_alternative<bool>(value.v)) {
ss << (std::get<bool>(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<value_t>,
std::string,
double,
- size_t,
- ssize_t,
+ int64_t,
+ uint64_t,
+ int32_t,
+ uint32_t,
bool,
std::nullopt_t> v;
};