]>
git.saurik.com Git - apple/icu.git/blob - icuSources/i18n/scriptset.h
2 **********************************************************************
3 * Copyright (C) 2013, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
9 * created on: 2013 Jan 7
10 * created by: Andy Heninger
13 #ifndef __SCRIPTSET_H__
14 #define __SCRIPTSET_H__
16 #include "unicode/utypes.h"
17 #include "unicode/uobject.h"
18 #include "unicode/uscript.h"
24 //-------------------------------------------------------------------------------
26 // ScriptSet - A bit set representing a set of scripts.
28 // This class was originally used exclusively with script sets appearing
29 // as part of the spoof check whole script confusable binary data. Its
30 // use has since become more general, but the continued use to wrap
31 // prebuilt binary data does constrain the design.
33 //-------------------------------------------------------------------------------
34 class U_I18N_API ScriptSet
: public UMemory
{
37 ScriptSet(const ScriptSet
&other
);
40 UBool
operator == (const ScriptSet
&other
) const;
41 ScriptSet
& operator = (const ScriptSet
&other
);
43 UBool
test(UScriptCode script
, UErrorCode
&status
) const;
44 ScriptSet
&Union(const ScriptSet
&other
);
45 ScriptSet
&set(UScriptCode script
, UErrorCode
&status
);
46 ScriptSet
&reset(UScriptCode script
, UErrorCode
&status
);
47 ScriptSet
&intersect(const ScriptSet
&other
);
48 ScriptSet
&intersect(UScriptCode script
, UErrorCode
&status
);
49 UBool
intersects(const ScriptSet
&other
) const; // Sets contain at least one script in commmon.
50 UBool
contains(const ScriptSet
&other
) const; // All set bits in other are also set in this.
53 ScriptSet
&resetAll();
54 int32_t countMembers() const;
55 int32_t hashCode() const;
56 int32_t nextSetBit(int32_t script
) const;
58 UnicodeString
&displayScripts(UnicodeString
&dest
) const; // append script names to dest string.
59 ScriptSet
& parseScripts(const UnicodeString
&scriptsString
, UErrorCode
&status
); // Replaces ScriptSet contents.
67 U_CAPI UBool U_EXPORT2
68 uhash_compareScriptSet(const UElement key1
, const UElement key2
);
70 U_CAPI
int32_t U_EXPORT2
71 uhash_hashScriptSet(const UElement key
);
74 uhash_deleteScriptSet(void *obj
);
76 #endif // __SCRIPTSET_H__