2 *****************************************************************************************
3 * Copyright (C) 2013, International Business Machines Corporation and others.
5 *****************************************************************************************
8 #include "unicode/utypes.h"
10 #if !UCONFIG_NO_FORMATTING
12 #include "unicode/uregion.h"
13 #include "unicode/region.h"
14 #include "unicode/uenum.h"
19 U_CAPI
const URegion
* U_EXPORT2
20 uregion_getRegionFromCode(const char *regionCode
, UErrorCode
*status
)
22 return (URegion
*)Region::getInstance(regionCode
, *status
);
26 U_CAPI
const URegion
* U_EXPORT2
27 uregion_getRegionFromNumericCode (int32_t code
, UErrorCode
*status
)
29 return (URegion
*)Region::getInstance(code
, *status
);
33 U_CAPI UEnumeration
* U_EXPORT2
34 uregion_getAvailable(URegionType type
, UErrorCode
*status
)
36 return uenum_openFromStringEnumeration( Region::getAvailable(type
), status
);
40 U_CAPI UBool U_EXPORT2
41 uregion_areEqual(const URegion
* uregion
, const URegion
* otherRegion
)
43 return ( (void*)uregion
== (void*)otherRegion
);
47 U_CAPI
const URegion
* U_EXPORT2
48 uregion_getContainingRegion(const URegion
* uregion
)
50 return (URegion
*)((Region
*)uregion
)->getContainingRegion();
54 U_CAPI
const URegion
* U_EXPORT2
55 uregion_getContainingRegionOfType(const URegion
* uregion
, URegionType type
)
57 return (URegion
*)((Region
*)uregion
)->getContainingRegion(type
);
61 U_CAPI UEnumeration
* U_EXPORT2
62 uregion_getContainedRegions(const URegion
* uregion
, UErrorCode
*status
)
64 return uenum_openFromStringEnumeration( ((Region
*)uregion
)->getContainedRegions(), status
);
68 U_CAPI UEnumeration
* U_EXPORT2
69 uregion_getContainedRegionsOfType(const URegion
* uregion
, URegionType type
, UErrorCode
*status
)
71 return uenum_openFromStringEnumeration( ((Region
*)uregion
)->getContainedRegions(type
), status
);
75 U_CAPI UBool U_EXPORT2
76 uregion_contains(const URegion
* uregion
, const URegion
* otherRegion
)
78 return ((Region
*)uregion
)->contains(*((Region
*)otherRegion
));
82 U_CAPI UEnumeration
* U_EXPORT2
83 uregion_getPreferredValues(const URegion
* uregion
, UErrorCode
*status
)
85 return uenum_openFromStringEnumeration( ((Region
*)uregion
)->getPreferredValues(), status
);
89 U_CAPI
const char* U_EXPORT2
90 uregion_getRegionCode(const URegion
* uregion
)
92 return ((Region
*)uregion
)->getRegionCode();
96 U_CAPI
int32_t U_EXPORT2
97 uregion_getNumericCode(const URegion
* uregion
)
99 return ((Region
*)uregion
)->getNumericCode();
103 U_CAPI URegionType U_EXPORT2
104 uregion_getType(const URegion
* uregion
)
106 return ((Region
*)uregion
)->getType();
110 #endif /* #if !UCONFIG_NO_FORMATTING */