diff options
author | neksard <neksard@yandex-team.ru> | 2022-02-10 16:45:33 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:33 +0300 |
commit | 1d9c550e7c38e051d7961f576013a482003a70d9 (patch) | |
tree | b2cc84ee7850122e7ccf51d0ea21e4fa7e7a5685 /contrib/libs/icu/i18n/scriptset.h | |
parent | 8f7cf138264e0caa318144bf8a2c950e0b0a8593 (diff) | |
download | ydb-1d9c550e7c38e051d7961f576013a482003a70d9.tar.gz |
Restoring authorship annotation for <neksard@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/icu/i18n/scriptset.h')
-rw-r--r-- | contrib/libs/icu/i18n/scriptset.h | 162 |
1 files changed, 81 insertions, 81 deletions
diff --git a/contrib/libs/icu/i18n/scriptset.h b/contrib/libs/icu/i18n/scriptset.h index 8033514d34..a41ab737a6 100644 --- a/contrib/libs/icu/i18n/scriptset.h +++ b/contrib/libs/icu/i18n/scriptset.h @@ -1,86 +1,86 @@ // © 2016 and later: Unicode, Inc. and others. -// License & terms of use: http://www.unicode.org/copyright.html -/* -********************************************************************** -* Copyright (C) 2013, International Business Machines -* Corporation and others. All Rights Reserved. -********************************************************************** -* -* scriptset.h -* -* created on: 2013 Jan 7 -* created by: Andy Heninger -*/ - -#ifndef __SCRIPTSET_H__ -#define __SCRIPTSET_H__ - -#include "unicode/utypes.h" -#include "unicode/uobject.h" -#include "unicode/uscript.h" - -#include "uelement.h" - -U_NAMESPACE_BEGIN - -//------------------------------------------------------------------------------- -// -// ScriptSet - A bit set representing a set of scripts. -// -// This class was originally used exclusively with script sets appearing -// as part of the spoof check whole script confusable binary data. Its -// use has since become more general, but the continued use to wrap -// prebuilt binary data does constrain the design. -// -//------------------------------------------------------------------------------- -class U_I18N_API ScriptSet: public UMemory { - public: +// License & terms of use: http://www.unicode.org/copyright.html +/* +********************************************************************** +* Copyright (C) 2013, International Business Machines +* Corporation and others. All Rights Reserved. +********************************************************************** +* +* scriptset.h +* +* created on: 2013 Jan 7 +* created by: Andy Heninger +*/ + +#ifndef __SCRIPTSET_H__ +#define __SCRIPTSET_H__ + +#include "unicode/utypes.h" +#include "unicode/uobject.h" +#include "unicode/uscript.h" + +#include "uelement.h" + +U_NAMESPACE_BEGIN + +//------------------------------------------------------------------------------- +// +// ScriptSet - A bit set representing a set of scripts. +// +// This class was originally used exclusively with script sets appearing +// as part of the spoof check whole script confusable binary data. Its +// use has since become more general, but the continued use to wrap +// prebuilt binary data does constrain the design. +// +//------------------------------------------------------------------------------- +class U_I18N_API ScriptSet: public UMemory { + public: static constexpr int32_t SCRIPT_LIMIT = 224; // multiple of 32! - ScriptSet(); - ScriptSet(const ScriptSet &other); - ~ScriptSet(); - - UBool operator == (const ScriptSet &other) const; + ScriptSet(); + ScriptSet(const ScriptSet &other); + ~ScriptSet(); + + UBool operator == (const ScriptSet &other) const; UBool operator != (const ScriptSet &other) const {return !(*this == other);} - ScriptSet & operator = (const ScriptSet &other); - - UBool test(UScriptCode script, UErrorCode &status) const; - ScriptSet &Union(const ScriptSet &other); - ScriptSet &set(UScriptCode script, UErrorCode &status); - ScriptSet &reset(UScriptCode script, UErrorCode &status); - ScriptSet &intersect(const ScriptSet &other); - ScriptSet &intersect(UScriptCode script, UErrorCode &status); - UBool intersects(const ScriptSet &other) const; // Sets contain at least one script in commmon. - UBool contains(const ScriptSet &other) const; // All set bits in other are also set in this. - - ScriptSet &setAll(); - ScriptSet &resetAll(); - int32_t countMembers() const; - int32_t hashCode() const; - int32_t nextSetBit(int32_t script) const; - - UBool isEmpty() const; - - UnicodeString &displayScripts(UnicodeString &dest) const; // append script names to dest string. - ScriptSet & parseScripts(const UnicodeString &scriptsString, UErrorCode &status); // Replaces ScriptSet contents. - - // Wraps around UScript::getScriptExtensions() and adds the corresponding scripts to this instance. - void setScriptExtensions(UChar32 codePoint, UErrorCode& status); - - private: + ScriptSet & operator = (const ScriptSet &other); + + UBool test(UScriptCode script, UErrorCode &status) const; + ScriptSet &Union(const ScriptSet &other); + ScriptSet &set(UScriptCode script, UErrorCode &status); + ScriptSet &reset(UScriptCode script, UErrorCode &status); + ScriptSet &intersect(const ScriptSet &other); + ScriptSet &intersect(UScriptCode script, UErrorCode &status); + UBool intersects(const ScriptSet &other) const; // Sets contain at least one script in commmon. + UBool contains(const ScriptSet &other) const; // All set bits in other are also set in this. + + ScriptSet &setAll(); + ScriptSet &resetAll(); + int32_t countMembers() const; + int32_t hashCode() const; + int32_t nextSetBit(int32_t script) const; + + UBool isEmpty() const; + + UnicodeString &displayScripts(UnicodeString &dest) const; // append script names to dest string. + ScriptSet & parseScripts(const UnicodeString &scriptsString, UErrorCode &status); // Replaces ScriptSet contents. + + // Wraps around UScript::getScriptExtensions() and adds the corresponding scripts to this instance. + void setScriptExtensions(UChar32 codePoint, UErrorCode& status); + + private: uint32_t bits[SCRIPT_LIMIT / 32]; -}; - -U_NAMESPACE_END - -U_CAPI UBool U_EXPORT2 -uhash_compareScriptSet(const UElement key1, const UElement key2); - -U_CAPI int32_t U_EXPORT2 -uhash_hashScriptSet(const UElement key); - -U_CAPI void U_EXPORT2 -uhash_deleteScriptSet(void *obj); - -#endif // __SCRIPTSET_H__ +}; + +U_NAMESPACE_END + +U_CAPI UBool U_EXPORT2 +uhash_compareScriptSet(const UElement key1, const UElement key2); + +U_CAPI int32_t U_EXPORT2 +uhash_hashScriptSet(const UElement key); + +U_CAPI void U_EXPORT2 +uhash_deleteScriptSet(void *obj); + +#endif // __SCRIPTSET_H__ |