|
Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
|
Functions | |
| std::string | stripString (std::string const &a_string, bool a_left=true, bool a_right=true) |
| std::vector< std::string > | splitString (std::string const &a_string, char a_delimiter, bool a_strip=false) |
| std::vector< std::string > | splitString (std::string const &a_string, std::string const &a_delimiter, bool a_strip=false) |
| std::string | joinStrings (std::string const &a_sep, std::vector< std::string > a_strings) |
| std::string | replaceString (std::string const &a_string, std::string const &a_old, std::string const &a_new, bool a_all) |
| std::vector< std::string > | splitXLinkString (std::string const &a_string) |
| bool | stringToInt (std::string const &a_string, int &a_value) |
| bool | stringToSize_t (std::string const &a_string, std::size_t &a_value) |
| std::string | argumentsToString (char const *a_format,...) |
| std::string | doubleToString3 (char const *a_format, double a_value, bool a_reduceBits=false) |
| std::string | doubleToShortestString (double a_value, int a_significantDigits=15, int a_favorEFormBy=0) |
| void | printCommand (std::string const &a_indent, int a_argc, char **a_argv) |
| std::string LUPI::Misc::argumentsToString | ( | char const * | a_format, |
| ... ) |
Returns a string that represent the arguments formatted per a_format.
| a_format | [in] A printf like format specifier for converting a double to a string. |
Definition at line 305 of file LUPI_misc.cc.
Referenced by doubleToString3(), PoPI::ParseIntidInfo::id(), PoPI::Database::indexFromIntid(), GIDI::intToString(), GIDI::LLNL_fidToLabel(), GIDI::LLNL_gidToLabel(), GIDI::Transporting::Flux_order::print(), GIDI::Transporting::MultiGroup::print(), MCGIDI::ContinuousEnergyGain::print(), MCGIDI::DomainHash::print(), MCGIDI::HeatedCrossSectionContinuousEnergy::print(), MCGIDI::HeatedCrossSectionsContinuousEnergy::print(), MCGIDI::HeatedReactionCrossSectionContinuousEnergy::print(), MCGIDI::NuclideGammaBranchInfo::print(), MCGIDI::NuclideGammaBranchStateInfo::print(), PoPI::Database::print(), PoPI::ParseIdInfo::print(), GIDI::RISI::Reaction::printAsRIS_file(), GIDI::size_t_ToString(), PoPI::ChemicalElement::toXMLList(), PoPI::Isotope::toXMLList(), PoPI::MetaStable::toXMLList(), PoPI::PQ_double::valueToString(), PoPI::PQ_integer::valueToString(), MCGIDI::HeatedReactionCrossSectionMultiGroup::write(), and MCGIDI::MultiGroupGain::write().
| std::string LUPI::Misc::doubleToShortestString | ( | double | a_value, |
| int | a_significantDigits, | ||
| int | a_favorEFormBy ) |
Returns a string representation of a_value that contains the smallest number of character yet still agrees with a_value to a_significantDigits significant digits. For example, for a_value = 1.20000000001, "1.2" will be returned if a_significantDigits is less than 11, otherwise "1.20000000001" is returned.
| a_value | [in/out] The double to convert to a string. |
| a_significantDigits | [in] The number of significant digits the string representation should agree with the double. |
| a_favorEFormBy | [in] The bigger this value the more likely an e-form will be favored in the string representation. |
Definition at line 349 of file LUPI_misc.cc.
Referenced by GIDI::doublesToXMLList(), GIDI::nodeWithValuesToDoubles(), GIDI::RISI::Reaction::printAsRIS_file(), GIDI::ACE_URR::IncidentEnergy::toXMLList(), GIDI::AxisDomain::toXMLList(), GIDI::PhysicalQuantity::toXMLList(), GIDI::Styles::CoulombPlusNuclearElasticMuCutoff::toXMLList(), GIDI::TargetInfo::Nuclide::toXMLList(), GIDI::Functions::Constant1d::toXMLList_func(), GIDI::Functions::DiscreteGamma2d::toXMLList_func(), GIDI::Functions::Gridded1d::toXMLList_func(), GIDI::Functions::Legendre1d::toXMLList_func(), GIDI::Functions::Polynomial1d::toXMLList_func(), GIDI::Functions::PrimaryGamma2d::toXMLList_func(), GIDI::Functions::Regions1d::toXMLList_func(), GIDI::Functions::Regions2d::toXMLList_func(), GIDI::Functions::Unspecified1d::toXMLList_func(), GIDI::Functions::Xs_pdf_cdf1d::toXMLList_func(), GIDI::Functions::XYs1d::toXMLList_func(), GIDI::Functions::XYs2d::toXMLList_func(), and GIDI::Functions::XYs3d::toXMLList_func().
| std::string LUPI::Misc::doubleToString3 | ( | char const * | a_format, |
| double | a_value, | ||
| bool | a_reduceBits ) |
Returns a string that represent the double a_value using a printf like format specifier.
| a_format | [in] A printf like format specifier for converting a double to a string. |
| a_value | [in] The double to be converted to a string. |
| a_reduceBits | [in] If true the lowest digit or two are altered in an attempt to convert numbers like 4.764999999999999 and 4.765 to the same string. |
Definition at line 327 of file LUPI_misc.cc.
Referenced by MCGIDI::HeatedCrossSectionContinuousEnergy::print(), and MCGIDI::HeatedCrossSectionsContinuousEnergy::sampleReaction().
| std::string LUPI::Misc::joinStrings | ( | std::string const & | a_sep, |
| std::vector< std::string > | a_strings ) |
This function adds together the strings in a_strings with a_sep between the strings in a_strings.
| a_delimiter | [in] The delimiter string. |
| a_strings | [in] The string to split. |
Definition at line 158 of file LUPI_misc.cc.
| void LUPI::Misc::printCommand | ( | std::string const & | a_indent, |
| int | a_argc, | ||
| char ** | a_argv ) |
For internal use only.
| a_indent | [in] A string containing the help line for an argument up to the description string. |
| a_argc | [in] The number of command arguments. |
| a_argv | [in] The list of command arguments. |
Definition at line 367 of file LUPI_misc.cc.
| std::string LUPI::Misc::replaceString | ( | std::string const & | a_string, |
| std::string const & | a_old, | ||
| std::string const & | a_new, | ||
| bool | a_all ) |
This function replace one (or all if a_all is true) occurrence(s) of a_old in a_string with a_new.
| a_string | [in] The string to split. |
| a_old | [in] The current sub-string in a_string that is replaced by a_new. |
| a_new | [in] The new sub-string that replace a_old.. |
| a_all | [in] If true all occurrence of a_old are replaced by a_new; otherwise, only the first occurrence is replaced. |
Definition at line 183 of file LUPI_misc.cc.
| std::vector< std::string > LUPI::Misc::splitString | ( | std::string const & | a_string, |
| char | a_delimiter, | ||
| bool | a_strip ) |
This function splits that string a_string into separate strings using the delimiter character a_delimiter. If the delimiter is the space character, consecutive spaces are treated as one space, and leading and trailing white spaces are ignored.
| a_string | [in] The string to split. |
| a_delimiter | [in] The delimiter character. |
| a_strip | [in] If true, white spaces are removed from the begining and ending of each string in the list returned. |
Definition at line 103 of file LUPI_misc.cc.
Referenced by GIDI::RISI::Protare::addReaction(), GIDI::FlattenedArrayData::FlattenedArrayData(), MCGIDI::GRIN_captureLevelProbability::GRIN_captureLevelProbability(), MCGIDI::GRIN_levelsAndProbabilities::GRIN_levelsAndProbabilities(), PoPI::ParseIdInfo::ParseIdInfo(), and LUPI::FormatVersion::setFormat().
| std::vector< std::string > LUPI::Misc::splitString | ( | std::string const & | a_string, |
| std::string const & | a_delimiter, | ||
| bool | a_strip ) |
This function splits that string a_string into separate strings using the delimiter string a_delimiter.
| a_string | [in] The string to split. |
| a_delimiter | [in] The delimiter string. |
| a_strip | [in] If true, white spaces are removed from the begining and ending of each string in the list returned. |
Definition at line 129 of file LUPI_misc.cc.
| std::vector< std::string > LUPI::Misc::splitXLinkString | ( | std::string const & | a_XLink | ) |
This function splits that string a_string into separate strings using the delimiter character "/" as for a XLink. The delimiter character "/"'s in each quoted region of the string is not split.
| a_string | [in] The XLink string to split. |
Definition at line 206 of file LUPI_misc.cc.
Referenced by GUPI::Ancestry::findInAncestry(), and GUPI::Ancestry::findInAncestry().
| bool LUPI::Misc::stringToInt | ( | std::string const & | a_string, |
| int & | a_value ) |
Converts a string to an integer. All characteros of the string must be valid int characters except for the trailing 0.
| a_string | [in] The string to convert to an int. |
| a_value | [in] The converted int value. |
Definition at line 260 of file LUPI_misc.cc.
Referenced by PoPI::ParseIdInfo::ParseIdInfo(), and LUPI::FormatVersion::setFormat().
| bool LUPI::Misc::stringToSize_t | ( | std::string const & | a_string, |
| std::size_t & | a_value ) |
Converts a string to an integer. All characteros of the string must be valid int characters except for the trailing 0.
| a_string | [in] The string to convert to an int. |
| a_value | [in] The converted int value. |
Definition at line 283 of file LUPI_misc.cc.
| std::string LUPI::Misc::stripString | ( | std::string const & | a_string, |
| bool | a_left, | ||
| bool | a_right ) |
This returns a copy of a_string with its leading (if a_left is true) and trailing (if a_left is true) white spaces removed.
| a_string | [in] The string to copy and strip leading and trailing white spaces from. |
| a_left | [in] If true, white spaces are removed from the beginning of the string. |
| a_right | [in] If true, white spaces are removed from the ending of the string. |
Definition at line 68 of file LUPI_misc.cc.
Referenced by MCGIDI::GRIN_levelsAndProbabilities::GRIN_levelsAndProbabilities(), splitString(), and splitString().