Lines Matching refs:s
31 std::string_view Trim(std::string_view s) { in Trim() argument
32 std::string::size_type start = s.find_first_not_of(" \t\r\n"); in Trim()
36 std::string::size_type end = s.find_last_not_of(" \t\r\n"); in Trim()
38 return s.substr(start); in Trim()
40 return s.substr(start, end - start + 1); in Trim()
44 bool StartsWith(std::string_view s, std::string_view prefix) { in StartsWith() argument
45 return s.size() >= prefix.size() && s.compare(0, prefix.size(), prefix) == 0; in StartsWith()
49 bool EndsWith(std::string_view s, std::string_view suffix) { in EndsWith() argument
50 return (s.size() >= suffix.size() && in EndsWith()
51 s.compare(s.size() - suffix.size(), suffix.size(), suffix) == 0); in EndsWith()
55 std::vector<std::string_view> Split(std::string_view s, in Split() argument
60 pos = s.find_first_not_of(delim_chars, pos); in Split()
65 std::string::size_type end = s.find_first_of(delim_chars, pos + 1); in Split()
67 res.push_back(s.substr(pos)); in Split()
71 res.push_back(s.substr(pos, end - pos)); in Split()
78 std::optional<int> ParseInt(const std::string &s) { in ParseInt() argument
79 const char *start = s.c_str(); in ParseInt()
94 bool ParseBool(const std::string &s) { in ParseBool() argument
95 std::string value(s); in ParseBool()
103 bool IsGlobPattern(std::string_view s) { in IsGlobPattern() argument
104 return s.find_first_of("*?[") != std::string::npos; in IsGlobPattern()