2009-03-09 23:40:15 +00:00
|
|
|
/*
|
|
|
|
******************************************************************************
|
|
|
|
*
|
2012-01-20 20:46:08 +00:00
|
|
|
* Copyright (C) 2008-2012, International Business Machines
|
2009-03-09 23:40:15 +00:00
|
|
|
* Corporation and others. All Rights Reserved.
|
|
|
|
*
|
|
|
|
******************************************************************************
|
|
|
|
* file name: uspoof_buildwsconf.h
|
|
|
|
* encoding: US-ASCII
|
|
|
|
* tab size: 8 (not used)
|
|
|
|
* indentation:4
|
|
|
|
*
|
|
|
|
* created on: 2009Jan19
|
|
|
|
* created by: Andy Heninger
|
|
|
|
*
|
|
|
|
* Internal classes and functions
|
|
|
|
* for compiling whole script confusable data into its binary (runtime) form.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __USPOOF_BUILDWSCONF_H__
|
|
|
|
#define __USPOOF_BUILDWSCONF_H__
|
|
|
|
|
2009-05-04 05:45:27 +00:00
|
|
|
#include "unicode/utypes.h"
|
|
|
|
|
2009-05-05 02:03:27 +00:00
|
|
|
#if !UCONFIG_NO_NORMALIZATION
|
|
|
|
|
2009-05-04 05:45:27 +00:00
|
|
|
#if !UCONFIG_NO_REGULAR_EXPRESSIONS
|
|
|
|
|
2009-03-09 23:40:15 +00:00
|
|
|
#include "uspoof_impl.h"
|
|
|
|
#include "utrie2.h"
|
|
|
|
|
2009-10-01 22:52:39 +00:00
|
|
|
|
|
|
|
U_NAMESPACE_BEGIN
|
|
|
|
|
2009-03-09 23:40:15 +00:00
|
|
|
//
|
|
|
|
// class BuilderScriptSet. Represents the set of scripts (Script Codes)
|
|
|
|
// containing characters that are confusable with one specific
|
|
|
|
// code point.
|
|
|
|
//
|
2009-10-01 22:52:39 +00:00
|
|
|
|
2009-03-09 23:40:15 +00:00
|
|
|
class BuilderScriptSet: public UMemory {
|
|
|
|
public:
|
|
|
|
UChar32 codePoint; // The source code point.
|
|
|
|
UTrie2 *trie; // Any-case or Lower-case Trie.
|
|
|
|
// These Trie tables are the final result of the
|
|
|
|
// build. This flag indicates which of the two
|
|
|
|
// this set of data is for.
|
|
|
|
ScriptSet *sset; // The set of scripts itself.
|
|
|
|
|
|
|
|
// Vectors of all B
|
|
|
|
uint32_t index; // Index of this set in the Build Time vector
|
|
|
|
// of script sets.
|
|
|
|
uint32_t rindex; // Index of this set in the final (runtime)
|
|
|
|
// array of sets.
|
|
|
|
UBool scriptSetOwned; // True if this BuilderScriptSet owns (should delete)
|
|
|
|
// its underlying sset.
|
|
|
|
|
|
|
|
BuilderScriptSet();
|
|
|
|
~BuilderScriptSet();
|
|
|
|
};
|
|
|
|
|
2009-10-01 22:52:39 +00:00
|
|
|
|
2009-03-09 23:40:15 +00:00
|
|
|
void buildWSConfusableData(SpoofImpl *spImpl, const char * confusablesWS,
|
|
|
|
int32_t confusablesWSLen, UParseError *pe, UErrorCode &status);
|
|
|
|
|
2012-01-20 20:46:08 +00:00
|
|
|
U_NAMESPACE_END
|
2009-03-09 23:40:15 +00:00
|
|
|
|
2009-05-04 05:45:27 +00:00
|
|
|
#endif // !UCONFIG_NO_REGULAR_EXPRESSIONS
|
2009-05-05 03:02:02 +00:00
|
|
|
#endif // !UCONFIG_NO_NORMALIZATION
|
2009-05-05 02:03:27 +00:00
|
|
|
#endif
|