commit 28a88dbd65dc4ee501e037c229cbd69401d18722 parent d64c1acc695f024b61fb3964f40bbc9d22454308 Author: falkTX <falktx@falktx.com> Date: Sat, 18 Sep 2021 09:42:01 +0100 String: Add asBasic, asLower and asUpper methods Signed-off-by: falkTX <falktx@falktx.com> Diffstat:
M | distrho/extra/String.hpp | | | 30 | ++++++++++++++++++++++++++++++ |
1 file changed, 30 insertions(+), 0 deletions(-)
diff --git a/distrho/extra/String.hpp b/distrho/extra/String.hpp @@ -619,6 +619,36 @@ public: } /* + * Create a new string where all non-basic characters are converted to '_'. + * @see toBasic() + */ + String asBasic() const noexcept + { + String s(*this); + return s.toBasic(); + } + + /* + * Create a new string where all ascii characters are converted lowercase. + * @see toLower() + */ + String asLower() const noexcept + { + String s(*this); + return s.toLower(); + } + + /* + * Create a new string where all ascii characters are converted to uppercase. + * @see toUpper() + */ + String asUpper() const noexcept + { + String s(*this); + return s.toUpper(); + } + + /* * Direct access to the string buffer (read-only). */ const char* buffer() const noexcept