intl/icu/source/i18n/unicode/gender.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/intl/icu/source/i18n/unicode/gender.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,111 @@
     1.4 +/*
     1.5 +*******************************************************************************
     1.6 +* Copyright (C) 2008-2013, International Business Machines Corporation and
     1.7 +* others. All Rights Reserved.
     1.8 +*******************************************************************************
     1.9 +*
    1.10 +*
    1.11 +* File GENDER.H
    1.12 +*
    1.13 +* Modification History:*
    1.14 +*   Date        Name        Description
    1.15 +*
    1.16 +********************************************************************************
    1.17 +*/
    1.18 +
    1.19 +#ifndef _GENDER
    1.20 +#define _GENDER
    1.21 +
    1.22 +#include "unicode/utypes.h"
    1.23 +
    1.24 +#if !UCONFIG_NO_FORMATTING
    1.25 +
    1.26 +#include "unicode/locid.h"
    1.27 +#include "unicode/ugender.h"
    1.28 +#include "unicode/uobject.h"
    1.29 +
    1.30 +class GenderInfoTest;
    1.31 +
    1.32 +U_NAMESPACE_BEGIN
    1.33 +
    1.34 +// Forward Declaration
    1.35 +void GenderInfo_initCache(UErrorCode &status);
    1.36 +
    1.37 +/**
    1.38 + * GenderInfo computes the gender of a list as a whole given the gender of
    1.39 + * each element.
    1.40 + * @stable ICU 50
    1.41 + */
    1.42 +class U_I18N_API GenderInfo : public UObject {
    1.43 +public:
    1.44 +
    1.45 +    /**
    1.46 +     * Provides access to the predefined GenderInfo object for a given
    1.47 +     * locale.
    1.48 +     *
    1.49 +     * @param locale  The locale for which a <code>GenderInfo</code> object is
    1.50 +     *                returned.
    1.51 +     * @param status  Output param set to success/failure code on exit, which
    1.52 +     *                must not indicate a failure before the function call.
    1.53 +     * @return        The predefined <code>GenderInfo</code> object pointer for
    1.54 +     *                this locale. The returned object is immutable, so it is
    1.55 +     *                declared as const. Caller does not own the returned
    1.56 +     *                pointer, so it must not attempt to free it.
    1.57 +     * @stable ICU 50
    1.58 +     */
    1.59 +    static const GenderInfo* U_EXPORT2 getInstance(const Locale& locale, UErrorCode& status);
    1.60 +
    1.61 +    /**
    1.62 +     * Determines the gender of a list as a whole given the gender of each
    1.63 +     * of the elements.
    1.64 +     * 
    1.65 +     * @param genders the gender of each element in the list.
    1.66 +     * @param length the length of gender array.
    1.67 +     * @param status  Output param set to success/failure code on exit, which
    1.68 +     *                must not indicate a failure before the function call.
    1.69 +     * @return        the gender of the whole list.
    1.70 +     * @stable ICU 50
    1.71 +     */
    1.72 +    UGender getListGender(const UGender* genders, int32_t length, UErrorCode& status) const;
    1.73 +
    1.74 +    /**
    1.75 +     * Destructor.
    1.76 +     *
    1.77 +     * @stable ICU 50
    1.78 +     */
    1.79 +    virtual ~GenderInfo();
    1.80 +
    1.81 +private:
    1.82 +    int32_t _style;
    1.83 +
    1.84 +    /**
    1.85 +     * Copy constructor. One object per locale invariant. Clients
    1.86 +     * must never copy GenderInfo objects.
    1.87 +     */
    1.88 +    GenderInfo(const GenderInfo& other);
    1.89 +
    1.90 +    /**
    1.91 +      * Assignment operator. Not applicable to immutable objects.
    1.92 +      */
    1.93 +    GenderInfo& operator=(const GenderInfo&);
    1.94 +
    1.95 +    GenderInfo();
    1.96 +
    1.97 +    static const GenderInfo* getNeutralInstance();
    1.98 +
    1.99 +    static const GenderInfo* getMixedNeutralInstance();
   1.100 +
   1.101 +    static const GenderInfo* getMaleTaintsInstance();
   1.102 +
   1.103 +    static const GenderInfo* loadInstance(const Locale& locale, UErrorCode& status);
   1.104 +
   1.105 +    friend class ::GenderInfoTest;
   1.106 +    friend void GenderInfo_initCache(UErrorCode &status);
   1.107 +};
   1.108 +
   1.109 +U_NAMESPACE_END
   1.110 +
   1.111 +#endif /* #if !UCONFIG_NO_FORMATTING */
   1.112 +
   1.113 +#endif // _GENDER
   1.114 +//eof

mercurial