OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_BASE_URL_UTIL_H_ | 5 #ifndef NET_BASE_URL_UTIL_H_ |
6 #define NET_BASE_URL_UTIL_H_ | 6 #define NET_BASE_URL_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 std::string GetKey() const; | 55 std::string GetKey() const; |
56 std::string GetValue() const; | 56 std::string GetValue() const; |
57 const std::string& GetUnescapedValue(); | 57 const std::string& GetUnescapedValue(); |
58 | 58 |
59 bool IsAtEnd() const; | 59 bool IsAtEnd() const; |
60 void Advance(); | 60 void Advance(); |
61 | 61 |
62 private: | 62 private: |
63 const GURL& url_; | 63 const GURL& url_; |
64 url_parse::Component query_; | 64 url::Component query_; |
65 bool at_end_; | 65 bool at_end_; |
66 url_parse::Component key_; | 66 url::Component key_; |
67 url_parse::Component value_; | 67 url::Component value_; |
68 std::string unescaped_value_; | 68 std::string unescaped_value_; |
69 | 69 |
70 DISALLOW_COPY_AND_ASSIGN(QueryIterator); | 70 DISALLOW_COPY_AND_ASSIGN(QueryIterator); |
71 }; | 71 }; |
72 | 72 |
73 // Looks for |search_key| in the query portion of |url|. Returns true if the | 73 // Looks for |search_key| in the query portion of |url|. Returns true if the |
74 // key is found and sets |out_value| to the unescaped value for the key. | 74 // key is found and sets |out_value| to the unescaped value for the key. |
75 // Returns false if the key is not found. | 75 // Returns false if the key is not found. |
76 NET_EXPORT bool GetValueForKeyInQuery(const GURL& url, | 76 NET_EXPORT bool GetValueForKeyInQuery(const GURL& url, |
77 const std::string& search_key, | 77 const std::string& search_key, |
78 std::string* out_value); | 78 std::string* out_value); |
79 | 79 |
80 } // namespace net | 80 } // namespace net |
81 | 81 |
82 #endif // NET_BASE_URL_UTIL_H_ | 82 #endif // NET_BASE_URL_UTIL_H_ |
OLD | NEW |