![]() |
OpenMS
|
Functions | |
| template<typename T > | |
| void | appendToStr (const T &i, std::string &target) |
Append i to target (Boost.Karma, fast) | |
| void | appendToStr (int i, std::string &target) |
Append integer i to target. | |
| void | appendToStr (unsigned int i, std::string &target) |
| void | appendToStr (short int i, std::string &target) |
| void | appendToStr (short unsigned int i, std::string &target) |
| void | appendToStr (long int i, std::string &target) |
| void | appendToStr (long unsigned int i, std::string &target) |
| void | appendToStr (long long unsigned int i, std::string &target) |
| void | appendToStr (long long signed int i, std::string &target) |
| void | appendToStr (float f, std::string &target) |
Append float (high precision, 6 fractional digits) to target. | |
| void | appendToStrLowP (float f, std::string &target) |
Append float (low precision, 3 fractional digits) to target. | |
| void | appendToStr (double d, std::string &target) |
Append double (high precision, 15 fractional digits) to target. | |
| void | appendToStrLowP (double d, std::string &target) |
Append double (low precision, 3 fractional digits) to target. | |
| void | appendToStr (long double ld, std::string &target) |
Append long double (high precision) to target. | |
| void | appendToStrLowP (long double ld, std::string &target) |
Append long double (low precision) to target. | |
| void | appendToStr (const DataValue &d, bool full_precision, std::string &target) |
Append DataValue string representation to target (non-inline; defined in StringUtils.cpp) | |
| std::string | toStr (int i) |
| std::string | toStr (unsigned int i) |
| std::string | toStr (short int i) |
| std::string | toStr (short unsigned int i) |
| std::string | toStr (long int i) |
| std::string | toStr (long unsigned int i) |
| std::string | toStr (long long unsigned int i) |
| std::string | toStr (long long signed int i) |
| std::string | toStr (float f, bool full_precision=true) |
Float to string; full_precision selects 6-digit (true) or 3-digit (false) output. | |
| std::string | toStr (double d, bool full_precision=true) |
Double to string; full_precision selects 15-digit (true) or 3-digit (false) output. | |
| std::string | toStr (long double ld, bool full_precision=true) |
Long double to string; full_precision selects full-precision or 3-digit output. | |
| std::string | toStr (char c) |
| std::string | toStr (const std::string &s) |
| std::string | toStr (const char *s) |
| std::string | toStr (const DataValue &d, bool full_precision=true) |
| DataValue to string — the LENIENT stringification (non-inline; defined in StringUtils.cpp). | |
| std::string | toStr (const ParamValue &p, bool full_precision=true) |
| ParamValue to string — lenient, like toStr(const DataValue&) (non-inline; defined in StringUtils.cpp) | |
| Int32 | toInt32 (const std::string &s) |
| Int64 | toInt64 (const std::string &s) |
| float | toFloat (const std::string &s) |
| double | toDouble (const std::string &s) |
| template<typename IteratorT > | |
| bool | extractDouble (IteratorT &begin, const IteratorT &end, double &target) |
| template<typename IteratorT > | |
| bool | extractInt (IteratorT &begin, const IteratorT &end, int &target) |
| const char * | skipWhitespace (const char *p, const char *p_end) |
| Returns pointer to first non-whitespace character in [p, p_end), or p_end. | |
| int | skipWhitespace (const std::string_view &data) |
Returns count of leading whitespace characters in data. | |
| const char * | skipNonWhitespace (const char *p, const char *p_end) |
| Returns pointer to first whitespace character in [p, p_end), or p_end. | |
| int | skipNonWhitespace (const std::string_view &data) |
Returns count of leading non-whitespace characters in data. | |
| std::string | number (double d, UInt n) |
Returns a string with exactly n decimal places for d. | |
| std::string | numberLength (double d, UInt n) |
Returns a string for d with at most n characters total (scientific notation if needed) | |
| std::string | random (UInt length) |
Returns a random string of length characters from [0-9a-zA-Z]. | |
| bool | hasPrefix (const std::string &s, const std::string &prefix) |
| bool | hasPrefix (const std::string &s, char c) |
| bool | hasSuffix (const std::string &s, const std::string &sfx) |
| bool | hasSuffix (const std::string &s, char c) |
| bool | hasSubstring (const std::string &s, const std::string &sub) |
| bool | hasSubstring (const std::string &s, char c) |
| bool | has (const std::string &s, Byte byte) |
| bool | has (const std::string &s, char c) |
| std::string | prefix (const std::string &s, size_t length) |
| std::string | suffix (const std::string &s, size_t length) |
| std::string | prefix (const std::string &s, Int length) |
| std::string | suffix (const std::string &s, Int length) |
| std::string | prefix (const std::string &s, char delim) |
Returns the part of s before the first occurrence of delim (excluding it). | |
| std::string | suffix (const std::string &s, char delim) |
Returns the part of s after the last occurrence of delim (excluding it). | |
| std::string | substr (const std::string &s, size_t pos=0, size_t n=std::string::npos) |
Wrapper around std::string::substr; clamps pos to [0, size]. | |
| std::string | substr (std::string_view s, size_t pos=0, size_t n=std::string::npos) |
| string_view overload — implicit conversions from string_view to const string& don't work | |
| std::string | toStr (std::string_view sv) |
| toStr overload for string_view (returns a copy as std::string) | |
| bool | hasPrefix (std::string_view s, const std::string &prefix) |
| hasPrefix / hasSuffix / hasSubstring for string_view | |
| bool | hasSuffix (std::string_view s, const std::string &sfx) |
| bool | hasSubstring (std::string_view s, const std::string &sub) |
| std::string | chop (const std::string &s, Size n) |
Remove n characters from the end; returns empty string if n >= size. | |
| std::string & | trim (std::string &s) |
| std::string | trimmed (std::string s) |
Returns a trimmed copy of s (for use in chained/rvalue expressions) | |
| std::string & | toUpper (std::string &s) |
| std::string & | toLower (std::string &s) |
| std::string | toUppered (std::string s) |
Returns an upper-cased copy of s (for use in chained/rvalue expressions) | |
| std::string | toLowered (std::string s) |
Returns a lower-cased copy of s (for use in chained/rvalue expressions) | |
| std::string & | firstToUpper (std::string &s) |
| std::string & | reverse (std::string &s) |
| std::string & | simplify (std::string &s) |
| std::string & | fillLeft (std::string &s, char c, UInt size) |
| std::string & | fillRight (std::string &s, char c, UInt size) |
| std::string & | substitute (std::string &s, char from, char to) |
| std::string & | substitute (std::string &s, const std::string &from, const std::string &to) |
Replace all occurrences of from with to in s. | |
| std::string | substituted (std::string s, char from, char to) |
| substitute on a copy (for chained/rvalue expressions) | |
| std::string | substituted (std::string s, const std::string &from, const std::string &to) |
| std::string & | remove (std::string &s, char what) |
| std::string | fillLeft (std::string &&s, char c, UInt size) |
| std::string | fillRight (std::string &&s, char c, UInt size) |
| std::string & | ensureLastChar (std::string &s, char end) |
| std::string | ensureLastChar (std::string &&s, char end) |
| rvalue-ref overload (defined after the lvalue version it delegates to) | |
| std::string & | removeWhitespaces (std::string &s) |
| bool | isQuoted (const std::string &s, char q) |
| std::string & | quote (std::string &s, char q='"', QuotingMethod method = QuotingMethod::ESCAPE) |
| std::string & | unquote (std::string &s, char q='"', QuotingMethod method = QuotingMethod::ESCAPE) |
| bool | split (const std::string &s, char splitter, std::vector< std::string > &substrings, bool quote_protect=false) |
| bool | split (const std::string &s, const std::string &splitter, std::vector< std::string > &substrings) |
| bool | split_quoted (const std::string &s, const std::string &splitter, std::vector< std::string > &substrings, char q='"', QuotingMethod method = QuotingMethod::ESCAPE) |
| template<class StringIterator > | |
| void | concatenate (std::string &target, StringIterator first, StringIterator last, const std::string &glue="") |
Join elements [first, last) with glue between them, storing result in target. | |
| template<class StringIterator > | |
| std::string | concatenate (StringIterator first, StringIterator last, const std::string &glue="") |
Join elements [first, last) with glue and return the result. | |
| template<std::ranges::range Container> | |
| std::string | concatenate (const Container &container, const std::string &glue="") |
Join the string elements of a container with glue between them and return the result. | |
| void appendToStr | ( | const DataValue & | d, |
| bool | full_precision, | ||
| std::string & | target | ||
| ) |
Append DataValue string representation to target (non-inline; defined in StringUtils.cpp)
|
inline |
Append i to target (Boost.Karma, fast)
Referenced by OpenMS::StringConversions::append(), OpenMS::StringConversions::append(), OpenMS::StringConversions::append(), OpenMS::StringConversions::append(), OpenMS::StringConversions::append(), operator+=(), operator+=(), operator+=(), operator+=(), operator+=(), operator+=(), operator+=(), operator+=(), operator+=(), operator+=(), operator+=(), toStr(), toStr(), toStr(), toStr(), toStr(), toStr(), toStr(), toStr(), toStr(), toStr(), and toStr().
|
inline |
Append double (high precision, 15 fractional digits) to target.
References OpenMS::StringConversions::Detail::doubleFull.
|
inline |
Append float (high precision, 6 fractional digits) to target.
References OpenMS::StringConversions::Detail::floatFull.
|
inline |
Append integer i to target.
|
inline |
Append long double (high precision) to target.
References OpenMS::StringConversions::Detail::ldFull.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Append double (low precision, 3 fractional digits) to target.
References OpenMS::StringConversions::Detail::doubleShort.
|
inline |
Append float (low precision, 3 fractional digits) to target.
References OpenMS::StringConversions::Detail::floatShort.
Referenced by OpenMS::StringConversions::appendLowP(), OpenMS::StringConversions::appendLowP(), OpenMS::StringConversions::appendLowP(), toStr(), toStr(), and toStr().
|
inline |
Append long double (low precision) to target.
References OpenMS::StringConversions::Detail::ldShort.
|
inline |
Remove n characters from the end; returns empty string if n >= size.
|
inline |
Join the string elements of a container with glue between them and return the result.
Convenience overload of concatenate(first, last, glue) for any container exposing begin()/end() (e.g. std::vector<std::string>, std::set<std::string>), so callers can write
instead of the iterator form
Constraining Container to a range keeps this from competing with the iterator overloads.
References concatenate().
|
inline |
Join elements [first, last) with glue between them, storing result in target.
Referenced by concatenate(), and concatenate().
|
inline |
Join elements [first, last) with glue and return the result.
References concatenate().
|
inline |
rvalue-ref overload (defined after the lvalue version it delegates to)
References ensureLastChar().
|
inline |
Referenced by ensureLastChar().
|
inline |
References StringUtilsHelper::extractDouble().
|
inline |
References StringUtilsHelper::extractInt().
|
inline |
References fillLeft().
|
inline |
Referenced by fillLeft().
|
inline |
References fillRight().
|
inline |
Referenced by fillRight().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
References prefix().
Referenced by TOPPASBase::~TOPPASBase().
|
inline |
hasPrefix / hasSuffix / hasSubstring for string_view
References prefix().
|
inline |
|
inline |
Referenced by main().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Referenced by unquote().
|
inline |
Returns a string with exactly n decimal places for d.
|
inline |
Returns a string for d with at most n characters total (scientific notation if needed)
References OpenMS::writtenDigits().
|
inline |
Returns the part of s before the first occurrence of delim (excluding it).
If delim is not contained in s, the whole string is returned.
|
inline |
Referenced by DecoyHelper::countDecoys(), hasPrefix(), hasPrefix(), and prefix().
|
inline |
References OpenMS::DOUBLE, OpenMS::ESCAPE, and substitute().
|
inline |
Returns a random string of length characters from [0-9a-zA-Z].
|
inline |
Referenced by NucleicAcidSearchEngine::registerOptionsAndFlags_().
|
inline |
References skipNonWhitespace().
|
inline |
|
inline |
| const char * skipNonWhitespace | ( | const char * | p, |
| const char * | p_end | ||
| ) |
Returns pointer to first whitespace character in [p, p_end), or p_end.
Referenced by removeWhitespaces(), and skipNonWhitespace().
|
inline |
Returns count of leading non-whitespace characters in data.
References skipNonWhitespace().
| const char * skipWhitespace | ( | const char * | p, |
| const char * | p_end | ||
| ) |
Returns pointer to first non-whitespace character in [p, p_end), or p_end.
Referenced by skipWhitespace().
|
inline |
Returns count of leading whitespace characters in data.
References skipWhitespace().
|
inline |
Split s on single character splitter into substrings. If quote_protect is true, splits only outside double-quoted blocks (quotes stripped). Returns true if at least one split occurred.
References trim().
Referenced by extractCachedMetaFilename(), and NucleicAcidSearchEngine::parseAdduct_().
|
inline |
Split s on multi-character splitter string. Returns true if at least one split occurred.
|
inline |
Split s on splitter, but do not split within quoted substrings. Returns true if at least one split occurred.
References OpenMS::ESCAPE, and OpenMS::NONE.
|
inline |
Referenced by quote(), substituted(), substituted(), and unquote().
|
inline |
Replace all occurrences of from with to in s.
|
inline |
substitute on a copy (for chained/rvalue expressions)
References substitute().
Referenced by TOPPASBase::~TOPPASBase().
|
inline |
References substitute().
|
inline |
Wrapper around std::string::substr; clamps pos to [0, size].
Referenced by OpenMS::Internal::getOSVersionString_().
|
inline |
string_view overload — implicit conversions from string_view to const string& don't work
|
inline |
Returns the part of s after the last occurrence of delim (excluding it).
If delim is not contained in s, the whole string is returned.
|
inline |
Referenced by DecoyHelper::countDecoys(), and suffix().
|
inline |
References StringUtilsHelper::toDouble().
Referenced by OpenMS::detail::convert().
|
inline |
References StringUtilsHelper::toFloat().
Referenced by OpenMS::detail::convert().
|
inline |
References StringUtilsHelper::toInt32().
Referenced by OpenMS::detail::convert().
|
inline |
References StringUtilsHelper::toInt64().
|
inline |
|
inline |
Returns a lower-cased copy of s (for use in chained/rvalue expressions)
References toLower().
|
inline |
|
inline |
| std::string toStr | ( | const DataValue & | d, |
| bool | full_precision = true |
||
| ) |
DataValue to string — the LENIENT stringification (non-inline; defined in StringUtils.cpp).
"Class B" gotcha of the OpenMS::String -> std::string migration (PR 9450): this is the drop-in replacement for the removed lenient String(const DataValue&) constructor. It calls DataValue::toString() and therefore NEVER throws: numbers become their decimal text, lists are joined, EMPTY becomes "", and a genuine STRING is returned verbatim (a true no-op).
Prefer this over the bare cast whenever you stringify a DataValue or a getMetaValue() result, because DataValue::operator std::string() is STRICT and throws Exception::ConversionError for non-string values:
| std::string toStr | ( | const ParamValue & | p, |
| bool | full_precision = true |
||
| ) |
ParamValue to string — lenient, like toStr(const DataValue&) (non-inline; defined in StringUtils.cpp)
|
inline |
|
inline |
Double to string; full_precision selects 15-digit (true) or 3-digit (false) output.
References appendToStr(), and appendToStrLowP().
|
inline |
Float to string; full_precision selects 6-digit (true) or 3-digit (false) output.
References appendToStr(), and appendToStrLowP().
|
inline |
References appendToStr().
Referenced by TOPPViewBase::addDataFile(), NuXLRTPrediction::buildPredictorsAndResponse_(), NuXLRTPrediction::buildPredictorsAndResponseFromIdentifiedFeatures_(), SignalToNoiseEstimatorMeanIterative< Container >::computeSTN_(), SignalToNoiseEstimatorMedian< Container >::computeSTN_(), ChromatogramTools::convertSpectraToChromatograms(), TOPPViewBase::getCanvasParameters(), CrossValidation::makeKFolds(), ObservationMatch::merge(), OpenMS::operator<<(), OpenMS::operator<<(), OpenMS::operator<<(), OpenMS::Math::percentOf(), OpenMS::Math::quantile(), RANSAC< TModelType >::ransac(), OpenMS::CometNativeIDRemapper::rewriteToIndex(), Gravitator::setGravityAxis(), TOPPViewBase::showCurrentPeaksAs3D(), TOPPViewBase::showCurrentPeaksAsDIA(), OpenMS::Internal::ClassTest::testEqual(), TOPPASBase::toolStarted(), OpenMS::StringConversions::toString(), OpenMS::StringConversions::toString(), OpenMS::StringConversions::toString(), OpenMS::StringConversions::toString(), OpenMS::StringConversions::toString(), OpenMS::StringConversions::toStringLowP(), OpenMS::StringConversions::toStringLowP(), and OpenMS::StringConversions::toStringLowP().
|
inline |
Long double to string; full_precision selects full-precision or 3-digit output.
References appendToStr(), and appendToStrLowP().
|
inline |
References appendToStr().
|
inline |
References appendToStr().
|
inline |
References appendToStr().
|
inline |
References appendToStr().
|
inline |
References appendToStr().
|
inline |
References appendToStr().
|
inline |
toStr overload for string_view (returns a copy as std::string)
|
inline |
References appendToStr().
|
inline |
Referenced by toUppered().
|
inline |
Returns an upper-cased copy of s (for use in chained/rvalue expressions)
References toUpper().
|
inline |
Referenced by TOPPASBase::createTOPPToolsTreeWidget(), split(), and trimmed().
|
inline |
Returns a trimmed copy of s (for use in chained/rvalue expressions)
References trim().
Referenced by ListUtils::create().
|
inline |
References OpenMS::DOUBLE, OpenMS::ESCAPE, isQuoted(), and substitute().