BornAgain
1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Functions | |
bool | matchesPattern (const std::string &text, const std::string &wildcardPattern) |
std::string | padRight (const std::string &name, size_t length) |
std::vector< std::string > | split (const std::string &text, const std::string &delimeter) |
void | replaceItemsFromString (std::string &text, const std::vector< std::string > &items, const std::string &replacement="") |
std::string | join (const std::vector< std::string > &joinable, const std::string &joint) |
std::string | removeSubstring (const std::string &text, const std::string &substr) |
template<typename T > | |
std::string | scientific (const T value, int n=10) |
std::string | to_lower (std::string text) |
Utility functions to analyze or modify strings.
bool StringUtils::matchesPattern | ( | const std::string & | text, |
const std::string & | wildcardPattern | ||
) |
Returns true if text matches pattern with wildcards '*' and '?'.
Definition at line 20 of file StringUtils.cpp.
Referenced by ParameterPool::getMatchedParameters().
std::string StringUtils::padRight | ( | const std::string & | name, |
size_t | length | ||
) |
Returns string right-padded with blanks.
Definition at line 49 of file StringUtils.cpp.
References anonymous_namespace{BoxCompositionBuilder.cpp}::length.
Referenced by FitPrintService::parameterString().
std::vector< std::string > StringUtils::split | ( | const std::string & | text, |
const std::string & | delimeter | ||
) |
Split string into vector of string using delimeter.
Returns token vector obtained by splitting string at delimiters.
Definition at line 57 of file StringUtils.cpp.
Referenced by MinimizerOptions::processCommand(), and MinimizerOptions::setOptionString().
void StringUtils::replaceItemsFromString | ( | std::string & | text, |
const std::vector< std::string > & | items, | ||
const std::string & | replacement = "" |
||
) |
Replaces all occurences of items from string text with delimiter.
Definition at line 64 of file StringUtils.cpp.
Referenced by anonymous_namespace{DataFormatUtils.cpp}::getAxisStringRepresentation().
std::string StringUtils::join | ( | const std::vector< std::string > & | joinable, |
const std::string & | joint | ||
) |
Returns string obtain by joining vector elements.
Definition at line 71 of file StringUtils.cpp.
Referenced by pyfmt2::argumentList(), and anonymous_namespace{Simulation.cpp}::runComputations().
std::string StringUtils::removeSubstring | ( | const std::string & | text, |
const std::string & | substr | ||
) |
Removes multiple occurences of given substring from a string and returns result.
Definition at line 83 of file StringUtils.cpp.
std::string StringUtils::scientific | ( | const T | value, |
int | n = 10 |
||
) |
Returns scientific string representing given value of any numeric type.
Definition at line 54 of file StringUtils.h.
Referenced by PolyhedralEdge::contrib(), PolyhedralFace::edge_sum_ff(), Polyhedron::evaluate_centered(), PolyhedralFace::ff_n_core(), FitPrintService::iterationHeaderString(), FitPrintService::parameterString(), pyfmt::printScientificDouble(), RootMinimizerAdapter::statusMap(), GSLLevenbergMarquardtMinimizer::statusMap(), Minuit2Minimizer::statusMap(), AttLimits::toString(), anonymous_namespace{OutputDataWriteStrategy.cpp}::Write1DRepresentation(), anonymous_namespace{OutputDataWriteStrategy.cpp}::Write2DRepresentation(), and anonymous_namespace{OutputDataWriteStrategy.cpp}::WriteOutputDataDoubles().
std::string StringUtils::to_lower | ( | std::string | text | ) |
Returns new string which is lower case of text.
Definition at line 92 of file StringUtils.cpp.