// © 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: patternprops.cpp * encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * * created on: 2011mar13 * created by: Markus W. Scherer */ #include "unicode/utypes.h" #include "patternprops.h" U_NAMESPACE_BEGIN /* * One byte per Latin-1 character. * Bit 0 is set if either Pattern property is true, * bit 1 if Pattern_Syntax is true, * bit 2 if Pattern_White_Space is true. * That is, Pattern_Syntax is encoded as 3 and Pattern_White_Space as 5. */ static const uint8_t latin1[256]= …; /* * One byte per 32 characters from U+2000..U+303F indexing into * a small table of 32-bit data words. * The first two data words are all-zeros and all-ones. */ static const uint8_t index2000[130]= …; /* * One 32-bit integer per 32 characters. Ranges of all-false and all-true * are mapped to the first two values, other ranges map to appropriate bit patterns. */ static const uint32_t syntax2000[]= …; /* * Same as syntax2000, but with additional bits set for the * Pattern_White_Space characters 200E 200F 2028 2029. */ static const uint32_t syntaxOrWhiteSpace2000[]= …; UBool PatternProps::isSyntax(UChar32 c) { … } UBool PatternProps::isSyntaxOrWhiteSpace(UChar32 c) { … } UBool PatternProps::isWhiteSpace(UChar32 c) { … } const char16_t * PatternProps::skipWhiteSpace(const char16_t *s, int32_t length) { … } int32_t PatternProps::skipWhiteSpace(const UnicodeString& s, int32_t start) { … } const char16_t * PatternProps::trimWhiteSpace(const char16_t *s, int32_t &length) { … } UBool PatternProps::isIdentifier(const char16_t *s, int32_t length) { … } const char16_t * PatternProps::skipIdentifier(const char16_t *s, int32_t length) { … } U_NAMESPACE_END