| |
| |
| |
| |
| |
| |
| |
| |
| |
| #pragma once |
|
|
| #include <string> |
| #include <vector> |
| #include <sstream> |
| #include <iostream> |
| #include <codecvt> |
| #include <locale> |
| #include <cassert> |
|
|
| namespace utils { |
|
|
| std::vector<std::string> split_utf8(const std::string& utf8_text); |
|
|
| |
| std::vector<std::string> str2list(const std::string& text, char delimiter='\n'); |
|
|
| void replace_inplace(std::string& str, const std::string& from, const std::string& to); |
|
|
| std::string strip(const std::string& s); |
|
|
| |
| |
| void u8tou16(const char* src, size_t len, std::u16string& dst); |
|
|
| void u16tou8(const char16_t* src, size_t len, std::string& dst); |
|
|
| void SplitString(const std::string& str, char delimiter, std::vector<std::string>* result); |
|
|
| void SplitString(const char* str, size_t len, char delimiter, std::vector<std::string>* result); |
|
|
| std::string DigitToChinese(char c); |
|
|
| |
| |
| |
| |
| std::string NumberToChinese(const std::string& num_str); |
|
|
| bool is_chinese(const std::string& str); |
|
|
| std::string trim(const std::string& str); |
|
|
| std::string replace_all(std::string str, const std::string& from, const std::string& to); |
|
|
| std::string join(const std::vector<std::string>& vec, const std::string& delim); |
|
|
| } |