]> git.saurik.com Git - apple/icu.git/blame - icuSources/i18n/uregion.cpp
ICU-551.24.tar.gz
[apple/icu.git] / icuSources / i18n / uregion.cpp
CommitLineData
51004dcb
A
1/*
2*****************************************************************************************
b331163b 3* Copyright (C) 2013-2015, International Business Machines Corporation and others.
51004dcb
A
4* All Rights Reserved.
5*****************************************************************************************
6*/
7
8#include "unicode/utypes.h"
9
10#if !UCONFIG_NO_FORMATTING
11
12#include "unicode/uregion.h"
13#include "unicode/region.h"
14#include "unicode/uenum.h"
b331163b 15#include "unicode/strenum.h"
51004dcb
A
16
17U_NAMESPACE_USE
18
19
20U_CAPI const URegion* U_EXPORT2
21uregion_getRegionFromCode(const char *regionCode, UErrorCode *status)
22{
23 return (URegion*)Region::getInstance(regionCode, *status);
24}
25
26
27U_CAPI const URegion* U_EXPORT2
28uregion_getRegionFromNumericCode (int32_t code, UErrorCode *status)
29{
30 return (URegion*)Region::getInstance(code, *status);
31}
32
33
34U_CAPI UEnumeration* U_EXPORT2
35uregion_getAvailable(URegionType type, UErrorCode *status)
36{
b331163b
A
37 StringEnumeration* strenum = Region::getAvailable(type, *status);
38 return uenum_openFromStringEnumeration( strenum, status );
51004dcb
A
39}
40
41
42U_CAPI UBool U_EXPORT2
43uregion_areEqual(const URegion* uregion, const URegion* otherRegion)
44{
45 return ( (void*)uregion == (void*)otherRegion );
46}
47
48
49U_CAPI const URegion* U_EXPORT2
50uregion_getContainingRegion(const URegion* uregion)
51{
52 return (URegion*)((Region*)uregion)->getContainingRegion();
53}
54
55
56U_CAPI const URegion* U_EXPORT2
57uregion_getContainingRegionOfType(const URegion* uregion, URegionType type)
58{
59 return (URegion*)((Region*)uregion)->getContainingRegion(type);
60}
61
62
63U_CAPI UEnumeration* U_EXPORT2
64uregion_getContainedRegions(const URegion* uregion, UErrorCode *status)
65{
b331163b
A
66 StringEnumeration* strenum = ((Region*)uregion)->getContainedRegions(*status);
67 return uenum_openFromStringEnumeration( strenum, status);
51004dcb
A
68}
69
70
71U_CAPI UEnumeration* U_EXPORT2
72uregion_getContainedRegionsOfType(const URegion* uregion, URegionType type, UErrorCode *status)
73{
b331163b
A
74 StringEnumeration* strenum = ((Region*)uregion)->getContainedRegions(type, *status);
75 return uenum_openFromStringEnumeration( strenum, status);
51004dcb
A
76}
77
78
79U_CAPI UBool U_EXPORT2
80uregion_contains(const URegion* uregion, const URegion* otherRegion)
81{
82 return ((Region*)uregion)->contains(*((Region*)otherRegion));
83}
84
85
86U_CAPI UEnumeration* U_EXPORT2
87uregion_getPreferredValues(const URegion* uregion, UErrorCode *status)
88{
b331163b
A
89 StringEnumeration* strenum = ((Region*)uregion)->getPreferredValues(*status);
90 return uenum_openFromStringEnumeration( strenum, status);
51004dcb
A
91}
92
93
94U_CAPI const char* U_EXPORT2
95uregion_getRegionCode(const URegion* uregion)
96{
97 return ((Region*)uregion)->getRegionCode();
98}
99
100
101U_CAPI int32_t U_EXPORT2
102uregion_getNumericCode(const URegion* uregion)
103{
104 return ((Region*)uregion)->getNumericCode();
105}
106
107
108U_CAPI URegionType U_EXPORT2
109uregion_getType(const URegion* uregion)
110{
111 return ((Region*)uregion)->getType();
112}
113
114
115#endif /* #if !UCONFIG_NO_FORMATTING */