Lines Matching refs:str
148 escape_quotes(const char* str) in escape_quotes() argument
151 while (*str) { in escape_quotes()
152 if (*str == '"') { in escape_quotes()
156 result += *str; in escape_quotes()
163 escape_for_commandline(const char* str) in escape_for_commandline() argument
165 if (strchr(str, '"') != NULL || strchr(str, ' ') != NULL in escape_for_commandline()
166 || strchr(str, '\t') != NULL) { in escape_for_commandline()
167 return escape_quotes(str); in escape_for_commandline()
169 return str; in escape_for_commandline()
180 trim(const string& str) in trim() argument
182 const ssize_t N = (ssize_t)str.size(); in trim()
184 while (begin < N && spacechr(str[begin])) { in trim()
188 while (end >= begin && spacechr(str[end])) { in trim()
191 return string(str, begin, end-begin+1); in trim()
195 starts_with(const string& str, const string& prefix) in starts_with() argument
197 return str.compare(0, prefix.length(), prefix) == 0; in starts_with()
201 ends_with(const string& str, const string& suffix) in ends_with() argument
203 if (str.length() < suffix.length()) { in ends_with()
206 return str.compare(str.length()-suffix.length(), suffix.length(), suffix) == 0; in ends_with()
211 split_lines(vector<string>* result, const string& str) in split_lines() argument
213 const int N = str.length(); in split_lines()
217 const char c = str[end]; in split_lines()
220 result->push_back(string(str, begin, end-begin)); in split_lines()
226 result->push_back(string(str, begin, end-begin)); in split_lines()