Home | History | Annotate | Download | only in i18n

Lines Matching defs:Region

8 * File REGION.CPP
18 * \brief C++ API: Region classes (territory containment)
21 #include "unicode/region.h"
41 delete (icu::Region *)obj;
49 icu::Region::cleanupRegionData();
73 * Initializes the region data from the ICU resource bundles. The region data
77 * If the region data has already loaded, then this method simply returns without doing
80 void Region::loadRegionData() {
144 Region *r = new Region();
171 Region *aliasToRegion = (Region *) uhash_get(regionIDMap,&aliasTo);
172 Region *aliasFromRegion = (Region *)uhash_get(regionIDMap,aliasFromStr);
174 if ( aliasToRegion != NULL && aliasFromRegion == NULL ) { // This is just an alias from some string to a region
177 if ( aliasFromRegion == NULL ) { // Deprecated region code not in the master codes list - so need to create a deprecated region for it.
178 aliasFromRegion = new Region();
205 Region *target = (Region *)uhash_get(regionIDMap,(void *)&currentRegion);
224 Region *r = (Region *)uhash_get(regionIDMap,(void *)&codeMappingID);
241 Region *r;
243 r = (Region *) uhash_get(regionIDMap,(void *)&WORLD_ID_STRING);
249 r = (Region *) uhash_get(regionIDMap,(void *)&UNKNOWN_REGION_ID_STRING);
255 r = (Region *) uhash_get(regionIDMap,(void *)continents->elementAt(i));
263 r = (Region *) uhash_get(regionIDMap,(void *)groupings->elementAt(i));
270 // Special case: The region code "QO" (Outlying Oceania) is a subcontinent code added by CLDR
274 r = (Region *) uhash_get(regionIDMap,(void *)&OUTLYING_OCEANIA_REGION_ID_STRING);
284 Region *parentRegion = (Region *) uhash_get(regionIDMap,(void *)&parentStr);
288 Region *childRegion = (Region *) uhash_get(regionIDMap,(void *)&child);
291 // Add the child region to the set of regions contained by the parent
300 // Set the parent region to be the containing region of the child.
301 // Regions of type GROUPING can't be set as the parent, since another region
314 Region *ar = (Region *)element->value.pointer;
341 void Region::cleanupRegionData() {
362 Region::Region ()
371 Region::~Region () {
384 Region::operator==(const Region &that) const {
392 Region::operator!=(const Region &that) const {
397 * Returns a pointer to a Region using the given region code. The region code can be either 2-letter ISO code,
398 * 3-letter ISO code, UNM.49 numeric code, or other valid Unicode Region Code as defined by the LDML specification.
400 * If the region code is NULL or not recognized, the appropriate error code will be set ( U_ILLEGAL_ARGUMENT_ERROR )
402 const Region* U_EXPORT2
403 Region::getInstance(const char *region_code, UErrorCode &status) {
418 Region *r = (Region *)uhash_get(regionIDMap,(void *)&regionCodeString);
421 r = (Region *)uhash_get(regionAliases,(void *)&regionCodeString);
424 if ( !r ) { // Unknown region code
433 r = (Region *)uhash_get(regionIDMap,(void *)ustr);
442 * Returns a pointer to a Region using the given numeric region code. If the numeric region code is not recognized,
445 const Region* U_EXPORT2
446 Region::getInstance (int32_t code, UErrorCode &status) {
455 Region *r = (Region *)uhash_iget(numericCodeMap,code);
466 r = (Region *)uhash_get(regionAliases,&id);
478 r = (Region *)uhash_get(regionIDMap,(void *)ustr);
490 Region::getAvailable(URegionType type) {
500 * Returns a pointer to the region that contains this region. Returns NULL if this region is code "001" (World)
501 * or "ZZ" (Unknown region). For example, calling this method with region "IT" (Italy) returns the
502 * region "039" (Southern Europe).
504 const Region*
505 Region::getContainingRegion() const {
511 * Return a pointer to the region that geographically contains this region and matches the given type,
512 * moving multiple steps up the containment chain if necessary. Returns NULL if no containing region can be found
515 * with region "IT" (Italy) for type "URGN_CONTINENT" returns the region "150" ( Europe ).
517 const Region*
518 Region::getContainingRegion(URegionType type) const {
532 * Return an enumeration over the IDs of all the regions that are immediate children of this region in the
533 * region hierarchy. These returned regions could be either macro regions, territories, or a mixture of the two,
534 * depending on the containment data as defined in CLDR. This API may return NULL if this region doesn't have
535 * any sub-regions. For example, calling this method with region "150" (Europe) returns an enumeration containing
540 Region::getContainedRegions() const {
547 * Returns an enumeration over the IDs of all the regions that are children of this region anywhere in the region
548 * hierarchy and match the given type. This API may return an empty enumeration if this region doesn't have any
549 * sub-regions that match the given type. For example, calling this method with region "150" (Europe) and type
553 Region::getContainedRegions( URegionType type ) const {
563 const Region *r = Region::getInstance(id,status);
570 const Region *r2 = Region::getInstance(id2,status);
583 * Returns true if this region contains the supplied other region anywhere in the region hierarchy.
586 Region::contains(const Region &other) const {
597 Region *cr = (Region *) uhash_get(regionIDMap,(void *)crStr);
609 * regions for this region. Returns NULL for a non-deprecated region. For example, calling this method with region
613 Region::getPreferredValues() const {
625 * Return this region's canonical region code.
628 Region::getRegionCode() const {
633 Region::getNumericCode() const {
638 * Returns the region type of this region.
641 Region::getType() const {