Home | History | Annotate | Download | only in base

Lines Matching defs:hosts

32 static void StripWWWPrefix(std::vector<std::string>* hosts) {
36 for (size_t i = 0; i < hosts->size(); i++) {
37 const std::string& h = (*hosts)[i];
40 (*hosts)[i] = h.substr(kPrefixLen, h.size() - kPrefixLen);
45 // RemoveDuplicateEntries removes all duplicates from |hosts|.
46 static void RemoveDuplicateEntries(std::vector<std::string>* hosts) {
51 i = hosts->begin(); i != hosts->end(); i++) {
61 hosts->swap(ret);
79 static void RemoveRedundantEntries(std::vector<std::string>* hosts) {
84 i = hosts->begin(); i != hosts->end(); i++) {
89 i = hosts->begin(); i != hosts->end(); i++) {
104 hosts->swap(ret);
109 static bool CheckLengths(const std::vector<std::string>& hosts) {
111 i = hosts.begin(); i != hosts.end(); i++) {
163 std::vector<std::string> hosts;
174 hosts.push_back(std::string(&buffer[line_start], len));
189 fprintf(stderr, "Have %d hosts after parse\n", (int) hosts.size());
190 StripWWWPrefix(&hosts);
191 RemoveDuplicateEntries(&hosts);
192 fprintf(stderr, "Have %d hosts after removing duplicates\n", (int) hosts.size());
193 RemoveRedundantEntries(&hosts);
194 fprintf(stderr, "Have %d hosts after removing redundants\n", (int) hosts.size());
195 if (!CheckLengths(hosts)) {
205 i = hosts.begin(); i != hosts.end(); i++) {