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