Wed, 31 Dec 2014 07:22:50 +0100
Correct previous dual key logic pending first delivery installment.
michael@0 | 1 | /* |
michael@0 | 2 | ***************************************************************************************** |
michael@0 | 3 | * Copyright (C) 2013, International Business Machines Corporation and others. |
michael@0 | 4 | * All Rights Reserved. |
michael@0 | 5 | ***************************************************************************************** |
michael@0 | 6 | */ |
michael@0 | 7 | |
michael@0 | 8 | #include "unicode/utypes.h" |
michael@0 | 9 | |
michael@0 | 10 | #if !UCONFIG_NO_FORMATTING |
michael@0 | 11 | |
michael@0 | 12 | #include "unicode/uregion.h" |
michael@0 | 13 | #include "unicode/region.h" |
michael@0 | 14 | #include "unicode/uenum.h" |
michael@0 | 15 | |
michael@0 | 16 | U_NAMESPACE_USE |
michael@0 | 17 | |
michael@0 | 18 | |
michael@0 | 19 | U_CAPI const URegion* U_EXPORT2 |
michael@0 | 20 | uregion_getRegionFromCode(const char *regionCode, UErrorCode *status) |
michael@0 | 21 | { |
michael@0 | 22 | return (URegion*)Region::getInstance(regionCode, *status); |
michael@0 | 23 | } |
michael@0 | 24 | |
michael@0 | 25 | |
michael@0 | 26 | U_CAPI const URegion* U_EXPORT2 |
michael@0 | 27 | uregion_getRegionFromNumericCode (int32_t code, UErrorCode *status) |
michael@0 | 28 | { |
michael@0 | 29 | return (URegion*)Region::getInstance(code, *status); |
michael@0 | 30 | } |
michael@0 | 31 | |
michael@0 | 32 | |
michael@0 | 33 | U_CAPI UEnumeration* U_EXPORT2 |
michael@0 | 34 | uregion_getAvailable(URegionType type, UErrorCode *status) |
michael@0 | 35 | { |
michael@0 | 36 | return uenum_openFromStringEnumeration( Region::getAvailable(type), status ); |
michael@0 | 37 | } |
michael@0 | 38 | |
michael@0 | 39 | |
michael@0 | 40 | U_CAPI UBool U_EXPORT2 |
michael@0 | 41 | uregion_areEqual(const URegion* uregion, const URegion* otherRegion) |
michael@0 | 42 | { |
michael@0 | 43 | return ( (void*)uregion == (void*)otherRegion ); |
michael@0 | 44 | } |
michael@0 | 45 | |
michael@0 | 46 | |
michael@0 | 47 | U_CAPI const URegion* U_EXPORT2 |
michael@0 | 48 | uregion_getContainingRegion(const URegion* uregion) |
michael@0 | 49 | { |
michael@0 | 50 | return (URegion*)((Region*)uregion)->getContainingRegion(); |
michael@0 | 51 | } |
michael@0 | 52 | |
michael@0 | 53 | |
michael@0 | 54 | U_CAPI const URegion* U_EXPORT2 |
michael@0 | 55 | uregion_getContainingRegionOfType(const URegion* uregion, URegionType type) |
michael@0 | 56 | { |
michael@0 | 57 | return (URegion*)((Region*)uregion)->getContainingRegion(type); |
michael@0 | 58 | } |
michael@0 | 59 | |
michael@0 | 60 | |
michael@0 | 61 | U_CAPI UEnumeration* U_EXPORT2 |
michael@0 | 62 | uregion_getContainedRegions(const URegion* uregion, UErrorCode *status) |
michael@0 | 63 | { |
michael@0 | 64 | return uenum_openFromStringEnumeration( ((Region*)uregion)->getContainedRegions(), status); |
michael@0 | 65 | } |
michael@0 | 66 | |
michael@0 | 67 | |
michael@0 | 68 | U_CAPI UEnumeration* U_EXPORT2 |
michael@0 | 69 | uregion_getContainedRegionsOfType(const URegion* uregion, URegionType type, UErrorCode *status) |
michael@0 | 70 | { |
michael@0 | 71 | return uenum_openFromStringEnumeration( ((Region*)uregion)->getContainedRegions(type), status); |
michael@0 | 72 | } |
michael@0 | 73 | |
michael@0 | 74 | |
michael@0 | 75 | U_CAPI UBool U_EXPORT2 |
michael@0 | 76 | uregion_contains(const URegion* uregion, const URegion* otherRegion) |
michael@0 | 77 | { |
michael@0 | 78 | return ((Region*)uregion)->contains(*((Region*)otherRegion)); |
michael@0 | 79 | } |
michael@0 | 80 | |
michael@0 | 81 | |
michael@0 | 82 | U_CAPI UEnumeration* U_EXPORT2 |
michael@0 | 83 | uregion_getPreferredValues(const URegion* uregion, UErrorCode *status) |
michael@0 | 84 | { |
michael@0 | 85 | return uenum_openFromStringEnumeration( ((Region*)uregion)->getPreferredValues(), status); |
michael@0 | 86 | } |
michael@0 | 87 | |
michael@0 | 88 | |
michael@0 | 89 | U_CAPI const char* U_EXPORT2 |
michael@0 | 90 | uregion_getRegionCode(const URegion* uregion) |
michael@0 | 91 | { |
michael@0 | 92 | return ((Region*)uregion)->getRegionCode(); |
michael@0 | 93 | } |
michael@0 | 94 | |
michael@0 | 95 | |
michael@0 | 96 | U_CAPI int32_t U_EXPORT2 |
michael@0 | 97 | uregion_getNumericCode(const URegion* uregion) |
michael@0 | 98 | { |
michael@0 | 99 | return ((Region*)uregion)->getNumericCode(); |
michael@0 | 100 | } |
michael@0 | 101 | |
michael@0 | 102 | |
michael@0 | 103 | U_CAPI URegionType U_EXPORT2 |
michael@0 | 104 | uregion_getType(const URegion* uregion) |
michael@0 | 105 | { |
michael@0 | 106 | return ((Region*)uregion)->getType(); |
michael@0 | 107 | } |
michael@0 | 108 | |
michael@0 | 109 | |
michael@0 | 110 | #endif /* #if !UCONFIG_NO_FORMATTING */ |