31 return std::strlen(
str);
36 return std::wcslen(
str);
39template<
typename CharType,
size_t N>
45template<
typename StringType>
51template<
template<
typename,
typename...>
typename ContainerType,
typename ResultType,
typename SeparatorType,
typename...
Rest>
53 const ContainerType<ResultType, Rest...>& container,
54 const SeparatorType& separator)
56 if (container.empty())
60 const auto totalSeparatorLength = sepratorLength * (container.size() - 1);
64 const auto size = std::accumulate(
65 container.begin(), container.end(), totalSeparatorLength,
66 [](
size_t size,
const ResultType& item)
67 { return size + StringLength(item); });
72 for (
const auto& item : container)
83STRING_UTILS_API std::string
ToLower(
const std::string&
str);
84STRING_UTILS_API std::string
ToLower(
const std::string_view&
str);
85STRING_UTILS_API std::string
ToLower(
const char*
str);
86STRING_UTILS_API std::wstring
ToLower(
const std::wstring&
str);
87STRING_UTILS_API std::wstring
ToLower(
const std::wstring_view&
str);
88STRING_UTILS_API std::wstring
ToLower(
const wchar_t*
str);
89STRING_UTILS_API wxString
ToLower(
const wxString&
str);
91STRING_UTILS_API std::string
ToUpper(
const std::string&
str);
92STRING_UTILS_API std::string
ToUpper(
const std::string_view&
str);
93STRING_UTILS_API std::string
ToUpper(
const char*
str);
94STRING_UTILS_API std::wstring
ToUpper(
const std::wstring&
str);
95STRING_UTILS_API std::wstring
ToUpper(
const std::wstring_view&
str);
96STRING_UTILS_API std::wstring
ToUpper(
const wchar_t*
str);
97STRING_UTILS_API wxString
ToUpper(
const wxString&
str);
106inline const char*
end(
const char*
str)
noexcept
114inline const wchar_t*
begin(
const wchar_t*
str)
noexcept
119inline const wchar_t*
end(
const wchar_t*
str)
noexcept
128template<
typename HayType,
typename PrefixType>
130 const HayType& hay,
const PrefixType& prefix)
138 const auto prefixBegin =
begin(prefix);
139 const auto prefixEnd =
end(prefix);
140 const auto hayBegin =
begin(hay);
142 return std::mismatch(prefixBegin, prefixEnd, hayBegin).first == prefixEnd;
145template <
typename HayType,
typename PrefixType>
bool IsPrefixedInsensitive(const HayType &hay, const PrefixType &prefix)
STRING_UTILS_API std::string ToLower(const std::string &str)
bool IsPrefixed(const HayType &hay, const PrefixType &prefix)
STRING_UTILS_API std::string ToUpper(const std::string &str)
ResultType Join(const ContainerType< ResultType, Rest... > &container, const SeparatorType &separator)
std::size_t StringLength(const char str)
Tail< TypeList > Rest
Synonym for Tail.
const wchar_t * end(const wchar_t *str) noexcept
const wchar_t * begin(const wchar_t *str) noexcept
const char * end(const char *str) noexcept
const char * begin(const char *str) noexcept