diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-07 20:17:15 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-07 20:17:15 +0000 |
commit | 3abebda09095620356405de505db7dd5bb22f3fd (patch) | |
tree | bcc452fba0136c39320294ea785b985145d62ad9 /app | |
parent | a2a5727cc4bfec1bb10db45378894034c9bbfe7d (diff) | |
download | chromium_src-3abebda09095620356405de505db7dd5bb22f3fd.zip chromium_src-3abebda09095620356405de505db7dd5bb22f3fd.tar.gz chromium_src-3abebda09095620356405de505db7dd5bb22f3fd.tar.bz2 |
Remove wstring from l10n_util. Part 8, the last part.
BUG=9911
TEST=no visible changes; all tests pass
Review URL: http://codereview.chromium.org/6156001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70769 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app')
-rw-r--r-- | app/l10n_util.cc | 91 | ||||
-rw-r--r-- | app/l10n_util.h | 63 | ||||
-rw-r--r-- | app/l10n_util_collator.h | 3 |
3 files changed, 0 insertions, 157 deletions
diff --git a/app/l10n_util.cc b/app/l10n_util.cc index e4d1893..68cc33a 100644 --- a/app/l10n_util.cc +++ b/app/l10n_util.cc @@ -568,12 +568,6 @@ bool IsValidLocaleSyntax(const std::string& locale) { return true; } -#if CRBUG_9911_OBSOLETE_GOING_AWAY -std::wstring GetString(int message_id) { - return UTF16ToWide(GetStringUTF16(message_id)); -} -#endif - std::string GetStringUTF8(int message_id) { return UTF16ToUTF8(GetStringUTF16(message_id)); } @@ -630,38 +624,6 @@ static string16 GetStringF(int message_id, return formatted; } -#if CRBUG_9911_OBSOLETE_GOING_AWAY -#if !defined(WCHAR_T_IS_UTF16) -std::wstring GetStringF(int message_id, const std::wstring& a) { - return UTF16ToWide(GetStringFUTF16(message_id, WideToUTF16(a))); -} - -std::wstring GetStringF(int message_id, - const std::wstring& a, - const std::wstring& b) { - return UTF16ToWide(GetStringFUTF16(message_id, WideToUTF16(a), - WideToUTF16(b))); -} - -std::wstring GetStringF(int message_id, - const std::wstring& a, - const std::wstring& b, - const std::wstring& c) { - return UTF16ToWide(GetStringFUTF16(message_id, WideToUTF16(a), - WideToUTF16(b), WideToUTF16(c))); -} - -std::wstring GetStringF(int message_id, - const std::wstring& a, - const std::wstring& b, - const std::wstring& c, - const std::wstring& d) { - return UTF16ToWide(GetStringFUTF16(message_id, WideToUTF16(a), WideToUTF16(b), - WideToUTF16(c), WideToUTF16(d))); -} -#endif -#endif - std::string GetStringFUTF8(int message_id, const string16& a) { return UTF16ToUTF8(GetStringFUTF16(message_id, a)); @@ -725,29 +687,6 @@ string16 GetStringFUTF16(int message_id, return GetStringF(message_id, replacements, NULL); } -#if CRBUG_9911_OBSOLETE_GOING_AWAY -std::wstring GetStringF(int message_id, const std::wstring& a, size_t* offset) { - DCHECK(offset); - std::vector<size_t> offsets; - std::vector<string16> replacements; - replacements.push_back(WideToUTF16(a)); - string16 result = GetStringF(message_id, replacements, &offsets); - DCHECK(offsets.size() == 1); - *offset = offsets[0]; - return UTF16ToWide(result); -} - -std::wstring GetStringF(int message_id, - const std::wstring& a, - const std::wstring& b, - std::vector<size_t>* offsets) { - std::vector<string16> replacements; - replacements.push_back(WideToUTF16(a)); - replacements.push_back(WideToUTF16(b)); - return UTF16ToWide(GetStringF(message_id, replacements, offsets)); -} -#endif - string16 GetStringFUTF16(int message_id, const string16& a, size_t* offset) { DCHECK(offset); std::vector<size_t> offsets; @@ -769,16 +708,6 @@ string16 GetStringFUTF16(int message_id, return GetStringF(message_id, replacements, offsets); } -#if CRBUG_9911_OBSOLETE_GOING_AWAY -std::wstring GetStringF(int message_id, int a) { - return GetStringF(message_id, UTF8ToWide(base::IntToString(a))); -} - -std::wstring GetStringF(int message_id, int64 a) { - return GetStringF(message_id, UTF8ToWide(base::Int64ToString(a))); -} -#endif - string16 GetStringFUTF16Int(int message_id, int a) { return GetStringFUTF16(message_id, UTF8ToUTF16(base::IntToString(a))); } @@ -883,26 +812,6 @@ UCollationResult CompareString16WithCollator(const icu::Collator* collator, return result; } -// Compares the character data stored in two different std:wstring strings by -// specified Collator instance. -UCollationResult CompareStringWithCollator(const icu::Collator* collator, - const std::wstring& lhs, - const std::wstring& rhs) { - DCHECK(collator); - UCollationResult result; -#if defined(WCHAR_T_IS_UTF32) - // Need to convert to UTF-16 to be compatible with UnicodeString's - // constructor. - string16 lhs_utf16 = WideToUTF16(lhs); - string16 rhs_utf16 = WideToUTF16(rhs); - - result = CompareString16WithCollator(collator, lhs_utf16, rhs_utf16); -#else - result = CompareString16WithCollator(collator, lhs, rhs); -#endif - return result; -} - // Specialization of operator() method for string16 version. template <> bool StringComparator<string16>::operator()(const string16& lhs, diff --git a/app/l10n_util.h b/app/l10n_util.h index c9d415a..b76f5d9 100644 --- a/app/l10n_util.h +++ b/app/l10n_util.h @@ -25,12 +25,6 @@ #include "app/l10n_util_mac.h" #endif // OS_MACOSX -// http://crbug.com/9911 . Any functions bracketed by this define are going -// away; this define exists to allow compiler assistance in removing their use. -#if defined(TOOLKIT_VIEWS) -#define CRBUG_9911_OBSOLETE_GOING_AWAY 1 -#endif - namespace l10n_util { // This method is responsible for determining the locale as defined below. In @@ -86,9 +80,6 @@ bool IsValidLocaleSyntax(const std::string& locale); // // Pulls resource string from the string bundle and returns it. -#if CRBUG_9911_OBSOLETE_GOING_AWAY -std::wstring GetString(int message_id); -#endif std::string GetStringUTF8(int message_id); string16 GetStringUTF16(int message_id); @@ -108,47 +99,6 @@ string16 GetStringFUTF16(int message_id, const string16& b, const string16& c, const string16& d); -#if CRBUG_9911_OBSOLETE_GOING_AWAY -#if defined(WCHAR_T_IS_UTF16) -inline std::wstring GetStringF(int message_id, - const std::wstring& a) { - return GetStringFUTF16(message_id, a); -} -inline std::wstring GetStringF(int message_id, - const std::wstring& a, - const std::wstring& b) { - return GetStringFUTF16(message_id, a, b); -} -inline std::wstring GetStringF(int message_id, - const std::wstring& a, - const std::wstring& b, - const std::wstring& c) { - return GetStringFUTF16(message_id, a, b, c); -} -inline std::wstring GetStringF(int message_id, - const std::wstring& a, - const std::wstring& b, - const std::wstring& c, - const std::wstring& d) { - return GetStringFUTF16(message_id, a, b, c, d); -} -#else -std::wstring GetStringF(int message_id, - const std::wstring& a); -std::wstring GetStringF(int message_id, - const std::wstring& a, - const std::wstring& b); -std::wstring GetStringF(int message_id, - const std::wstring& a, - const std::wstring& b, - const std::wstring& c); -std::wstring GetStringF(int message_id, - const std::wstring& a, - const std::wstring& b, - const std::wstring& c, - const std::wstring& d); -#endif -#endif std::string GetStringFUTF8(int message_id, const string16& a); std::string GetStringFUTF8(int message_id, @@ -168,15 +118,6 @@ std::string GetStringFUTF8(int message_id, // vector based version returns offsets ordered by parameter. For example if // invoked with a and b offsets[0] gives the offset for a and offsets[1] the // offset of b regardless of where the parameters end up in the string. -#if CRBUG_9911_OBSOLETE_GOING_AWAY -std::wstring GetStringF(int message_id, - const std::wstring& a, - size_t* offset); -std::wstring GetStringF(int message_id, - const std::wstring& a, - const std::wstring& b, - std::vector<size_t>* offsets); -#endif string16 GetStringFUTF16(int message_id, const string16& a, size_t* offset); @@ -186,10 +127,6 @@ string16 GetStringFUTF16(int message_id, std::vector<size_t>* offsets); // Convenience functions to get a string with a single number as a parameter. -#if CRBUG_9911_OBSOLETE_GOING_AWAY -std::wstring GetStringF(int message_id, int a); -std::wstring GetStringF(int message_id, int64 a); -#endif string16 GetStringFUTF16Int(int message_id, int a); string16 GetStringFUTF16Int(int message_id, int64 a); diff --git a/app/l10n_util_collator.h b/app/l10n_util_collator.h index f934863..bcbfd82 100644 --- a/app/l10n_util_collator.h +++ b/app/l10n_util_collator.h @@ -17,9 +17,6 @@ namespace l10n_util { // Compares the two strings using the specified collator. -UCollationResult CompareStringWithCollator(const icu::Collator* collator, - const std::wstring& lhs, - const std::wstring& rhs); UCollationResult CompareString16WithCollator(const icu::Collator* collator, const string16& lhs, const string16& rhs); |