OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_HTTP_HTTP_UTIL_H_ | 5 #ifndef NET_HTTP_HTTP_UTIL_H_ |
6 #define NET_HTTP_HTTP_UTIL_H_ | 6 #define NET_HTTP_HTTP_UTIL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/string_tokenizer.h" | 10 #include "base/string_tokenizer.h" |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 bool GetNext(); | 160 bool GetNext(); |
161 | 161 |
162 // Iterates through the list of headers, starting with the current position | 162 // Iterates through the list of headers, starting with the current position |
163 // and looks for the specified header. Note that the name _must_ be | 163 // and looks for the specified header. Note that the name _must_ be |
164 // lower cased. | 164 // lower cased. |
165 // If the header was found, the return value will be true and the current | 165 // If the header was found, the return value will be true and the current |
166 // position points to the header. If the return value is false, the | 166 // position points to the header. If the return value is false, the |
167 // current position will be at the end of the headers. | 167 // current position will be at the end of the headers. |
168 bool AdvanceTo(const char* lowercase_name); | 168 bool AdvanceTo(const char* lowercase_name); |
169 | 169 |
| 170 void Reset() { |
| 171 lines_.Reset(); |
| 172 } |
| 173 |
170 std::string::const_iterator name_begin() const { | 174 std::string::const_iterator name_begin() const { |
171 return name_begin_; | 175 return name_begin_; |
172 } | 176 } |
173 std::string::const_iterator name_end() const { | 177 std::string::const_iterator name_end() const { |
174 return name_end_; | 178 return name_end_; |
175 } | 179 } |
176 std::string name() const { | 180 std::string name() const { |
177 return std::string(name_begin_, name_end_); | 181 return std::string(name_begin_, name_end_); |
178 } | 182 } |
179 | 183 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 private: | 233 private: |
230 StringTokenizer values_; | 234 StringTokenizer values_; |
231 std::string::const_iterator value_begin_; | 235 std::string::const_iterator value_begin_; |
232 std::string::const_iterator value_end_; | 236 std::string::const_iterator value_end_; |
233 }; | 237 }; |
234 }; | 238 }; |
235 | 239 |
236 } // namespace net | 240 } // namespace net |
237 | 241 |
238 #endif // NET_HTTP_HTTP_UTIL_H_ | 242 #endif // NET_HTTP_HTTP_UTIL_H_ |
OLD | NEW |