32 const std::string& name,
const std::string& extension)
38 std::string newName(name);
41 int i = newName.length();
42 while (newName[--i] ==
' ') newName = std::string(newName, 0, i);
46 for (i = 0; i < int(newName.length()); i++) {
56 newName.append(extension);
63 const std::string& name,
const std::string& extension)
67 return name.substr(0, name.find(extension));
75 std::string newName(name);
77 for (
int i = 0; i < size - int(name.size()); i++) {
91 std::ostringstream nStream;
92 nStream << isotope->
N();
93 std::string n(nStream.str());
96 if (name.find(n) < name.size())
111 int i = name.length();
112 while (name[--i] ==
' ') name = std::string(name, 0, i);
120 if (
int(name.length()) > size) name = std::string(name, 0, size);
125 double tolerance,
double number,
const std::string& separator)
130 if (fabs(number) < tolerance) number = 0.0;
135 out << std::scientific << std::setw(size) << std::setprecision(precision)
136 << number << std::fixed << separator;
139 out << std::setw(size) << std::setprecision(precision) << number
148 double tolerance,
const std::string& separator1,
double number,
149 const std::string& separator2)
156 if (fabs(number) < tolerance) number = 0.0;
161 out << std::scientific << std::setw(size) << std::setprecision(precision)
162 << number << std::fixed;
165 out << std::setw(size) << std::setprecision(precision) << number;
179 tm time = *localtime(&t);
181 std::ostringstream tmpStream;
182 tmpStream << time.tm_year + 1900 <<
"-" << std::setw(2) << std::setfill(
'0')
183 << time.tm_mon + 1 <<
"-" << std::setw(2) << std::setfill(
'0')
186 return tmpStream.str();
The VGM interface to elements.
virtual int N() const =0
Return the effective number of nucleons.
virtual std::string Name() const =0
Return the name of this element.
std::string IsotopeName(const VGM::IIsotope *isotope)
std::string AppendName(const std::string &name, int size)
const std::string fgkNotAllowedChars
const std::string fgkNotAllowedChars1
std::string StripName(const std::string &name, const std::string &extension="")
const char fgkCharReplacement
void CutName(std::string &name)
std::ostream & SmartPut(std::ostream &out, int size, int precision, double tolerance, double number, const std::string &separator)
std::string UpdateName(const std::string &name, const std::string &extension="")