Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / icu / source / i18n / nfrlist.h
index a33731d..b5ab13a 100644 (file)
@@ -1,6 +1,6 @@
 /*
 ******************************************************************************
-*   Copyright (C) 1997-2008, International Business Machines
+*   Copyright (C) 1997-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 ******************************************************************************
 *   file name:  nfrlist.h
@@ -39,7 +39,7 @@ public:
     NFRuleList(uint32_t capacity = 10) 
         : fStuff(capacity ? (NFRule**)uprv_malloc(capacity * sizeof(NFRule*)) : NULL)
         , fCount(0)
-        , fCapacity(capacity) {};
+        , fCapacity(capacity) {}
     ~NFRuleList() {
         if (fStuff) {
             for(uint32_t i = 0; i < fCount; ++i) {
@@ -82,6 +82,19 @@ public:
         fCapacity = 0;
         return result;
     }
+    void deleteAll() {
+        NFRule** tmp = NULL;
+        int32_t size = fCount;
+        if (size > 0) {
+            tmp = release();
+            for (int32_t i = 0; i < size; i++) {
+                delete tmp[i];
+            }
+            if (tmp) {
+                uprv_free(tmp);
+            }
+        }
+    }
 
 private:
     NFRuleList(const NFRuleList &other); // forbid copying of this class