From 58497f1ee2c90bbae375d274c3fd8df335129945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Tue, 16 Jul 2024 15:43:24 +0200 Subject: [PATCH] Fix reading from stdin --- src/cli/convert-json-toml.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cli/convert-json-toml.cpp b/src/cli/convert-json-toml.cpp index 3abb6127f8..aa27fb0d82 100644 --- a/src/cli/convert-json-toml.cpp +++ b/src/cli/convert-json-toml.cpp @@ -3,6 +3,7 @@ #include #include +#include #include namespace json = openPMD::json; @@ -38,7 +39,11 @@ int main(int argc, char const **argv) // Just read the whole stream into memory // Not very elegant, but we'll hold the entire JSON/TOML dataset // in memory at some point anyway, so it doesn't really matter - std::cin >> jsonOrToml; + { + std::stringbuf readEverything; + std::cin >> &readEverything; + jsonOrToml = readEverything.str(); + } break; case 2: if (strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-h") == 0)