Logo Search packages:      
Sourcecode: icu version File versions

UnicodeString TransliteratorIDParser::parseBasicID ( const UnicodeString id,
int32_t &  pos 
) [static]

Parse a basic ID from the given string. A basic ID contains only a single source, target, and variant. It does not contain a filter or an explicit inverse.

Parameters:
id the id to be parsed
pos INPUT-OUTPUT parameter. On input, the position of the first character to parse. On output, the position after the last character parsed. If the parse fails pos[0] will be unchanged.
Returns:
the parsed ID in canonical format, or null on parse failure. If the parsed ID did not contain a source, the return ID will not.
Parse a basic ID from the given string. A basic ID contains only a single source, target, and variant. It does not contain a filter or an explicit inverse.
Parameters:
id the id to be parsed
pos INPUT-OUTPUT parameter. On input, the position of the first character to parse. On output, the position after the last character parsed. If the parse fails pos will be unchanged.
Returns:
the parsed ID in canonical format, or NULL on parse failure. If the parsed ID did not contain a source, the return ID will not.

Definition at line 101 of file tridpars.cpp.

References UnicodeString::append(), UnicodeString::length(), NULL, parseFilterID(), TransliteratorIDParser::Specs::sawSource, TransliteratorIDParser::Specs::source, TransliteratorIDParser::Specs::target, and TransliteratorIDParser::Specs::variant.

Referenced by RuleHalf::parseSection().

                                                                                        {
    Specs* specs = parseFilterID(id, pos, FALSE);
    if (specs != NULL) {
        UnicodeString buf;
        if (specs->sawSource) {
            buf.append(specs->source);
            buf.append(TARGET_SEP);
        }
        buf.append(specs->target);
        if (specs->variant.length() != 0) {
            buf.append(VARIANT_SEP);
            buf.append(specs->variant);
        }
        delete specs;
        return buf;
    }
    return EMPTY;
}


Generated by  Doxygen 1.6.0   Back to index