#if !UCONFIG_NO_NORMALIZATION
#include "unicode/normalizer2.h"
-#include "unicode/udata.h"
#include "unicode/unistr.h"
#include "unicode/unorm.h"
#include "unicode/utf16.h"
UChar *codePointStart, *codePointLimit;
};
-class U_COMMON_API Normalizer2Impl : public UMemory {
+class U_COMMON_API Normalizer2Impl : public UObject {
public:
- Normalizer2Impl() : memory(NULL), normTrie(NULL), fCanonIterData(NULL) {
+ Normalizer2Impl() : normTrie(NULL), fCanonIterData(NULL) {
fCanonIterDataInitOnce.reset();
}
- ~Normalizer2Impl();
+ virtual ~Normalizer2Impl();
- void load(const char *packageName, const char *name, UErrorCode &errorCode);
+ void init(const int32_t *inIndexes, const UTrie2 *inTrie,
+ const uint16_t *inExtraData, const uint8_t *inSmallFCD);
void addLcccChars(UnicodeSet &set) const;
void addPropertyStarts(const USetAdder *sa, UErrorCode &errorCode) const;
}
UBool isFCDInert(UChar32 c) const { return getFCD16(c)<=1; }
private:
- static UBool U_CALLCONV
- isAcceptable(void *context, const char *type, const char *name, const UDataInfo *pInfo);
-
UBool isMaybe(uint16_t norm16) const { return minMaybeYes<=norm16 && norm16<=JAMO_VT; }
UBool isMaybeOrNonZeroCC(uint16_t norm16) const { return norm16>=minMaybeYes; }
static UBool isInert(uint16_t norm16) { return norm16==0; }
int32_t getCanonValue(UChar32 c) const;
const UnicodeSet &getCanonStartSet(int32_t n) const;
- UDataMemory *memory;
- UVersionInfo dataVersion;
+ // UVersionInfo dataVersion;
// Code point thresholds for quick check codes.
UChar32 minDecompNoCP;
uint16_t limitNoNo;
uint16_t minMaybeYes;
- UTrie2 *normTrie;
+ const UTrie2 *normTrie;
const uint16_t *maybeYesCompositions;
const uint16_t *extraData; // mappings and/or compositions for yesYes, yesNo & noNo characters
const uint8_t *smallFCD; // [0x100] one bit per 32 BMP code points, set if any FCD!=0
uint8_t tccc180[0x180]; // tccc values for U+0000..U+017F
- public: // CanonIterData is public to allow access from C callback functions.
+public: // CanonIterData is public to allow access from C callback functions.
UInitOnce fCanonIterDataInitOnce;
CanonIterData *fCanonIterData;
};
*/
class U_COMMON_API Normalizer2Factory {
public:
- static const Normalizer2 *getNFCInstance(UErrorCode &errorCode);
- static const Normalizer2 *getNFDInstance(UErrorCode &errorCode);
static const Normalizer2 *getFCDInstance(UErrorCode &errorCode);
static const Normalizer2 *getFCCInstance(UErrorCode &errorCode);
- static const Normalizer2 *getNFKCInstance(UErrorCode &errorCode);
- static const Normalizer2 *getNFKDInstance(UErrorCode &errorCode);
- static const Normalizer2 *getNFKC_CFInstance(UErrorCode &errorCode);
static const Normalizer2 *getNoopInstance(UErrorCode &errorCode);
static const Normalizer2 *getInstance(UNormalizationMode mode, UErrorCode &errorCode);