CMS 3D CMS Logo

Functions
reco::exprEvalDetails Namespace Reference

Functions

std::string execSysCommand (const std::string &cmdline)
 
std::unique_ptr< std::istream > popenCPP (const std::string &cmdline)
 

Function Documentation

◆ execSysCommand()

std::string reco::exprEvalDetails::execSysCommand ( const std::string &  cmdline)
inline

Definition at line 12 of file popenCPP.h.

12  {
13  std::ostringstream n1;
14  {
15  auto s1 = popenCPP(cmdline + " 2>&1");
16  n1 << s1->rdbuf();
17  }
18  return n1.str();
19  }

References popenCPP().

Referenced by reco::ExpressionEvaluator::ExpressionEvaluator().

◆ popenCPP()

std::unique_ptr< std::istream > reco::exprEvalDetails::popenCPP ( const std::string &  cmdline)

Definition at line 33 of file popenCPP.cc.

33  {
34  FILE *f = popen(cmdline.c_str(), "r");
35  if (!f)
36  throw cms::Exception("PopenCPP", "(\"" + cmdline + "\") failed");
37  return std::unique_ptr<std::istream>(new cfstream(f));
38 }

References Exception, and f.

Referenced by execSysCommand().

f
double f[11][100]
Definition: MuScleFitUtils.cc:78
cmdline
Definition: CmdLine.h:119
Exception
Definition: hltDiff.cc:245
reco::exprEvalDetails::popenCPP
std::unique_ptr< std::istream > popenCPP(const std::string &cmdline)
Definition: popenCPP.cc:33