Lines Matching defs:str
109 static size_t StringToken(std::string &str, const std::string &sep, std::string &token)
112 if (str.empty()) {
113 return str.npos;
115 size_t pos = str.npos;
118 tmp = str.find(item);
119 if (str.npos != tmp) {
123 if (str.npos != pos) {
124 token = str.substr(0, pos);
125 if (str.npos != pos + 1) {
126 str = str.substr(pos + 1, str.npos);
129 return StringToken(str, sep, token);
132 token = str;
133 str = "";
138 size_t StringSplit(const std::string &str, const std::string &sep, std::vector<std::string> &vecList)
141 auto strs = str;
143 while (str.npos != (size = StringToken(strs, sep, token))) {
151 std::string str;
153 str += std::to_string(it) + sep;
155 if (str.size() > 0) {
156 str.resize(str.size() - sep.size());
158 return str;
323 static inline bool IsNum(const std::string &str)
325 std::istringstream sin(str);
625 if (!oss.str().empty()) {
630 if (!oss.str().empty()) {
631 MMI_HILOG_HEADER(LOG_INFO, lh, "%{public}s", oss.str().c_str());