This commit is contained in:
9
support/3rd_party/include/utils/string.hpp
vendored
9
support/3rd_party/include/utils/string.hpp
vendored
@@ -162,6 +162,9 @@ template <typename string_t>
|
||||
|
||||
[[nodiscard]] auto to_utf8(std::wstring_view str) -> std::string;
|
||||
|
||||
template <typename string_t>
|
||||
[[nodiscard]] inline auto zero_pad(string_t str, std::size_t count) -> string_t;
|
||||
|
||||
template <typename string_t> struct chain_replace_with_hex final {
|
||||
explicit chain_replace_with_hex(string_t &value) : str(value) {}
|
||||
|
||||
@@ -455,6 +458,12 @@ inline auto split(std::wstring_view str, std::wstring_view delim,
|
||||
bool should_trim) -> std::vector<std::wstring> {
|
||||
return split_t<std::wstring>(str, delim, should_trim);
|
||||
}
|
||||
|
||||
template <typename string_t>
|
||||
inline auto zero_pad(string_t str, std::size_t count) -> string_t {
|
||||
str.insert(str.begin(), count - str.length(), '0');
|
||||
return str;
|
||||
}
|
||||
} // namespace repertory::utils::string
|
||||
|
||||
#endif // REPERTORY_INCLUDE_UTILS_STRING_HPP_
|
||||
|
Reference in New Issue
Block a user