Explicitly use icu namespace.
authorager@chromium.org <ager@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 4 Apr 2011 02:56:34 +0000 (02:56 +0000)
committerager@chromium.org <ager@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 4 Apr 2011 02:56:34 +0000 (02:56 +0000)
Chromium builds with U_USING_ICU_NAMESPACE=0, so we need this.

Landing for thakis@chromium.org.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7487 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/extensions/experimental/break-iterator.cc
src/extensions/experimental/break-iterator.h
src/extensions/experimental/i18n-extension.cc

index 6f574d4..e8baea7 100644 (file)
@@ -46,16 +46,16 @@ icu::BreakIterator* BreakIterator::UnpackBreakIterator(
   return NULL;
 }
 
-UnicodeString* BreakIterator::ResetAdoptedText(
+icu::UnicodeString* BreakIterator::ResetAdoptedText(
     v8::Handle<v8::Object> obj, v8::Handle<v8::Value> value) {
   // Get the previous value from the internal field.
-  UnicodeString* text = static_cast<UnicodeString*>(
+  icu::UnicodeString* text = static_cast<icu::UnicodeString*>(
       obj->GetPointerFromInternalField(1));
   delete text;
 
   // Assign new value to the internal pointer.
   v8::String::Value text_value(value);
-  text = new UnicodeString(
+  text = new icu::UnicodeString(
       reinterpret_cast<const UChar*>(*text_value), text_value.length());
   obj->SetPointerInInternalField(1, text);
 
@@ -74,7 +74,7 @@ void BreakIterator::DeleteBreakIterator(v8::Persistent<v8::Value> object,
   // pointing to a break iterator.
   delete UnpackBreakIterator(persistent_object);
 
-  delete static_cast<UnicodeString*>(
+  delete static_cast<icu::UnicodeString*>(
       persistent_object->GetPointerFromInternalField(1));
 
   // Then dispose of the persistent handle to JS object.
@@ -144,8 +144,9 @@ v8::Handle<v8::Value> BreakIterator::BreakIteratorBreakType(
   }
 
   // TODO(cira): Remove cast once ICU fixes base BreakIterator class.
-  int32_t status =
-      static_cast<RuleBasedBreakIterator*>(break_iterator)->getRuleStatus();
+  icu::RuleBasedBreakIterator* rule_based_iterator =
+      static_cast<icu::RuleBasedBreakIterator*>(break_iterator);
+  int32_t status = rule_based_iterator->getRuleStatus();
   // Keep return values in sync with JavaScript BreakType enum.
   if (status >= UBRK_WORD_NONE && status < UBRK_WORD_NONE_LIMIT) {
     return v8::Int32::New(UBRK_WORD_NONE);
index 473bc89..fac1ed8 100644 (file)
@@ -51,8 +51,8 @@ class BreakIterator {
 
   // Deletes the old value and sets the adopted text in
   // corresponding JavaScript object.
-  static UnicodeString* ResetAdoptedText(v8::Handle<v8::Object> obj,
-                                         v8::Handle<v8::Value> text_value);
+  static icu::UnicodeString* ResetAdoptedText(v8::Handle<v8::Object> obj,
+                                              v8::Handle<v8::Value> text_value);
 
   // Release memory we allocated for the BreakIterator once the JS object that
   // holds the pointer gets garbage collected.
index e65fdcc..f14fd9e 100644 (file)
@@ -167,7 +167,7 @@ v8::Handle<v8::Value> I18NExtension::JSAvailableLocales(
   v8::Local<v8::Array> all_locales = v8::Array::New();
 
   int count = 0;
-  const Locale* icu_locales = icu::Locale::getAvailableLocales(count);
+  const icu::Locale* icu_locales = icu::Locale::getAvailableLocales(count);
   for (int i = 0; i < count; ++i) {
     all_locales->Set(i, v8::String::New(icu_locales[i].getName()));
   }
@@ -230,7 +230,7 @@ static v8::Handle<v8::Value> GetDisplayItem(const v8::Arguments& args,
   icu::Locale icu_locale(base_locale.c_str());
   icu::Locale display_locale =
       icu::Locale(*v8::String::Utf8Value(args[1]->ToString()));
-  UnicodeString result;
+  icu::UnicodeString result;
   if (item == "language") {
     icu_locale.getDisplayLanguage(display_locale, result);
   } else if (item == "script") {