Minsky
minsky::anonymous_namespace{godleyExport.cc} Namespace Reference

Functions

string fcStr (const FlowCoef &fc)
 
string trim (string x)
 

Function Documentation

◆ fcStr()

string minsky::anonymous_namespace{godleyExport.cc}::fcStr ( const FlowCoef fc)

Definition at line 38 of file godleyExport.cc.

References minsky::FlowCoef::coef, minsky::FlowCoef::name, minsky::str(), and minsky::uqName().

Referenced by minsky::exportToCSV(), and minsky::exportToLaTeX().

39  {
40  auto nm=uqName(fc.name);
41  if (fc.coef==1)
42  return nm;
43  if (fc.coef==-1)
44  return "-"+nm;
45  if (fc.coef==0)
46  return "";
47  return str(fc.coef)+nm;
48  }
std::string uqName(const std::string &name)
extract unqualified portion of name
Definition: valueId.cc:135
std::string str(T x)
utility function to create a string representation of a numeric type
Definition: str.h:33
Here is the call graph for this function:
Here is the caller graph for this function:

◆ trim()

string minsky::anonymous_namespace{godleyExport.cc}::trim ( string  x)

Definition at line 51 of file godleyExport.cc.

Referenced by minsky::exportToCSV().

52  {
53  if (x.substr(0,3)=="<i>")
54  x=x.substr(3);
55  if (x.length()>=4 && x.substr(x.length()-4)=="</i>")
56  return x.substr(0,x.length()-4);
57  return x;
58  }
Here is the caller graph for this function: