]>
git.saurik.com Git - apple/icu.git/blob - icuSources/i18n/zonemeta.h
2 *******************************************************************************
3 * Copyright (C) 2007-2009, International Business Machines Corporation and *
4 * others. All Rights Reserved. *
5 *******************************************************************************
10 #include "unicode/utypes.h"
12 #if !UCONFIG_NO_FORMATTING
14 #include "unicode/unistr.h"
19 typedef struct CanonicalMapEntry
{
20 const UChar
*id
; // const because it's a reference to a resource bundle string.
21 const UChar
*country
; // const because it's a reference to a resource bundle string.
24 typedef struct OlsonToMetaMappingEntry
{
25 const UChar
*mzid
; // const because it's a reference to a resource bundle string.
28 } OlsonToMetaMappingEntry
;
30 typedef struct MetaToOlsonMappingEntry
{
31 const UChar
*id
; // const because it's a reference to a resource bundle string.
33 } MetaToOlsonMappingEntry
;
37 class U_I18N_API ZoneMeta
{
40 * Return the canonical id for this system tzid, which might be the id itself.
41 * If the given system tzid is not know, U_ILLEGAL_ARGUMENT_ERROR is set in the status.
43 static UnicodeString
& U_EXPORT2
getCanonicalSystemID(const UnicodeString
&tzid
, UnicodeString
&systemID
, UErrorCode
& status
);
46 * Return the canonical country code for this tzid. If we have none, or if the time zone
47 * is not associated with a country, return null.
49 static UnicodeString
& U_EXPORT2
getCanonicalCountry(const UnicodeString
&tzid
, UnicodeString
&canonicalCountry
);
52 * Return the country code if this is a 'single' time zone that can fallback to just
53 * the country, otherwise return empty string. (Note, one must also check the locale data
54 * to see that there is a localization for the country in order to implement
55 * tr#35 appendix J step 5.)
57 static UnicodeString
& U_EXPORT2
getSingleCountry(const UnicodeString
&tzid
, UnicodeString
&country
);
60 * Returns a CLDR metazone ID for the given Olson tzid and time.
62 static UnicodeString
& U_EXPORT2
getMetazoneID(const UnicodeString
&tzid
, UDate date
, UnicodeString
&result
);
64 * Returns an Olson ID for the ginve metazone and region
66 static UnicodeString
& U_EXPORT2
getZoneIdByMetazone(const UnicodeString
&mzid
, const UnicodeString
®ion
, UnicodeString
&result
);
68 static const UVector
* U_EXPORT2
getMetazoneMappings(const UnicodeString
&tzid
);
71 ZoneMeta(); // Prevent construction.
72 static const CanonicalMapEntry
* U_EXPORT2
getCanonicalInfo(const UnicodeString
&tzid
);
74 static void initializeCanonicalMap(void);
75 static void initializeOlsonToMeta(void);
76 static void initializeMetaToOlson(void);
77 static UHashtable
* createCanonicalMap(void);
78 static UHashtable
* createOlsonToMetaMap(void);
79 static UHashtable
* createMetaToOlsonMap(void);
84 #endif /* #if !UCONFIG_NO_FORMATTING */