Lines Matching refs:std

37   using TokenList = std::vector<std::string>;
76 : token_list_(new TokenList(std::forward<TokenList>(token_list))), in TokenRange()
82 TokenRange(std::shared_ptr<TokenList> token_list, in TokenRange()
99 explicit TokenRange(std::shared_ptr<TokenList> token_list) in TokenRange()
114 static TokenRange Split(const std::string& string, std::initializer_list<char> separators) { in Split()
117 std::string tok; in Split()
128 new_token_list.push_back(std::string() + sep); in Split()
140 return TokenRange(std::move(new_token_list)); in Split()
155 return std::distance(begin_, end_); in Size()
164 const std::string& GetToken(size_t offset) const { in GetToken()
181 return std::equal(begin(), end(), other.begin());
185 const std::string& operator[](int index) const {
203 return std::equal(smaller.begin(), smaller.end(), greater.begin()); in StartsWith()
212 auto it = std::remove_if(token.begin(), token.end(), [&](char ch) { in RemoveCharacter()
226 return TokenRange(std::move(new_token_list)); in RemoveCharacter()
230 TokenRange RemoveToken(const std::string& token) { in RemoveToken()
231 return RemoveIf([&](const std::string& tok) { return tok == token; }); in RemoveToken()
236 return RemoveIf([](const std::string& token) { return token.empty(); }); in DiscardEmpty()
241 TokenRange Slice(size_t offset, size_t length = std::string::npos) const {
244 if (length != std::string::npos && offset + length > Size()) {
249 if (length == std::string::npos) {
269 std::unique_ptr<TokenRange> MatchSubstrings(const std::string& string, in MatchSubstrings()
270 const std::string& wildcard) const { in MatchSubstrings()
273 size_t wildcard_idx = std::string::npos; in MatchSubstrings()
280 if (wildcard_idx != std::string::npos) { in MatchSubstrings()
282 std::string wildcard_substr = string.substr(wildcard_idx, wildcard_length); in MatchSubstrings()
283 new_token_list.push_back(std::move(wildcard_substr)); in MatchSubstrings()
285 wildcard_idx = std::string::npos; in MatchSubstrings()
290 const std::string& tok = *it; in MatchSubstrings()
299 if (next_token_idx == std::string::npos) { in MatchSubstrings()
302 } else if (next_token_idx != string_idx && wildcard_idx == std::string::npos) { in MatchSubstrings()
315 if (wildcard_idx == std::string::npos) { in MatchSubstrings()
326 return std::unique_ptr<TokenRange>(new TokenRange(std::move(new_token_list))); in MatchSubstrings()
337 size_t MaybeMatches(const TokenRange& token_list, const std::string& wildcard) const { in MaybeMatches()
347 const std::string& name = *name_it; in MaybeMatches()
350 if (wildcard_idx == std::string::npos) { // No wildcard present in MaybeMatches()
356 std::string name_prefix = name.substr(0, wildcard_idx); in MaybeMatches()
375 std::string Join(char separator) const { in Join()
382 static bool StartsWith(const std::string& larger, const std::string& smaller) { in StartsWith()
384 return std::equal(smaller.begin(), smaller.end(), larger.begin()); in StartsWith()
406 auto token_list = std::make_shared<TokenList>(begin(), end()); in RemoveIf()
408 std::remove_if(token_list->begin(), token_list->end(), predicate); in RemoveIf()
419 const std::shared_ptr<std::vector<std::string>> token_list_;