| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // We %XX everything except alphanumerics and %-_.!~*'() and the restricted | 23 // We %XX everything except alphanumerics and %-_.!~*'() and the restricted |
| 24 // chracters (;/?:@&=+$,). | 24 // chracters (;/?:@&=+$,). |
| 25 std::string EscapeExternalHandlerValue(const std::string& text); | 25 std::string EscapeExternalHandlerValue(const std::string& text); |
| 26 | 26 |
| 27 // Append the given character to the output string, escaping the character if | 27 // Append the given character to the output string, escaping the character if |
| 28 // the character would be interpretted as an HTML delimiter. | 28 // the character would be interpretted as an HTML delimiter. |
| 29 void AppendEscapedCharForHTML(char c, std::string* output); | 29 void AppendEscapedCharForHTML(char c, std::string* output); |
| 30 | 30 |
| 31 // Escape chars that might cause this text to be interpretted as HTML tags. | 31 // Escape chars that might cause this text to be interpretted as HTML tags. |
| 32 std::string EscapeForHTML(const std::string& text); | 32 std::string EscapeForHTML(const std::string& text); |
| 33 std::wstring EscapeForHTML(const std::wstring& text); |
| 33 | 34 |
| 34 // Unescaping ------------------------------------------------------------------ | 35 // Unescaping ------------------------------------------------------------------ |
| 35 | 36 |
| 36 class UnescapeRule { | 37 class UnescapeRule { |
| 37 public: | 38 public: |
| 38 // A combination of the following flags that is passed to the unescaping | 39 // A combination of the following flags that is passed to the unescaping |
| 39 // functions. | 40 // functions. |
| 40 typedef uint32 Type; | 41 typedef uint32 Type; |
| 41 | 42 |
| 42 enum { | 43 enum { |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 112 |
| 112 // A specialized version of EscapeQueryParamValue for wide strings that | 113 // A specialized version of EscapeQueryParamValue for wide strings that |
| 113 // assumes the codepage is UTF8. This is provided as a convenience. | 114 // assumes the codepage is UTF8. This is provided as a convenience. |
| 114 // | 115 // |
| 115 // TODO(brettw) bug 1201094: This function should be removed. See the bug for | 116 // TODO(brettw) bug 1201094: This function should be removed. See the bug for |
| 116 // why and what callers should do instead. | 117 // why and what callers should do instead. |
| 117 std::wstring EscapeQueryParamValueUTF8(const std::wstring& text); | 118 std::wstring EscapeQueryParamValueUTF8(const std::wstring& text); |
| 118 | 119 |
| 119 #endif // #ifndef NET_BASE_ESCAPE_H__ | 120 #endif // #ifndef NET_BASE_ESCAPE_H__ |
| 120 | 121 |
| OLD | NEW |