Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Unified Diff: Source/wtf/text/WTFString.h

Issue 124003003: Add ascii() / latin1() / utf8() methods to AtomicString to avoid having to call string() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/wtf/text/AtomicString.h ('k') | Source/wtf/text/WTFString.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/text/WTFString.h
diff --git a/Source/wtf/text/WTFString.h b/Source/wtf/text/WTFString.h
index 9b4d6119adf0de8a2bbbe286c00c222ae4f56094..7c2dffd226923a46e0e06d3c9b3aae7562624495 100644
--- a/Source/wtf/text/WTFString.h
+++ b/Source/wtf/text/WTFString.h
@@ -79,6 +79,12 @@ enum TrailingZerosTruncatingPolicy {
TruncateTrailingZeros
};
+enum UTF8ConversionMode {
+ LenientUTF8Conversion,
+ StrictUTF8Conversion,
+ StrictUTF8ConversionReplacingUnpairedSurrogatesWithFFFD
+};
+
template<bool isSpecialCharacter(UChar), typename CharacterType>
bool isAllSpecialCharacters(const CharacterType*, size_t);
@@ -183,14 +189,7 @@ public:
CString ascii() const;
CString latin1() const;
-
- typedef enum {
- LenientConversion,
- StrictConversion,
- StrictConversionReplacingUnpairedSurrogatesWithFFFD,
- } ConversionMode;
-
- CString utf8(ConversionMode = LenientConversion) const;
+ CString utf8(UTF8ConversionMode = LenientUTF8Conversion) const;
UChar operator[](unsigned index) const
{
@@ -680,6 +679,8 @@ WTF_EXPORT const String& emptyString();
using WTF::CString;
using WTF::KeepTrailingZeros;
+using WTF::StrictUTF8Conversion;
+using WTF::StrictUTF8ConversionReplacingUnpairedSurrogatesWithFFFD;
using WTF::String;
using WTF::emptyString;
using WTF::append;
« no previous file with comments | « Source/wtf/text/AtomicString.h ('k') | Source/wtf/text/WTFString.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698