Logo Search packages:      
Sourcecode: icu version File versions

int32_t DecimalFormat::match ( const UnicodeString text,
int32_t  pos,
UChar32  ch 
) [static, private]

Match a single character at text[pos] and return the index of the next character upon success. Return -1 on failure. If ch is a Pattern_White_Space then match a run of white space in text.

Definition at line 2574 of file decimfmt.cpp.

References UnicodeString::char32At(), PatternProps::isWhiteSpace(), skipPatternWhiteSpace(), and U16_LENGTH.

Referenced by compareComplexAffix(), compareSimpleAffix(), and match().

                                                                               {
    if (PatternProps::isWhiteSpace(ch)) {
        // Advance over run of white space in input text
        // Must see at least one white space char in input
        int32_t s = pos;
        pos = skipPatternWhiteSpace(text, pos);
        if (pos == s) {
            return -1;
        }
        return pos;
    }
    return (pos >= 0 && text.char32At(pos) == ch) ?
        (pos + U16_LENGTH(ch)) : -1;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index