Lines Matching refs:str
81 size_t AddString(uint16_t prefix, const std::string& str) { in AddString() argument
85 EncodeUnsignedLeb128(&chars_, str.length()); in AddString()
86 const uint8_t* ptr = reinterpret_cast<const uint8_t*>(&str[0]); in AddString()
87 chars_.insert(chars_.end(), ptr, ptr + str.length()); in AddString()
153 size_t AddString(const std::string& str) { in AddString() argument
155 EncodeUnsignedLeb128(&chars_, str.length()); in AddString()
156 const uint8_t* ptr = reinterpret_cast<const uint8_t*>(&str[0]); in AddString()
157 chars_.insert(chars_.end(), ptr, ptr + str.length()); in AddString()
187 MatchTrie* Add(const std::string& str) { in Add() argument
190 for (uint8_t c : str) { in Add()
208 MatchTrie* LongestPrefix(const std::string& str) { in LongestPrefix() argument
210 for (uint8_t c : str) { in LongestPrefix()
367 for (const std::string& str : prefixes) { in Build() local
369 MatchTrie* node = prefixe_trie->LongestPrefix(str); in Build()
370 if (node != nullptr && node->depth_ == str.length() && node->value_ != 0u) { in Build()
371 CHECK_EQ(node->GetString(), str); in Build()
375 prefixe_trie->Add(str)->value_ = prefix_idx; in Build()
388 for (size_t i = 0; i < std::min(str.length(), kNumSubstrings); ++i) { in Build()
389 add_str(str.substr(i)); in Build()
392 reinterpret_cast<const uint8_t*>(&str[0]), in Build()
393 str.length()); in Build()
396 CHECK_EQ(output_->dictionary_.AddOffset(prefix_offset, str.length()), prefix_idx); in Build()
402 for (const std::string& str : strings) { in Build() local
403 MatchTrie* node = prefixe_trie->LongestPrefix(str); in Build()
418 output_->AddString(prefix_idx, str.substr(best_length)); in Build()