From 95d40000c9b8011ed4767b2747a33a11f37d597c 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)