File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -185,6 +185,32 @@ class CppStringT : public std::basic_string<CharT>
185185 }
186186
187187
188+ // --- upper () -----------------------------------------
189+ /* * \brief In-place replaces all characters of the string with their uppercase conversion. Returns a reference to string.
190+ *
191+ * Notice: uses the currently set std::locale, which is the "C" one
192+ * by default or any other one as previously set by the user.
193+ */
194+ inline CppStringT& upper () noexcept
195+ {
196+ std::transform (this ->begin (), this ->end (),
197+ this ->begin (),
198+ [](value_type ch) { return this ->upper (ch); });
199+ return *this ;
200+ }
201+
202+ /* * \brief Returns uppercase conversion of the character.
203+ *
204+ * Notice: uses the currently set std::locale, which is the "C" one
205+ * by default or any other one as previously set by the user.
206+ */
207+ static inline const value_type upper (const value_type ch) noexcept
208+ {
209+ return value_type (std::toupper (ch));
210+ }
211+
212+
213+
188214protected:
189215
190216
You can’t perform that action at this time.
0 commit comments