| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_BASE_ESCAPE_H_ | 5 #ifndef NET_BASE_ESCAPE_H_ |
| 6 #define NET_BASE_ESCAPE_H_ | 6 #define NET_BASE_ESCAPE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 // Escapes characters in text suitable for use as a query parameter value. | 118 // Escapes characters in text suitable for use as a query parameter value. |
| 119 // We %XX everything except alphanumerics and -_.!~*'() | 119 // We %XX everything except alphanumerics and -_.!~*'() |
| 120 // Spaces change to "+" unless you pass usePlus=false. | 120 // Spaces change to "+" unless you pass usePlus=false. |
| 121 // This is basically the same as encodeURIComponent in javascript. | 121 // This is basically the same as encodeURIComponent in javascript. |
| 122 // For the string16 version, we do a conversion to charset before encoding the | 122 // For the string16 version, we do a conversion to charset before encoding the |
| 123 // string. If the charset doesn't exist, we return false. | 123 // string. If the charset doesn't exist, we return false. |
| 124 std::string EscapeQueryParamValue(const std::string& text, bool use_plus); | 124 std::string EscapeQueryParamValue(const std::string& text, bool use_plus); |
| 125 bool EscapeQueryParamValue(const string16& text, const char* codepage, | 125 bool EscapeQueryParamValue(const string16& text, const char* codepage, |
| 126 bool use_plus, string16* escaped); | 126 bool use_plus, string16* escaped); |
| 127 | 127 |
| 128 // A specialized version of EscapeQueryParamValue for string16s that | 128 // A specialized version of EscapeQueryParamValue for wide strings that |
| 129 // assumes the codepage is UTF8. This is provided as a convenience. | 129 // assumes the codepage is UTF8. This is provided as a convenience. |
| 130 string16 EscapeQueryParamValueUTF8(const string16& text, bool use_plus); | 130 std::wstring EscapeQueryParamValueUTF8(const std::wstring& text, bool use_plus); |
| 131 | 131 |
| 132 #endif // NET_BASE_ESCAPE_H_ | 132 #endif // NET_BASE_ESCAPE_H_ |
| OLD | NEW |