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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // Escapes chars that might cause this text to be interpretted as HTML tags. | 59 // Escapes chars that might cause this text to be interpretted as HTML tags. |
60 NET_EXPORT std::string EscapeForHTML(const std::string& text); | 60 NET_EXPORT std::string EscapeForHTML(const std::string& text); |
61 NET_EXPORT base::string16 EscapeForHTML(const base::string16& text); | 61 NET_EXPORT base::string16 EscapeForHTML(const base::string16& text); |
62 | 62 |
63 // Unescaping ------------------------------------------------------------------ | 63 // Unescaping ------------------------------------------------------------------ |
64 | 64 |
65 class UnescapeRule { | 65 class UnescapeRule { |
66 public: | 66 public: |
67 // A combination of the following flags that is passed to the unescaping | 67 // A combination of the following flags that is passed to the unescaping |
68 // functions. | 68 // functions. |
69 typedef uint32 Type; | 69 typedef uint32_t Type; |
70 | 70 |
71 enum { | 71 enum { |
72 // Don't unescape anything at all. | 72 // Don't unescape anything at all. |
73 NONE = 0, | 73 NONE = 0, |
74 | 74 |
75 // Don't unescape anything special, but all normal unescaping will happen. | 75 // Don't unescape anything special, but all normal unescaping will happen. |
76 // This is a placeholder and can't be combined with other flags (since it's | 76 // This is a placeholder and can't be combined with other flags (since it's |
77 // just the absence of them). All other unescape rules imply "normal" in | 77 // just the absence of them). All other unescape rules imply "normal" in |
78 // addition to their special meaning. Things like escaped letters, digits, | 78 // addition to their special meaning. Things like escaped letters, digits, |
79 // and most symbols will get unescaped with this mode. | 79 // and most symbols will get unescaped with this mode. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 UnescapeRule::Type rules, | 135 UnescapeRule::Type rules, |
136 base::OffsetAdjuster::Adjustments* adjustments); | 136 base::OffsetAdjuster::Adjustments* adjustments); |
137 | 137 |
138 // Unescapes the following ampersand character codes from |text|: | 138 // Unescapes the following ampersand character codes from |text|: |
139 // < > & " ' | 139 // < > & " ' |
140 NET_EXPORT base::string16 UnescapeForHTML(const base::string16& text); | 140 NET_EXPORT base::string16 UnescapeForHTML(const base::string16& text); |
141 | 141 |
142 } // namespace net | 142 } // namespace net |
143 | 143 |
144 #endif // NET_BASE_ESCAPE_H_ | 144 #endif // NET_BASE_ESCAPE_H_ |
OLD | NEW |