Issue #1971 - Part 2: Update ICU source to 63.2.

This commit is contained in:
Job Bautista 2022-07-24 21:03:27 +08:00 committed by roytam1
commit 1e69214382
3160 changed files with 275815 additions and 234203 deletions

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: n2builder.h
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
@ -24,20 +24,16 @@
#if !UCONFIG_NO_NORMALIZATION
#include "unicode/errorcode.h"
#include "unicode/umutablecptrie.h"
#include "unicode/unistr.h"
#include "normalizer2impl.h" // for IX_COUNT
#include "toolutil.h"
#include "utrie2.h"
#include "norms.h"
U_NAMESPACE_BEGIN
extern UBool beVerbose, haveCopyright;
struct Norm;
class BuilderReorderingBuffer;
class ExtraDataWriter;
class Normalizer2DataBuilder {
public:
Normalizer2DataBuilder(UErrorCode &errorCode);
@ -67,44 +63,43 @@ public:
void writeBinaryFile(const char *filename);
void writeCSourceFile(const char *filename);
void writeDataFile(const char *filename, bool writeRemoved) const;
static void computeDiff(const Normalizer2DataBuilder &b1,
const Normalizer2DataBuilder &b2,
Normalizer2DataBuilder &diff);
private:
friend class CompositionBuilder;
friend class Decomposer;
friend class ExtraDataWriter;
friend class Norm16Writer;
// No copy constructor nor assignment operator.
Normalizer2DataBuilder(const Normalizer2DataBuilder &other);
Normalizer2DataBuilder &operator=(const Normalizer2DataBuilder &other);
Normalizer2DataBuilder(const Normalizer2DataBuilder &other) = delete;
Normalizer2DataBuilder &operator=(const Normalizer2DataBuilder &other) = delete;
Norm *allocNorm();
Norm *getNorm(UChar32 c);
Norm *createNorm(UChar32 c);
Norm *checkNormForMapping(Norm *p, UChar32 c); // check for permitted overrides
const Norm &getNormRef(UChar32 c) const;
uint8_t getCC(UChar32 c) const;
UBool combinesWithCCBetween(const Norm &norm, uint8_t lowCC, uint8_t highCC) const;
UChar32 combine(const Norm &norm, UChar32 trail) const;
/**
* A starter character with a mapping does not have a composition boundary after it
* if the character itself combines-forward (which is tested by the caller of this function),
* or it is deleted (mapped to the empty string),
* or its mapping contains no starter,
* or the last starter combines-forward.
*/
UBool mappingHasCompBoundaryAfter(const BuilderReorderingBuffer &buffer,
Norm::MappingType mappingType) const;
/** Returns TRUE if the mapping by itself recomposes, that is, it is not comp-normalized. */
UBool mappingRecomposes(const BuilderReorderingBuffer &buffer) const;
void postProcess(Norm &norm);
void addComposition(UChar32 start, UChar32 end, uint32_t value);
UBool decompose(UChar32 start, UChar32 end, uint32_t value);
void reorder(Norm *p, BuilderReorderingBuffer &buffer);
UBool hasNoCompBoundaryAfter(BuilderReorderingBuffer &buffer);
void setHangulData();
int32_t writeMapping(UChar32 c, const Norm *p, UnicodeString &dataString);
void writeCompositions(UChar32 c, const Norm *p, UnicodeString &dataString);
void writeExtraData(UChar32 c, uint32_t value, ExtraDataWriter &writer);
int32_t getCenterNoNoDelta() {
return indexes[Normalizer2Impl::IX_MIN_MAYBE_YES]-Normalizer2Impl::MAX_DELTA-1;
void setSmallFCD(UChar32 c);
int32_t getMinNoNoDelta() const {
return indexes[Normalizer2Impl::IX_MIN_MAYBE_YES]-
((2*Normalizer2Impl::MAX_DELTA+1)<<Normalizer2Impl::DELTA_SHIFT);
}
void writeNorm16(UChar32 start, UChar32 end, uint32_t value);
void processData();
void writeNorm16(UMutableCPTrie *norm16Trie, UChar32 start, UChar32 end, Norm &norm);
void setHangulData(UMutableCPTrie *norm16Trie);
LocalUCPTriePointer processData();
UTrie2 *normTrie;
UToolMemory *normMem;
Norm *norms;
Norms norms;
int32_t phase;
OverrideHandling overrideHandling;
@ -112,7 +107,7 @@ private:
Optimization optimization;
int32_t indexes[Normalizer2Impl::IX_COUNT];
UTrie2 *norm16Trie;
uint8_t *norm16TrieBytes;
int32_t norm16TrieLength;
UnicodeString extraData;
uint8_t smallFCD[0x100];