diff options
Diffstat (limited to 'libartbase/base/utils.h')
-rw-r--r-- | libartbase/base/utils.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libartbase/base/utils.h b/libartbase/base/utils.h index 66a5699519..7160302daa 100644 --- a/libartbase/base/utils.h +++ b/libartbase/base/utils.h @@ -44,7 +44,16 @@ std::string PrettySize(uint64_t size_in_bytes); // Splits a string using the given separator character into a vector of // strings. Empty strings will be omitted. -void Split(const std::string& s, char separator, std::vector<std::string>* result); +template<typename StrIn, typename Str> +void Split(const StrIn& s, char separator, std::vector<Str>* out_result); + +template<typename Str> +void Split(const Str& s, char separator, size_t len, Str* out_result); + +template<typename StrIn, typename Str, size_t kLen> +void Split(const StrIn& s, char separator, std::array<Str, kLen>* out_result) { + Split<Str>(Str(s), separator, kLen, &((*out_result)[0])); +} // Returns the calling thread's tid. (The C libraries don't expose this.) uint32_t GetTid(); |