File indexing completed on 2024-04-06 12:01:20
0001 #ifndef CommonToolsUtils_popenCPP_H
0002 #define CommonToolsUtils_popenCPP_H
0003 #include <memory>
0004 #include <string>
0005 #include <sstream>
0006
0007 namespace reco {
0008 namespace exprEvalDetails {
0009
0010 std::unique_ptr<std::istream> popenCPP(const std::string &cmdline);
0011
0012 inline std::string execSysCommand(const std::string &cmdline) {
0013 std::ostringstream n1;
0014 {
0015 auto s1 = popenCPP(cmdline + " 2>&1");
0016 n1 << s1->rdbuf();
0017 }
0018 return n1.str();
0019 }
0020
0021 }
0022 }
0023
0024 #endif