X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/73c04bcfe1096173b00431f0cdc742894b15eef0..cecc3f9394f261e71def48cf396d137687dbd0a7:/icuSources/common/util_props.cpp diff --git a/icuSources/common/util_props.cpp b/icuSources/common/util_props.cpp index f91666b4..95a112bc 100644 --- a/icuSources/common/util_props.cpp +++ b/icuSources/common/util_props.cpp @@ -1,6 +1,8 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** -* Copyright (c) 2001-2006, International Business Machines +* Copyright (c) 2001-2016, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** * Date Name Description @@ -8,8 +10,10 @@ ********************************************************************** */ -#include "util.h" #include "unicode/uchar.h" +#include "unicode/utf16.h" +#include "patternprops.h" +#include "util.h" U_NAMESPACE_BEGIN @@ -95,10 +99,11 @@ int32_t ICU_Utility::parsePattern(const UnicodeString& rule, int32_t pos, int32_ return -1; } c = rule.charAt(pos++); - if (!uprv_isRuleWhiteSpace(c)) { + if (!PatternProps::isWhiteSpace(c)) { return -1; } // FALL THROUGH to skipWhitespace + U_FALLTHROUGH; case 126 /*'~'*/: pos = skipWhitespace(rule, pos); break; @@ -133,15 +138,13 @@ int32_t ICU_Utility::parsePattern(const UnicodeString& rule, int32_t pos, int32_ * @param pos INPUT-OUPUT parameter. On INPUT, pos is the * first character to examine. It must be less than str.length(), * and it must not point to a whitespace character. That is, must - * have pos < str.length() and - * !uprv_isRuleWhiteSpace(str.char32At(pos)). On + * have pos < str.length(). On * OUTPUT, the position after the last parsed character. * @return the Unicode identifier, or an empty string if there is * no valid identifier at pos. */ UnicodeString ICU_Utility::parseUnicodeIdentifier(const UnicodeString& str, int32_t& pos) { // assert(pos < str.length()); - // assert(!uprv_isRuleWhiteSpace(str.char32At(pos))); UnicodeString buf; int p = pos; while (p < str.length()) { @@ -160,7 +163,7 @@ UnicodeString ICU_Utility::parseUnicodeIdentifier(const UnicodeString& str, int3 break; } } - p += UTF_CHAR_LENGTH(ch); + p += U16_LENGTH(ch); } pos = p; return buf;