From 68f4c7ce8ee7b9580a8a32754d145b85d815ee31 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 27 Jan 2023 15:05:08 -0700 Subject: [PATCH] add upcase() method; remove upcase version of internationalize() --- libs/pbd/convert.cc | 27 +++++++++++++-------------- libs/pbd/pbd/convert.h | 2 +- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/libs/pbd/convert.cc b/libs/pbd/convert.cc index 727c41ad4f..23c54731a0 100644 --- a/libs/pbd/convert.cc +++ b/libs/pbd/convert.cc @@ -74,6 +74,19 @@ downcase (const char* str) return copy; } +vector +upcase (char const *array[]) +{ + vector ret; + for (int n = 0; array[n]; ++n) { + string s (array[n]); + std::transform (s.begin(), s.end(), s.begin(), ::toupper); + ret.push_back (s); + } + + return ret; +} + string short_version (string orig, string::size_type target_length) { @@ -174,20 +187,6 @@ internationalize (const char *package_name, const char **array) return v; } -vector -internationalize_and_upcase (const char *package_name, const char **array) -{ - vector v; - - for (uint32_t i = 0; array[i]; ++i) { - string s (dgettext(package_name, array[i])); - std::transform (s.begin(), s.end(), s.begin(), ::toupper); - v.push_back (s); - } - - return v; -} - static int32_t int_from_hex (char hic, char loc) { diff --git a/libs/pbd/pbd/convert.h b/libs/pbd/pbd/convert.h index beb1d83db7..aa85a10b72 100644 --- a/libs/pbd/pbd/convert.h +++ b/libs/pbd/pbd/convert.h @@ -43,12 +43,12 @@ LIBPBD_API std::string url_decode (std::string const &); LIBPBD_API std::string capitalize (const std::string&); LIBPBD_API std::string downcase (const std::string&); LIBPBD_API const char* downcase (const char*); +LIBPBD_API std::vector upcase (char const *[]); // std::string length2string (const int32_t samples, const float sample_rate); LIBPBD_API std::string length2string (const int64_t samples, const double sample_rate); LIBPBD_API std::vector internationalize (const char *, const char **); -LIBPBD_API std::vector internationalize_and_upcase (const char *, const char **); LIBPBD_API bool strings_equal_ignore_case (const std::string& a, const std::string& b); LIBPBD_API const char* sgettext (const char *, const char *);