annotate modules/javafx.web/src/main/native/Source/ThirdParty/icu/source/i18n/scriptset.h @ 11038:20a8447c71c6

8207159: Update ICU to version 62.1 Reviewed-by: mbilla, kcr, ghb
author arajkumar
date Fri, 24 Aug 2018 15:06:40 +0530
parents fee4ef5c87df
children
rev   line source
arajkumar@11038 1 // © 2016 and later: Unicode, Inc. and others.
arajkumar@11038 2 // License & terms of use: http://www.unicode.org/copyright.html
ghb@10550 3 /*
ghb@10550 4 **********************************************************************
ghb@10550 5 * Copyright (C) 2013, International Business Machines
ghb@10550 6 * Corporation and others. All Rights Reserved.
ghb@10550 7 **********************************************************************
ghb@10550 8 *
ghb@10550 9 * scriptset.h
ghb@10550 10 *
ghb@10550 11 * created on: 2013 Jan 7
ghb@10550 12 * created by: Andy Heninger
ghb@10550 13 */
ghb@10550 14
ghb@10550 15 #ifndef __SCRIPTSET_H__
ghb@10550 16 #define __SCRIPTSET_H__
ghb@10550 17
ghb@10550 18 #include "unicode/utypes.h"
ghb@10550 19 #include "unicode/uobject.h"
ghb@10550 20 #include "unicode/uscript.h"
ghb@10550 21
ghb@10550 22 #include "uelement.h"
ghb@10550 23
ghb@10550 24 U_NAMESPACE_BEGIN
ghb@10550 25
ghb@10550 26 //-------------------------------------------------------------------------------
ghb@10550 27 //
ghb@10550 28 // ScriptSet - A bit set representing a set of scripts.
ghb@10550 29 //
ghb@10550 30 // This class was originally used exclusively with script sets appearing
ghb@10550 31 // as part of the spoof check whole script confusable binary data. Its
ghb@10550 32 // use has since become more general, but the continued use to wrap
ghb@10550 33 // prebuilt binary data does constrain the design.
ghb@10550 34 //
ghb@10550 35 //-------------------------------------------------------------------------------
ghb@10550 36 class U_I18N_API ScriptSet: public UMemory {
ghb@10550 37 public:
ghb@10550 38 ScriptSet();
ghb@10550 39 ScriptSet(const ScriptSet &other);
ghb@10550 40 ~ScriptSet();
ghb@10550 41
ghb@10550 42 UBool operator == (const ScriptSet &other) const;
arajkumar@11038 43 UBool operator != (const ScriptSet &other) const {return !(*this == other);};
ghb@10550 44 ScriptSet & operator = (const ScriptSet &other);
ghb@10550 45
ghb@10550 46 UBool test(UScriptCode script, UErrorCode &status) const;
ghb@10550 47 ScriptSet &Union(const ScriptSet &other);
ghb@10550 48 ScriptSet &set(UScriptCode script, UErrorCode &status);
ghb@10550 49 ScriptSet &reset(UScriptCode script, UErrorCode &status);
ghb@10550 50 ScriptSet &intersect(const ScriptSet &other);
ghb@10550 51 ScriptSet &intersect(UScriptCode script, UErrorCode &status);
ghb@10550 52 UBool intersects(const ScriptSet &other) const; // Sets contain at least one script in commmon.
ghb@10550 53 UBool contains(const ScriptSet &other) const; // All set bits in other are also set in this.
ghb@10550 54
ghb@10550 55 ScriptSet &setAll();
ghb@10550 56 ScriptSet &resetAll();
ghb@10550 57 int32_t countMembers() const;
ghb@10550 58 int32_t hashCode() const;
ghb@10550 59 int32_t nextSetBit(int32_t script) const;
ghb@10550 60
arajkumar@11038 61 UBool isEmpty() const;
arajkumar@11038 62
ghb@10550 63 UnicodeString &displayScripts(UnicodeString &dest) const; // append script names to dest string.
ghb@10550 64 ScriptSet & parseScripts(const UnicodeString &scriptsString, UErrorCode &status); // Replaces ScriptSet contents.
ghb@10550 65
arajkumar@11038 66 // Wraps around UScript::getScriptExtensions() and adds the corresponding scripts to this instance.
arajkumar@11038 67 void setScriptExtensions(UChar32 codePoint, UErrorCode& status);
arajkumar@11038 68
ghb@10550 69 private:
ghb@10550 70 uint32_t bits[6];
ghb@10550 71 };
ghb@10550 72
ghb@10550 73 U_NAMESPACE_END
ghb@10550 74
ghb@10550 75 U_CAPI UBool U_EXPORT2
ghb@10550 76 uhash_compareScriptSet(const UElement key1, const UElement key2);
ghb@10550 77
ghb@10550 78 U_CAPI int32_t U_EXPORT2
ghb@10550 79 uhash_hashScriptSet(const UElement key);
ghb@10550 80
ghb@10550 81 U_CAPI void U_EXPORT2
ghb@10550 82 uhash_deleteScriptSet(void *obj);
ghb@10550 83
ghb@10550 84 #endif // __SCRIPTSET_H__