Lines Matching refs:std
39 using TokenList = std::vector<std::string>;
78 : token_list_(new TokenList(std::forward<TokenList>(token_list))), in TokenRange()
84 TokenRange(std::shared_ptr<TokenList> token_list, in TokenRange()
101 explicit TokenRange(std::shared_ptr<TokenList> token_list) in TokenRange()
116 static TokenRange Split(const std::string& string, std::initializer_list<char> separators) { in Split()
119 std::string tok; in Split()
130 new_token_list.push_back(std::string() + sep); in Split()
142 return TokenRange(std::move(new_token_list)); in Split()
157 return std::distance(begin_, end_); in Size()
166 const std::string& GetToken(size_t offset) const { in GetToken()
183 return std::equal(begin(), end(), other.begin());
187 const std::string& operator[](int index) const {
205 return std::equal(smaller.begin(), smaller.end(), greater.begin()); in StartsWith()
214 auto it = std::remove_if(token.begin(), token.end(), [&](char ch) { in RemoveCharacter()
228 return TokenRange(std::move(new_token_list)); in RemoveCharacter()
232 TokenRange RemoveToken(const std::string& token) { in RemoveToken()
233 return RemoveIf([&](const std::string& tok) { return tok == token; }); in RemoveToken()
238 return RemoveIf([](const std::string& token) { return token.empty(); }); in DiscardEmpty()
243 TokenRange Slice(size_t offset, size_t length = std::string::npos) const {
246 if (length != std::string::npos && offset + length > Size()) {
251 if (length == std::string::npos) {
271 std::unique_ptr<TokenRange> MatchSubstrings(const std::string& string, in MatchSubstrings()
272 const std::string& wildcard) const { in MatchSubstrings()
275 size_t wildcard_idx = std::string::npos; in MatchSubstrings()
282 if (wildcard_idx != std::string::npos) { in MatchSubstrings()
284 std::string wildcard_substr = string.substr(wildcard_idx, wildcard_length); in MatchSubstrings()
285 new_token_list.push_back(std::move(wildcard_substr)); in MatchSubstrings()
287 wildcard_idx = std::string::npos; in MatchSubstrings()
292 const std::string& tok = *it; in MatchSubstrings()
301 if (next_token_idx == std::string::npos) { in MatchSubstrings()
304 } else if (next_token_idx != string_idx && wildcard_idx == std::string::npos) { in MatchSubstrings()
317 if (wildcard_idx == std::string::npos) { in MatchSubstrings()
328 return std::unique_ptr<TokenRange>(new TokenRange(std::move(new_token_list))); in MatchSubstrings()
339 size_t MaybeMatches(const TokenRange& token_list, const std::string& wildcard) const { in MaybeMatches()
349 const std::string& name = *name_it; in MaybeMatches()
352 if (wildcard_idx == std::string::npos) { // No wildcard present in MaybeMatches()
358 std::string name_prefix = name.substr(0, wildcard_idx); in MaybeMatches()
377 std::string Join(char separator) const { in Join()
384 static bool StartsWith(const std::string& larger, const std::string& smaller) { in StartsWith()
386 return std::equal(smaller.begin(), smaller.end(), larger.begin()); in StartsWith()
408 auto token_list = std::make_shared<TokenList>(begin(), end()); in RemoveIf()
410 std::remove_if(token_list->begin(), token_list->end(), predicate); in RemoveIf()
421 const std::shared_ptr<std::vector<std::string>> token_list_;