OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... | |
23 // This is basically the same as encodeURIComponent in javascript. | 23 // This is basically the same as encodeURIComponent in javascript. |
24 NET_EXPORT std::string EscapeQueryParamValue(const std::string& text, | 24 NET_EXPORT std::string EscapeQueryParamValue(const std::string& text, |
25 bool use_plus); | 25 bool use_plus); |
26 | 26 |
27 // Escapes a partial or complete file/pathname. This includes: | 27 // Escapes a partial or complete file/pathname. This includes: |
28 // non-printable, non-7bit, and (including space) "#%:<>?[\]^`{|} | 28 // non-printable, non-7bit, and (including space) "#%:<>?[\]^`{|} |
29 // For the base::string16 version, we attempt a conversion to |codepage| before | 29 // For the base::string16 version, we attempt a conversion to |codepage| before |
30 // encoding the string. If this conversion fails, we return false. | 30 // encoding the string. If this conversion fails, we return false. |
31 NET_EXPORT std::string EscapePath(const std::string& path); | 31 NET_EXPORT std::string EscapePath(const std::string& path); |
32 | 32 |
33 // Escapes characters as per expectations of NSURL. This includes: | |
34 // non-printable, non-7bit, and (including space) "#%<>[\]^`{|} | |
35 NET_EXPORT std::string EscapeNSURLPrecursor(const std::string& precursor); | |
mmenke
2014/12/03 15:30:12
optional: Suggest surrounding this in #ifdef OS_M
erikchen
2014/12/03 18:14:01
Done.
| |
36 | |
33 // Escapes application/x-www-form-urlencoded content. This includes: | 37 // Escapes application/x-www-form-urlencoded content. This includes: |
34 // non-printable, non-7bit, and (including space) ?>=<;+'&%$#"![\]^`{|} | 38 // non-printable, non-7bit, and (including space) ?>=<;+'&%$#"![\]^`{|} |
35 // Space is escaped as + (if use_plus is true) and other special characters | 39 // Space is escaped as + (if use_plus is true) and other special characters |
36 // as %XX (hex). | 40 // as %XX (hex). |
37 NET_EXPORT std::string EscapeUrlEncodedData(const std::string& path, | 41 NET_EXPORT std::string EscapeUrlEncodedData(const std::string& path, |
38 bool use_plus); | 42 bool use_plus); |
39 | 43 |
40 // Escapes all non-ASCII input. | 44 // Escapes all non-ASCII input. |
41 NET_EXPORT std::string EscapeNonASCII(const std::string& input); | 45 NET_EXPORT std::string EscapeNonASCII(const std::string& input); |
42 | 46 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
129 UnescapeRule::Type rules, | 133 UnescapeRule::Type rules, |
130 base::OffsetAdjuster::Adjustments* adjustments); | 134 base::OffsetAdjuster::Adjustments* adjustments); |
131 | 135 |
132 // Unescapes the following ampersand character codes from |text|: | 136 // Unescapes the following ampersand character codes from |text|: |
133 // < > & " ' | 137 // < > & " ' |
134 NET_EXPORT base::string16 UnescapeForHTML(const base::string16& text); | 138 NET_EXPORT base::string16 UnescapeForHTML(const base::string16& text); |
135 | 139 |
136 } // namespace net | 140 } // namespace net |
137 | 141 |
138 #endif // NET_BASE_ESCAPE_H_ | 142 #endif // NET_BASE_ESCAPE_H_ |
OLD | NEW |