Lines Matching refs:s

31 std::vector<std::string> Split(const std::string& s,  in Split()  argument
40 found = s.find_first_of(delimiters, base); in Split()
41 result.push_back(s.substr(base, found - base)); in Split()
42 if (found == s.npos) break; in Split()
49 std::string Trim(const std::string& s) { in Trim() argument
52 if (s.size() == 0) { in Trim()
57 size_t end_index = s.size() - 1; in Trim()
60 while (start_index < s.size()) { in Trim()
61 if (!isspace(s[start_index])) { in Trim()
69 if (!isspace(s[end_index])) { in Trim()
80 return s.substr(start_index, end_index - start_index + 1); in Trim()
90 bool StartsWith(const std::string& s, const char* prefix) { in StartsWith() argument
91 return strncmp(s.c_str(), prefix, strlen(prefix)) == 0; in StartsWith()
94 bool StartsWithIgnoreCase(const std::string& s, const char* prefix) { in StartsWithIgnoreCase() argument
95 return strncasecmp(s.c_str(), prefix, strlen(prefix)) == 0; in StartsWithIgnoreCase()
98 static bool EndsWith(const std::string& s, const char* suffix, bool case_sensitive) { in EndsWith() argument
100 size_t string_length = s.size(); in EndsWith()
105 return (case_sensitive ? strncmp : strncasecmp)(s.c_str() + offset, suffix, suffix_length) == 0; in EndsWith()
108 bool EndsWith(const std::string& s, const char* suffix) { in EndsWith() argument
109 return EndsWith(s, suffix, true); in EndsWith()
112 bool EndsWithIgnoreCase(const std::string& s, const char* suffix) { in EndsWithIgnoreCase() argument
113 return EndsWith(s, suffix, false); in EndsWithIgnoreCase()