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