Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions cpp_utils/include/cpp_utils/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ CPP_UTILS_DllAPI bool match_pattern(
CPP_UTILS_DllAPI void to_lowercase(
std::string& st) noexcept;

/**
* @brief Convert every alphabetic char in string to upper case
*
* @attention This function modifies the object given
*
* @param [in,out] st : string to modify
*/
CPP_UTILS_DllAPI void to_uppercase(
std::string& st) noexcept;

template <typename T, bool Ptr = false>
std::ostream& element_to_stream(
std::ostream& os,
Expand Down
10 changes: 10 additions & 0 deletions cpp_utils/src/cpp/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,16 @@ void to_lowercase(
});
}

void to_uppercase(
std::string& st) noexcept
{
std::transform(st.begin(), st.end(), st.begin(),
[](unsigned char c)
{
return std::toupper(c);
});
}

void tsnh(
const Formatter& formatter)
{
Expand Down