// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * * Copyright (C) 2011, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* * file name: uniset_closure.cpp * encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * * created on: 2011may30 * created by: Markus W. Scherer * * UnicodeSet::closeOver() and related methods moved here from uniset_props.cpp * to simplify dependencies. * In particular, this depends on the BreakIterator, but the BreakIterator * code also builds UnicodeSets from patterns and needs uniset_props. */ #include "unicode/brkiter.h" #include "unicode/locid.h" #include "unicode/parsepos.h" #include "unicode/uniset.h" #include "unicode/utf16.h" #include "cmemory.h" #include "ruleiter.h" #include "ucase.h" #include "uprops.h" #include "util.h" #include "uvector.h" U_NAMESPACE_BEGIN // TODO memory debugging provided inside uniset.cpp // could be made available here but probably obsolete with use of modern // memory leak checker tools #define _dbgct(me) … //---------------------------------------------------------------- // Constructors &c //---------------------------------------------------------------- UnicodeSet::UnicodeSet(const UnicodeString& pattern, uint32_t options, const SymbolTable* symbols, UErrorCode& status) { … } UnicodeSet::UnicodeSet(const UnicodeString& pattern, ParsePosition& pos, uint32_t options, const SymbolTable* symbols, UErrorCode& status) { … } //---------------------------------------------------------------- // Public API //---------------------------------------------------------------- UnicodeSet& UnicodeSet::applyPattern(const UnicodeString& pattern, uint32_t options, const SymbolTable* symbols, UErrorCode& status) { … } UnicodeSet& UnicodeSet::applyPattern(const UnicodeString& pattern, ParsePosition& pos, uint32_t options, const SymbolTable* symbols, UErrorCode& status) { … } // USetAdder implementation // Does not use uset.h to reduce code dependencies static void U_CALLCONV _set_add(USet *set, UChar32 c) { … } static void U_CALLCONV _set_addRange(USet *set, UChar32 start, UChar32 end) { … } static void U_CALLCONV _set_addString(USet *set, const char16_t *str, int32_t length) { … } //---------------------------------------------------------------- // Case folding API //---------------------------------------------------------------- // add the result of a full case mapping to the set // use str as a temporary string to avoid constructing one static inline void addCaseMapping(UnicodeSet &set, int32_t result, const char16_t *full, UnicodeString &str) { … } namespace { /** For case closure on a large set, look only at code points with relevant properties. */ const UnicodeSet &maybeOnlyCaseSensitive(const UnicodeSet &src, UnicodeSet &subset) { … } // Per-character scf = Simple_Case_Folding of a string. // (Normally when we case-fold a string we use full case foldings.) bool scfString(const UnicodeString &s, UnicodeString &scf) { … } } // namespace UnicodeSet& UnicodeSet::closeOver(int32_t attribute) { … } void UnicodeSet::closeOverCaseInsensitive(bool simple) { … } void UnicodeSet::closeOverAddCaseMappings() { … } U_NAMESPACE_END