mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-19 18:47:55 +08:00
@@ -74,7 +74,7 @@ namespace asst::utils
|
||||
#endif
|
||||
|
||||
template <typename StringT>
|
||||
[[nodiscard]] inline constexpr StringT string_replace_all(StringT&& src, detail::sv_type<StringT> from,
|
||||
[[nodiscard]] inline constexpr auto string_replace_all(StringT&& src, detail::sv_type<StringT> from,
|
||||
detail::sv_type<StringT> to)
|
||||
{
|
||||
std::basic_string result { std::forward<StringT>(src) };
|
||||
@@ -83,8 +83,7 @@ namespace asst::utils
|
||||
}
|
||||
|
||||
template <typename StringT>
|
||||
[[nodiscard]] inline constexpr StringT string_replace_all(StringT&& src,
|
||||
const detail::sv_pair<StringT>& replace_pair)
|
||||
[[nodiscard]] inline constexpr auto string_replace_all(StringT&& src, const detail::sv_pair<StringT>& replace_pair)
|
||||
{
|
||||
std::basic_string result { std::forward<StringT>(src) };
|
||||
string_replace_all_in_place(result, replace_pair);
|
||||
@@ -92,7 +91,7 @@ namespace asst::utils
|
||||
}
|
||||
|
||||
template <typename StringT>
|
||||
[[nodiscard]] inline constexpr StringT string_replace_all(
|
||||
[[nodiscard]] inline constexpr auto string_replace_all(
|
||||
StringT&& src, std::initializer_list<detail::sv_pair<StringT>> replace_pairs)
|
||||
{
|
||||
std::basic_string result { std::forward<StringT>(src) };
|
||||
@@ -103,7 +102,7 @@ namespace asst::utils
|
||||
}
|
||||
|
||||
template <typename StringT, typename MapT>
|
||||
[[deprecated]] [[nodiscard]] inline constexpr StringT string_replace_all(StringT&& src, MapT&& replace_pairs)
|
||||
[[deprecated]] [[nodiscard]] inline constexpr auto string_replace_all(StringT&& src, MapT&& replace_pairs)
|
||||
{
|
||||
std::basic_string result { std::forward<StringT>(src) };
|
||||
for (auto&& [from, to] : replace_pairs) {
|
||||
|
||||
Reference in New Issue
Block a user