![]() |
OpenMS
|
Concepts | |
| concept | Streamable |
Functions | |
| void | trim (std::string &s) |
| Remove leading and trailing whitespace (' ', '\t', '\n', '\r'), like StringUtils::trim. | |
| std::vector< std::string > | split (const std::string &s, char splitter) |
| std::string | join (const std::vector< std::string > &v, const char *sep) |
| Join with a separator (display purposes only). | |
| template<typename T > | |
| void | appendNumeric (T value, std::string &target, int precision, bool fixed_format) |
Stringification for TEST_EQUAL(std::string, x). Mirrors the | |
StringUtils::toStr overloads, so TEST_EQUAL(some_string, 114) compares against "114" and doubles keep full precision. | |
| std::string | toString (const std::string &s) |
| std::string | toString (std::string_view sv) |
| std::string | toString (const char *s) |
| std::string | toString (char c) |
| template<typename T > | |
| std::string | toString (const T &v) |
| template<typename T > | |
| void | printValue (std::ostream &os, const T &v) |
| std::filesystem::path | to_path (const std::string &s) |
|
inline |
Append a double/float/long double via std::to_chars. VERBATIM copy of appendNumeric in StringUtils.cpp – must format exactly like StringUtils::toStr(); keep in sync, do not "improve". NaN -> "NaN", inf -> "inf"/"-inf"; trailing zeros trimmed, one digit kept after '.'.
Referenced by toString().
|
inline |
Join with a separator (display purposes only).
| void printValue | ( | std::ostream & | os, |
| const T & | v | ||
| ) |
Print a value in a TEST_EQUAL/TEST_NOT_EQUAL failure report: directly if streamable; ranges as "[e1, e2, ...]" (like ListUtilsIO.h); else a placeholder.
References OpenMS::C, first, and toString().
Referenced by OpenMS::Internal::ClassTest::testEqual(), and OpenMS::Internal::ClassTest::testNotEqual().
|
inline |
Split on a single character. Mirrors ListUtils::create<std::string>(s, splitter): an empty input gives an empty result; otherwise empty fields are kept and fields are NOT trimmed.
|
inline |
UTF-8 std::string -> std::filesystem::path. Copy of OpenMS::to_path (OpenMS/SYSTEM/PathUtils.h): on Windows construct from u8string (not the current code page), falling back to the native page for non-UTF-8 bytes.
|
inline |
|
inline |
|
inline |
|
inline |
References appendNumeric().
|
inline |
|
inline |
Remove leading and trailing whitespace (' ', '\t', '\n', '\r'), like StringUtils::trim.