]> granicus.if.org Git - icu/commitdiff
ICU-8451 Cleanup source/docs for region APIs
authorJohn Emmons <emmo@us.ibm.com>
Wed, 16 Jan 2013 19:06:23 +0000 (19:06 +0000)
committerJohn Emmons <emmo@us.ibm.com>
Wed, 16 Jan 2013 19:06:23 +0000 (19:06 +0000)
X-SVN-Rev: 33056

icu4c/source/i18n/region.cpp
icu4c/source/i18n/unicode/region.h

index ea2f28022fc1f28cba7e72c2d638ca029b49cc6d..df55f612528d6dc0f19cb14d5d7274695a94b0f4 100644 (file)
 #if !UCONFIG_NO_FORMATTING\r
 \r
 \r
-\r
-static UMutex gRegionDataLock = U_MUTEX_INITIALIZER;\r
-static UBool regionDataIsLoaded = false;\r
-static UVector* availableRegions[URGN_LIMIT];\r
-\r
-static UHashtable *regionAliases;\r
-static UHashtable *regionIDMap;\r
-static UHashtable *numericCodeMap;\r
-\r
 U_CDECL_BEGIN\r
 \r
 static void U_CALLCONV\r
@@ -55,23 +46,7 @@ deleteRegion(void *obj) {
  */\r
 static UBool U_CALLCONV region_cleanup(void)\r
 {\r
-    for (int32_t i = 0 ; i < URGN_LIMIT ; i++ ) {\r
-        if ( availableRegions[i] ) {\r
-            delete availableRegions[i];\r
-        }\r
-    }\r
-\r
-    if (regionAliases) {\r
-        uhash_close(regionAliases);\r
-    }\r
-\r
-    if (numericCodeMap) {\r
-        uhash_close(numericCodeMap);\r
-    }\r
-\r
-    if (regionIDMap) {\r
-        uhash_close(regionIDMap);\r
-    }\r
+    icu::Region::cleanupRegionData();\r
 \r
     return TRUE;\r
 }\r
@@ -80,6 +55,14 @@ U_CDECL_END
 \r
 U_NAMESPACE_BEGIN\r
 \r
+static UMutex gRegionDataLock = U_MUTEX_INITIALIZER;\r
+static UBool regionDataIsLoaded = false;\r
+static UVector* availableRegions[URGN_LIMIT];\r
+\r
+static UHashtable *regionAliases;\r
+static UHashtable *regionIDMap;\r
+static UHashtable *numericCodeMap;\r
+\r
 static UnicodeString UNKNOWN_REGION_ID = UNICODE_STRING_SIMPLE("ZZ");\r
 static UnicodeString OUTLYING_OCEANIA_REGION_ID = UNICODE_STRING_SIMPLE("QO");\r
 static UnicodeString WORLD_ID = UNICODE_STRING_SIMPLE("001");\r
@@ -349,7 +332,26 @@ void Region::loadRegionData() {
 \r
 }\r
 \r
+void Region::cleanupRegionData() {\r
+\r
+    for (int32_t i = 0 ; i < URGN_LIMIT ; i++ ) {\r
+        if ( availableRegions[i] ) {\r
+            delete availableRegions[i];\r
+        }\r
+    }\r
+\r
+    if (regionAliases) {\r
+        uhash_close(regionAliases);\r
+    }\r
 \r
+    if (numericCodeMap) {\r
+        uhash_close(numericCodeMap);\r
+    }\r
+\r
+    if (regionIDMap) {\r
+        uhash_close(regionIDMap);\r
+    }\r
+}\r
 \r
 /*\r
  * Default constructor.  Use factory methods only.\r
index 7c24f71b8e7fa14b7faf39d1da785117b35bfdf0..969a4efdfdeb9b0c98235497693925084061cb8e 100644 (file)
 \r
 #include "unicode/utypes.h"\r
 \r
+#ifndef U_HIDE_DRAFT_API\r
+/**\r
+ * URegionType is an enumeration defining the different types of regions.  Current possible\r
+ * values are URGN_WORLD, URGN_CONTINENT, URGN_SUBCONTINENT, URGN_TERRITORY, URGN_GROUPING,\r
+ * URGN_DEPRECATED, and URGN_UNKNOWN.\r
+ * \r
+ * @draft ICU 51 \r
+ */\r
+\r
 typedef enum URegionType {\r
     /**\r
      * Type representing the unknown region.\r
@@ -68,6 +77,7 @@ typedef enum URegionType {
 } URegionType;\r
 \r
 \r
+\r
 #if !UCONFIG_NO_FORMATTING\r
 \r
 #include "unicode/uobject.h"\r
@@ -119,28 +129,8 @@ class U_I18N_API Region : public UObject {
 \r
 public:\r
 \r
-    /**\r
-     * URegionType is an enumeration defining the different types of regions.  Current possible\r
-     * values are URGN_WORLD, URGN_CONTINENT, URGN_SUBCONTINENT, URGN_TERRITORY, URGN_GROUPING,\r
-     * URGN_DEPRECATED, and URGN_UNKNOWN.\r
-     * \r
-     * @draft ICU 51 \r
-     */\r
     static const int32_t UNDEFINED_NUMERIC_CODE = -1;\r
 \r
-    /**\r
-     * Default Constructor.\r
-     *\r
-     * @draft ICU 51\r
-     */\r
-    Region();\r
-\r
-    /**\r
-     * Default Destructor.\r
-     *\r
-     * @draft ICU 51\r
-     */\r
-    ~Region();\r
 \r
 \r
     /**\r
@@ -251,7 +241,7 @@ public:
     /**\r
      * ICU "poor man's RTTI", returns a UClassID for this class.\r
      *\r
-     * @stable ICU 4.2\r
+     * @draft ICU 51\r
      *\r
     */\r
     static UClassID U_EXPORT2 getStaticClassID(void);\r
@@ -259,10 +249,26 @@ public:
     /**\r
      * ICU "poor man's RTTI", returns a UClassID for the actual class.\r
      *\r
-     * @stable ICU 4.2\r
+     * @draft ICU 51\r
      */\r
     virtual UClassID getDynamicClassID() const;\r
 \r
+#ifndef U_HIDE_INTERNAL_API\r
+   /**\r
+     * Default Destructor.\r
+     *\r
+     * @internal\r
+     */\r
+    ~Region();\r
+\r
+    /**\r
+     * Cleans up statically allocated memory.\r
+     * @internal \r
+     */\r
+\r
+    static void cleanupRegionData();\r
+#endif  /* U_HIDE_INTERNAL_API */\r
+\r
 private:\r
     char id[4];\r
     UnicodeString idStr;\r
@@ -272,6 +278,15 @@ private:
     UVector *containedRegions;\r
     UVector *preferredValues;\r
 \r
+#ifndef U_HIDE_INTERNAL_API\r
+    /**\r
+     * Default Constructor. Internal - use factory methods only.\r
+     *\r
+     * @internal\r
+     */\r
+    Region();\r
+\r
+\r
     /*\r
      * Initializes the region data from the ICU resource bundles.  The region data\r
      * contains the basic relationships such as which regions are known, what the numeric\r
@@ -284,12 +299,14 @@ private:
 \r
     static void loadRegionData();\r
 \r
+#endif  /* U_HIDE_INTERNAL_API */\r
+\r
 };\r
 \r
 U_NAMESPACE_END\r
 \r
 #endif /* #if !UCONFIG_NO_FORMATTING */\r
-\r
+#endif  /* U_HIDE_DRAFT_API */\r
 #endif // REGION_H\r
 \r
 //eof\r