summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorjshin@chromium.org <jshin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-18 05:12:29 +0000
committerjshin@chromium.org <jshin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-18 05:12:29 +0000
commitb5b2385af64eb08b1feb53fb0ad65c835f472912 (patch)
tree6af57cd4a4965cebe2107e07ca8e563444c3afe9 /base
parent80d6524d33061e0e4f7b06dd87ee94de3e05c7a8 (diff)
downloadchromium_src-b5b2385af64eb08b1feb53fb0ad65c835f472912.zip
chromium_src-b5b2385af64eb08b1feb53fb0ad65c835f472912.tar.gz
chromium_src-b5b2385af64eb08b1feb53fb0ad65c835f472912.tar.bz2
Use 'icu::' namespace explicitly throughout Chrome tree instead of relying on 'using namespace icu'.
This is Chrome's counterpart to the ICU header change that disables 'using namespace icu' (http://codereview.chromium.org/171010/show), which is required to avoid the name colission between Chrome's StringPiece (in base) and ICU's StringPiece. The webkit change (which is minor) will be dealt with in the webkit bugzilla. This can go in before the ICU change/upgrade without affecting anything. BUG=8198 TEST=All the targets are built without an error on all platforms. Review URL: http://codereview.chromium.org/171012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23613 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/file_util_icu.cc8
-rw-r--r--base/file_util_posix.cc6
-rw-r--r--base/string_util_icu.cc12
-rw-r--r--base/time_format.cc28
4 files changed, 27 insertions, 27 deletions
diff --git a/base/file_util_icu.cc b/base/file_util_icu.cc
index 39e2ccf..eeffa92 100644
--- a/base/file_util_icu.cc
+++ b/base/file_util_icu.cc
@@ -24,7 +24,7 @@ class IllegalCharacters {
}
bool containsNone(const string16 &s) {
- return !!set->containsNone(UnicodeString(s.c_str(), s.size()));
+ return !!set->containsNone(icu::UnicodeString(s.c_str(), s.size()));
}
private:
@@ -34,7 +34,7 @@ class IllegalCharacters {
IllegalCharacters();
~IllegalCharacters() { }
- scoped_ptr<UnicodeSet> set;
+ scoped_ptr<icu::UnicodeSet> set;
DISALLOW_COPY_AND_ASSIGN(IllegalCharacters);
};
@@ -52,10 +52,10 @@ IllegalCharacters::IllegalCharacters() {
// freeze it only once. Note that there's a trade-off between memory and
// speed.
#if defined(WCHAR_T_IS_UTF16)
- set.reset(new UnicodeSet(UnicodeString(
+ set.reset(new icu::UnicodeSet(icu::UnicodeString(
L"[[\"*/:<>?\\\\|][:Cc:][:Cf:] - [\u200c\u200d]]"), status));
#else
- set.reset(new UnicodeSet(UNICODE_STRING_SIMPLE(
+ set.reset(new icu::UnicodeSet(UNICODE_STRING_SIMPLE(
"[[\"*/:<>?\\\\|][:Cc:][:Cf:] - [\\u200c\\u200d]]").unescape(),
status));
#endif
diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc
index fb5a7c4..5a02278 100644
--- a/base/file_util_posix.cc
+++ b/base/file_util_posix.cc
@@ -40,10 +40,10 @@ class LocaleAwareComparator {
UErrorCode error_code = U_ZERO_ERROR;
// Use the default collator. The default locale should have been properly
// set by the time this constructor is called.
- collator_.reset(Collator::createInstance(error_code));
+ collator_.reset(icu::Collator::createInstance(error_code));
DCHECK(U_SUCCESS(error_code));
// Make it case-sensitive.
- collator_->setStrength(Collator::TERTIARY);
+ collator_->setStrength(icu::Collator::TERTIARY);
// Note: We do not set UCOL_NORMALIZATION_MODE attribute. In other words, we
// do not pay performance penalty to guarantee sort order correctness for
// non-FCD (http://unicode.org/notes/tn5/#FCD) file names. This should be a
@@ -71,7 +71,7 @@ class LocaleAwareComparator {
}
private:
- scoped_ptr<Collator> collator_;
+ scoped_ptr<icu::Collator> collator_;
Lock lock_;
friend struct DefaultSingletonTraits<LocaleAwareComparator>;
diff --git a/base/string_util_icu.cc b/base/string_util_icu.cc
index 9b4eab6..a043e97 100644
--- a/base/string_util_icu.cc
+++ b/base/string_util_icu.cc
@@ -631,10 +631,10 @@ bool CodepageToUTF16(const std::string& encoded,
namespace {
struct NumberFormatSingletonTraits
- : public DefaultSingletonTraits<NumberFormat> {
- static NumberFormat* New() {
+ : public DefaultSingletonTraits<icu::NumberFormat> {
+ static icu::NumberFormat* New() {
UErrorCode status = U_ZERO_ERROR;
- NumberFormat* formatter = NumberFormat::createInstance(status);
+ icu::NumberFormat* formatter = icu::NumberFormat::createInstance(status);
DCHECK(U_SUCCESS(status));
return formatter;
}
@@ -647,14 +647,14 @@ struct NumberFormatSingletonTraits
} // namespace
std::wstring FormatNumber(int64 number) {
- NumberFormat* number_format =
- Singleton<NumberFormat, NumberFormatSingletonTraits>::get();
+ icu::NumberFormat* number_format =
+ Singleton<icu::NumberFormat, NumberFormatSingletonTraits>::get();
if (!number_format) {
// As a fallback, just return the raw number in a string.
return StringPrintf(L"%lld", number);
}
- UnicodeString ustr;
+ icu::UnicodeString ustr;
number_format->format(number, ustr);
#if defined(WCHAR_T_IS_UTF16)
diff --git a/base/time_format.cc b/base/time_format.cc
index e17b048..80c4235 100644
--- a/base/time_format.cc
+++ b/base/time_format.cc
@@ -14,10 +14,10 @@ using base::Time;
namespace {
-std::wstring TimeFormat(const DateFormat* formatter,
+std::wstring TimeFormat(const icu::DateFormat* formatter,
const Time& time) {
DCHECK(formatter);
- UnicodeString date_string;
+ icu::UnicodeString date_string;
formatter->format(static_cast<UDate>(time.ToDoubleT() * 1000), date_string);
std::wstring output;
@@ -34,38 +34,38 @@ namespace base {
std::wstring TimeFormatTimeOfDay(const Time& time) {
// We can omit the locale parameter because the default should match
// Chrome's application locale.
- scoped_ptr<DateFormat> formatter(DateFormat::createTimeInstance(
- DateFormat::kShort));
+ scoped_ptr<icu::DateFormat> formatter(
+ icu::DateFormat::createTimeInstance(icu::DateFormat::kShort));
return TimeFormat(formatter.get(), time);
}
std::wstring TimeFormatShortDate(const Time& time) {
- scoped_ptr<DateFormat> formatter(DateFormat::createDateInstance(
- DateFormat::kMedium));
+ scoped_ptr<icu::DateFormat> formatter(
+ icu::DateFormat::createDateInstance(icu::DateFormat::kMedium));
return TimeFormat(formatter.get(), time);
}
std::wstring TimeFormatShortDateNumeric(const Time& time) {
- scoped_ptr<DateFormat> formatter(DateFormat::createDateInstance(
- DateFormat::kShort));
+ scoped_ptr<icu::DateFormat> formatter(
+ icu::DateFormat::createDateInstance(icu::DateFormat::kShort));
return TimeFormat(formatter.get(), time);
}
std::wstring TimeFormatShortDateAndTime(const Time& time) {
- scoped_ptr<DateFormat> formatter(DateFormat::createDateTimeInstance(
- DateFormat::kShort));
+ scoped_ptr<icu::DateFormat> formatter(
+ icu::DateFormat::createDateTimeInstance(icu::DateFormat::kShort));
return TimeFormat(formatter.get(), time);
}
std::wstring TimeFormatFriendlyDateAndTime(const Time& time) {
- scoped_ptr<DateFormat> formatter(DateFormat::createDateTimeInstance(
- DateFormat::kFull));
+ scoped_ptr<icu::DateFormat> formatter(
+ icu::DateFormat::createDateTimeInstance(icu::DateFormat::kFull));
return TimeFormat(formatter.get(), time);
}
std::wstring TimeFormatFriendlyDate(const Time& time) {
- scoped_ptr<DateFormat> formatter(DateFormat::createDateInstance(
- DateFormat::kFull));
+ scoped_ptr<icu::DateFormat> formatter(icu::DateFormat::createDateInstance(
+ icu::DateFormat::kFull));
return TimeFormat(formatter.get(), time);
}