From 192325a77d593e404e74ef5e204aed8801b4e66f Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 28 Sep 2022 18:02:23 +0000 Subject: kernel: move RunCommandParseJSON to its own file Because libbitcoinkernel does not include this new object, this has the side-effect of eliminating the unnecessary boost::process dependency. --- src/util/run_command.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/util/run_command.h (limited to 'src/util/run_command.h') diff --git a/src/util/run_command.h b/src/util/run_command.h new file mode 100644 index 0000000000..afe5d831c6 --- /dev/null +++ b/src/util/run_command.h @@ -0,0 +1,21 @@ +// Copyright (c) 2022 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_UTIL_RUN_COMMAND_H +#define BITCOIN_UTIL_RUN_COMMAND_H + +#include + +class UniValue; + +/** + * Execute a command which returns JSON, and parse the result. + * + * @param str_command The command to execute, including any arguments + * @param str_std_in string to pass to stdin + * @return parsed JSON + */ +UniValue RunCommandParseJSON(const std::string& str_command, const std::string& str_std_in=""); + +#endif // BITCOIN_UTIL_RUN_COMMAND_H -- cgit v1.2.3