| 1 |
. |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
#ifndef __SCRIPTSET_H__ |
| 16 |
#define __SCRIPTSET_H__ |
| 17 |
|
| 18 |
#include "unicode/utypes.h" |
| 19 |
#include "unicode/uobject.h" |
| 20 |
#include "unicode/uscript.h" |
| 21 |
|
| 22 |
#include "uelement.h" |
| 23 |
|
| 24 |
U_NAMESPACE_BEGIN |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
class U_I18N_API ScriptSet: public UMemory { |
| 37 |
public: |
| 38 |
static constexpr int32_t SCRIPT_LIMIT = 224; |
| 39 |
|
| 40 |
ScriptSet(); |
| 41 |
ScriptSet(const ScriptSet &other); |
| 42 |
~ScriptSet(); |
| 43 |
|
| 44 |
bool operator == (const ScriptSet &other) const; |
| 45 |
bool operator != (const ScriptSet &other) const {return !(*this == other);} |
| 46 |
ScriptSet & operator = (const ScriptSet &other); |
| 47 |
|
| 48 |
UBool test(UScriptCode script, UErrorCode &status) const; |
| 49 |
ScriptSet &Union(const ScriptSet &other); |
| 50 |
ScriptSet &set(UScriptCode script, UErrorCode &status); |
| 51 |
ScriptSet &reset(UScriptCode script, UErrorCode &status); |
| 52 |
ScriptSet &intersect(const ScriptSet &other); |
| 53 |
ScriptSet &intersect(UScriptCode script, UErrorCode &status); |
| 54 |
UBool intersects(const ScriptSet &other) const; |
| 55 |
UBool contains(const ScriptSet &other) const; |
| 56 |
|
| 57 |
ScriptSet &setAll(); |
| 58 |
ScriptSet &resetAll(); |
| 59 |
int32_t countMembers() const; |
| 60 |
int32_t hashCode() const; |
| 61 |
int32_t nextSetBit(int32_t script) const; |
| 62 |
|
| 63 |
UBool isEmpty() const; |
| 64 |
|
| 65 |
UnicodeString &displayScripts(UnicodeString &dest) const; |
| 66 |
ScriptSet & parseScripts(const UnicodeString &scriptsString, UErrorCode &status); |
| 67 |
|
| 68 |
|
| 69 |
void setScriptExtensions(UChar32 codePoint, UErrorCode& status); |
| 70 |
|
| 71 |
private: |
| 72 |
uint32_t bits[SCRIPT_LIMIT / 32]; |
| 73 |
}; |
| 74 |
|
| 75 |
U_NAMESPACE_END |
| 76 |
|
| 77 |
U_CAPI int32_t U_EXPORT2 |
| 78 |
uhash_compareScriptSet(const UElement key1, const UElement key2); |
| 79 |
|
| 80 |
U_CAPI int32_t U_EXPORT2 |
| 81 |
uhash_hashScriptSet(const UElement key); |
| 82 |
|
| 83 |
U_CAPI void U_EXPORT2 |
| 84 |
uhash_deleteScriptSet(void *obj); |
| 85 |
|
| 86 |
U_CAPI UBool U_EXPORT2 |
| 87 |
uhash_equalsScriptSet(const UElement key1, const UElement key2); |
| 88 |
|
| 89 |
#endif |