1 /* 2 ****************************************************************************** 3 * 4 * Copyright (C) 2008-2009, International Business Machines 5 * Corporation and others. All Rights Reserved. 6 * 7 ****************************************************************************** 8 * file name: uspoof_buildwsconf.h 9 * encoding: US-ASCII 10 * tab size: 8 (not used) 11 * indentation:4 12 * 13 * created on: 2009Jan19 14 * created by: Andy Heninger 15 * 16 * Internal classes and functions 17 * for compiling whole script confusable data into its binary (runtime) form. 18 */ 19 20 #ifndef __USPOOF_BUILDWSCONF_H__ 21 #define __USPOOF_BUILDWSCONF_H__ 22 23 #include "unicode/utypes.h" 24 25 #if !UCONFIG_NO_NORMALIZATION 26 27 #if !UCONFIG_NO_REGULAR_EXPRESSIONS 28 29 #include "uspoof_impl.h" 30 #include "utrie2.h" 31 32 33 U_NAMESPACE_BEGIN 34 35 // 36 // class BuilderScriptSet. Represents the set of scripts (Script Codes) 37 // containing characters that are confusable with one specific 38 // code point. 39 // 40 41 class BuilderScriptSet: public UMemory { 42 public: 43 UChar32 codePoint; // The source code point. 44 UTrie2 *trie; // Any-case or Lower-case Trie. 45 // These Trie tables are the final result of the 46 // build. This flag indicates which of the two 47 // this set of data is for. 48 ScriptSet *sset; // The set of scripts itself. 49 50 // Vectors of all B 51 uint32_t index; // Index of this set in the Build Time vector 52 // of script sets. 53 uint32_t rindex; // Index of this set in the final (runtime) 54 // array of sets. 55 UBool scriptSetOwned; // True if this BuilderScriptSet owns (should delete) 56 // its underlying sset. 57 58 BuilderScriptSet(); 59 ~BuilderScriptSet(); 60 }; 61 62 U_NAMESPACE_END 63 64 void buildWSConfusableData(SpoofImpl *spImpl, const char * confusablesWS, 65 int32_t confusablesWSLen, UParseError *pe, UErrorCode &status); 66 67 68 #endif // !UCONFIG_NO_REGULAR_EXPRESSIONS 69 #endif // !UCONFIG_NO_NORMALIZATION 70 #endif 71