Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:13:05

0001 // © 2016 and later: Unicode, Inc. and others.
0002 // License & terms of use: http://www.unicode.org/copyright.html
0003 /*
0004 *******************************************************************************
0005 * Copyright (C) 2008-2013, International Business Machines Corporation and
0006 * others. All Rights Reserved.
0007 *******************************************************************************
0008 *
0009 *
0010 * File GENDER.H
0011 *
0012 * Modification History:*
0013 *   Date        Name        Description
0014 *
0015 ********************************************************************************
0016 */
0017 
0018 #ifndef _GENDER
0019 #define _GENDER
0020 
0021 /**
0022  * \file
0023  * \brief C++ API: GenderInfo computes the gender of a list.
0024  */
0025 
0026 #include "unicode/utypes.h"
0027 
0028 #if U_SHOW_CPLUSPLUS_API
0029 
0030 #if !UCONFIG_NO_FORMATTING
0031 
0032 #include "unicode/locid.h"
0033 #include "unicode/ugender.h"
0034 #include "unicode/uobject.h"
0035 
0036 class GenderInfoTest;
0037 
0038 U_NAMESPACE_BEGIN
0039 
0040 /** \internal Forward Declaration  */
0041 void U_CALLCONV GenderInfo_initCache(UErrorCode &status);
0042 
0043 /**
0044  * GenderInfo computes the gender of a list as a whole given the gender of
0045  * each element.
0046  * @stable ICU 50
0047  */
0048 class U_I18N_API GenderInfo : public UObject {
0049 public:
0050 
0051     /**
0052      * Provides access to the predefined GenderInfo object for a given
0053      * locale.
0054      *
0055      * @param locale  The locale for which a <code>GenderInfo</code> object is
0056      *                returned.
0057      * @param status  Output param set to success/failure code on exit, which
0058      *                must not indicate a failure before the function call.
0059      * @return        The predefined <code>GenderInfo</code> object pointer for
0060      *                this locale. The returned object is immutable, so it is
0061      *                declared as const. Caller does not own the returned
0062      *                pointer, so it must not attempt to free it.
0063      * @stable ICU 50
0064      */
0065     static const GenderInfo* U_EXPORT2 getInstance(const Locale& locale, UErrorCode& status);
0066 
0067     /**
0068      * Determines the gender of a list as a whole given the gender of each
0069      * of the elements.
0070      * 
0071      * @param genders the gender of each element in the list.
0072      * @param length the length of gender array.
0073      * @param status  Output param set to success/failure code on exit, which
0074      *                must not indicate a failure before the function call.
0075      * @return        the gender of the whole list.
0076      * @stable ICU 50
0077      */
0078     UGender getListGender(const UGender* genders, int32_t length, UErrorCode& status) const;
0079 
0080     /**
0081      * Destructor.
0082      *
0083      * @stable ICU 50
0084      */
0085     virtual ~GenderInfo();
0086 
0087 private:
0088     int32_t _style;
0089 
0090     /**
0091      * Copy constructor. One object per locale invariant. Clients
0092      * must never copy GenderInfo objects.
0093      */
0094     GenderInfo(const GenderInfo& other) = delete;
0095 
0096     /**
0097       * Assignment operator. Not applicable to immutable objects.
0098       */
0099     GenderInfo& operator=(const GenderInfo&) = delete;
0100 
0101     GenderInfo();
0102 
0103     static const GenderInfo* getNeutralInstance();
0104 
0105     static const GenderInfo* getMixedNeutralInstance();
0106 
0107     static const GenderInfo* getMaleTaintsInstance();
0108 
0109     static const GenderInfo* loadInstance(const Locale& locale, UErrorCode& status);
0110 
0111     friend class ::GenderInfoTest;
0112     friend void U_CALLCONV GenderInfo_initCache(UErrorCode &status);
0113 };
0114 
0115 U_NAMESPACE_END
0116 
0117 #endif /* #if !UCONFIG_NO_FORMATTING */
0118 
0119 #endif /* U_SHOW_CPLUSPLUS_API */
0120 
0121 #endif // _GENDER
0122 //eof