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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 // token or quoted-string (the value). Arbitrary HTTP LWS is permitted outside | 276 // token or quoted-string (the value). Arbitrary HTTP LWS is permitted outside |
277 // of and between names, values, and delimiters. | 277 // of and between names, values, and delimiters. |
278 // | 278 // |
279 // String iterators returned from this class' methods may be invalidated upon | 279 // String iterators returned from this class' methods may be invalidated upon |
280 // calls to GetNext() or after the NameValuePairsIterator is destroyed. | 280 // calls to GetNext() or after the NameValuePairsIterator is destroyed. |
281 class NameValuePairsIterator { | 281 class NameValuePairsIterator { |
282 public: | 282 public: |
283 NameValuePairsIterator(std::string::const_iterator begin, | 283 NameValuePairsIterator(std::string::const_iterator begin, |
284 std::string::const_iterator end, | 284 std::string::const_iterator end, |
285 char delimiter); | 285 char delimiter); |
| 286 ~NameValuePairsIterator(); |
286 | 287 |
287 // Advances the iterator to the next pair, if any. Returns true if there | 288 // Advances the iterator to the next pair, if any. Returns true if there |
288 // is a next pair. Use name* and value* methods to access the resultant | 289 // is a next pair. Use name* and value* methods to access the resultant |
289 // value. | 290 // value. |
290 bool GetNext(); | 291 bool GetNext(); |
291 | 292 |
292 // Returns false if there was a parse error. | 293 // Returns false if there was a parse error. |
293 bool valid() const { return valid_; } | 294 bool valid() const { return valid_; } |
294 | 295 |
295 // The name of the current name-value pair. | 296 // The name of the current name-value pair. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 // into the original's unquoted_value_ member. | 328 // into the original's unquoted_value_ member. |
328 std::string unquoted_value_; | 329 std::string unquoted_value_; |
329 | 330 |
330 bool value_is_quoted_; | 331 bool value_is_quoted_; |
331 }; | 332 }; |
332 }; | 333 }; |
333 | 334 |
334 } // namespace net | 335 } // namespace net |
335 | 336 |
336 #endif // NET_HTTP_HTTP_UTIL_H_ | 337 #endif // NET_HTTP_HTTP_UTIL_H_ |
OLD | NEW |