Added toUpperCase and toLowerCase transformations of string
authorDmitry Morozov <aracsmd@gmail.com>
Thu, 26 Aug 2021 09:31:41 +0000 (12:31 +0300)
committerDmitry Morozov <aracsmd@gmail.com>
Thu, 26 Aug 2021 17:02:48 +0000 (17:02 +0000)
src/gromacs/onlinehelp/helpwritercontext.cpp
src/gromacs/utility/stringutil.cpp
src/gromacs/utility/stringutil.h

index 7c1e54f5f3cf1ca6b07fb64fe0c71a528023cba7..9573b4ee5b6fc911b855c3377b27def468564046 100644 (file)
@@ -206,19 +206,6 @@ private:
     std::vector<std::string> result_;
 };
 
-/*! \brief
- * Makes the string uppercase.
- *
- * \param[in] text  Input text.
- * \returns   \p text with all characters transformed to uppercase.
- * \throws    std::bad_alloc if out of memory.
- */
-std::string toUpperCase(const std::string& text)
-{
-    std::string result(text);
-    std::transform(result.begin(), result.end(), result.begin(), toupper);
-    return result;
-}
 
 /*! \brief
  * Removes extra newlines from reStructuredText.
index 779fa9ad7fd2e497f2dc33df4327914aba5c5790..4b93cc2d59104c5da33f78ed3777191db7902044 100644 (file)
@@ -333,6 +333,20 @@ bool equalCaseInsensitive(const std::string& source, const std::string& target,
     });
 }
 
+std::string toUpperCase(const std::string& text)
+{
+    std::string result(text);
+    std::transform(result.begin(), result.end(), result.begin(), toupper);
+    return result;
+}
+
+std::string toLowerCase(const std::string& text)
+{
+    std::string result(text);
+    std::transform(result.begin(), result.end(), result.begin(), tolower);
+    return result;
+}
+
 /********************************************************************
  * TextLineWrapperSettings
  */
index a1da4501d8058ffc6a772dcaf3dc6209a94c717f..4249b004d728d8b4c7b9f04085f72b737e66e571 100644 (file)
@@ -450,6 +450,25 @@ bool equalCaseInsensitive(const std::string& source, const std::string& target);
  */
 bool equalCaseInsensitive(const std::string& source, const std::string& target, size_t maxLengthOfComparison);
 
+/*! \brief
+ * Makes the string uppercase.
+ *
+ * \param[in] text  Input text.
+ * \returns   \p text with all characters transformed to uppercase.
+ * \throws    std::bad_alloc if out of memory.
+ */
+std::string toUpperCase(const std::string& text);
+
+/*! \brief
+ * Makes the string lowercase.
+ *
+ * \param[in] text  Input text.
+ * \returns   \p text with all characters transformed to lowercase.
+ * \throws    std::bad_alloc if out of memory.
+ */
+std::string toLowerCase(const std::string& text);
+
+
 class TextLineWrapper;
 
 /*! \brief