]> git.saurik.com Git - apple/icu.git/blob - icuSources/i18n/unicode/gender.h
ICU-64260.0.1.tar.gz
[apple/icu.git] / icuSources / i18n / unicode / gender.h
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /*
4 *******************************************************************************
5 * Copyright (C) 2008-2013, International Business Machines Corporation and
6 * others. All Rights Reserved.
7 *******************************************************************************
8 *
9 *
10 * File GENDER.H
11 *
12 * Modification History:*
13 * Date Name Description
14 *
15 ********************************************************************************
16 */
17
18 #ifndef _GENDER
19 #define _GENDER
20
21 /**
22 * \file
23 * \brief C++ API: GenderInfo computes the gender of a list.
24 */
25
26 #include "unicode/utypes.h"
27
28 #if !UCONFIG_NO_FORMATTING
29
30 #include "unicode/locid.h"
31 #include "unicode/ugender.h"
32 #include "unicode/uobject.h"
33
34 class GenderInfoTest;
35
36 #if U_SHOW_CPLUSPLUS_API
37 U_NAMESPACE_BEGIN
38
39 /** \internal Forward Declaration */
40 void U_CALLCONV GenderInfo_initCache(UErrorCode &status);
41
42 /**
43 * GenderInfo computes the gender of a list as a whole given the gender of
44 * each element.
45 * @stable ICU 50
46 */
47 class U_I18N_API GenderInfo : public UObject {
48 public:
49
50 /**
51 * Provides access to the predefined GenderInfo object for a given
52 * locale.
53 *
54 * @param locale The locale for which a <code>GenderInfo</code> object is
55 * returned.
56 * @param status Output param set to success/failure code on exit, which
57 * must not indicate a failure before the function call.
58 * @return The predefined <code>GenderInfo</code> object pointer for
59 * this locale. The returned object is immutable, so it is
60 * declared as const. Caller does not own the returned
61 * pointer, so it must not attempt to free it.
62 * @stable ICU 50
63 */
64 static const GenderInfo* U_EXPORT2 getInstance(const Locale& locale, UErrorCode& status);
65
66 /**
67 * Determines the gender of a list as a whole given the gender of each
68 * of the elements.
69 *
70 * @param genders the gender of each element in the list.
71 * @param length the length of gender array.
72 * @param status Output param set to success/failure code on exit, which
73 * must not indicate a failure before the function call.
74 * @return the gender of the whole list.
75 * @stable ICU 50
76 */
77 UGender getListGender(const UGender* genders, int32_t length, UErrorCode& status) const;
78
79 /**
80 * Destructor.
81 *
82 * @stable ICU 50
83 */
84 virtual ~GenderInfo();
85
86 private:
87 int32_t _style;
88
89 /**
90 * Copy constructor. One object per locale invariant. Clients
91 * must never copy GenderInfo objects.
92 */
93 GenderInfo(const GenderInfo& other);
94
95 /**
96 * Assignment operator. Not applicable to immutable objects.
97 */
98 GenderInfo& operator=(const GenderInfo&);
99
100 GenderInfo();
101
102 static const GenderInfo* getNeutralInstance();
103
104 static const GenderInfo* getMixedNeutralInstance();
105
106 static const GenderInfo* getMaleTaintsInstance();
107
108 static const GenderInfo* loadInstance(const Locale& locale, UErrorCode& status);
109
110 friend class ::GenderInfoTest;
111 friend void U_CALLCONV GenderInfo_initCache(UErrorCode &status);
112 };
113
114 U_NAMESPACE_END
115 #endif // U_SHOW_CPLUSPLUS_API
116
117 #endif /* #if !UCONFIG_NO_FORMATTING */
118
119 #endif // _GENDER
120 //eof