]> git.saurik.com Git - apple/icu.git/blame - icuSources/i18n/unicode/gender.h
ICU-62135.0.1.tar.gz
[apple/icu.git] / icuSources / i18n / unicode / gender.h
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*******************************************************************************
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#include "unicode/utypes.h"
22
23#if !UCONFIG_NO_FORMATTING
51004dcb
A
24
25#include "unicode/locid.h"
26#include "unicode/ugender.h"
27#include "unicode/uobject.h"
28
29class GenderInfoTest;
30
f3c0d7a5 31#if U_SHOW_CPLUSPLUS_API
51004dcb
A
32U_NAMESPACE_BEGIN
33
57a6839d
A
34// Forward Declaration
35void U_CALLCONV GenderInfo_initCache(UErrorCode &status);
36
51004dcb
A
37/**
38 * GenderInfo computes the gender of a list as a whole given the gender of
39 * each element.
57a6839d 40 * @stable ICU 50
51004dcb
A
41 */
42class U_I18N_API GenderInfo : public UObject {
43public:
44
45 /**
46 * Provides access to the predefined GenderInfo object for a given
47 * locale.
48 *
49 * @param locale The locale for which a <code>GenderInfo</code> object is
50 * returned.
51 * @param status Output param set to success/failure code on exit, which
52 * must not indicate a failure before the function call.
53 * @return The predefined <code>GenderInfo</code> object pointer for
54 * this locale. The returned object is immutable, so it is
55 * declared as const. Caller does not own the returned
56 * pointer, so it must not attempt to free it.
57a6839d 57 * @stable ICU 50
51004dcb
A
58 */
59 static const GenderInfo* U_EXPORT2 getInstance(const Locale& locale, UErrorCode& status);
60
61 /**
62 * Determines the gender of a list as a whole given the gender of each
63 * of the elements.
64 *
65 * @param genders the gender of each element in the list.
66 * @param length the length of gender array.
67 * @param status Output param set to success/failure code on exit, which
68 * must not indicate a failure before the function call.
69 * @return the gender of the whole list.
57a6839d 70 * @stable ICU 50
51004dcb
A
71 */
72 UGender getListGender(const UGender* genders, int32_t length, UErrorCode& status) const;
73
74 /**
75 * Destructor.
76 *
57a6839d 77 * @stable ICU 50
51004dcb
A
78 */
79 virtual ~GenderInfo();
80
81private:
82 int32_t _style;
83
84 /**
85 * Copy constructor. One object per locale invariant. Clients
86 * must never copy GenderInfo objects.
87 */
88 GenderInfo(const GenderInfo& other);
89
90 /**
91 * Assignment operator. Not applicable to immutable objects.
92 */
93 GenderInfo& operator=(const GenderInfo&);
94
95 GenderInfo();
96
97 static const GenderInfo* getNeutralInstance();
98
99 static const GenderInfo* getMixedNeutralInstance();
100
101 static const GenderInfo* getMaleTaintsInstance();
102
103 static const GenderInfo* loadInstance(const Locale& locale, UErrorCode& status);
57a6839d 104
51004dcb 105 friend class ::GenderInfoTest;
57a6839d 106 friend void U_CALLCONV GenderInfo_initCache(UErrorCode &status);
51004dcb
A
107};
108
109U_NAMESPACE_END
f3c0d7a5 110#endif // U_SHOW_CPLUSPLUS_API
51004dcb 111
51004dcb
A
112#endif /* #if !UCONFIG_NO_FORMATTING */
113
114#endif // _GENDER
115//eof