'Parse a single line, respecting to the VCard (RFC6350) quoting.
>>> VCardLine.ParseLine(\'foo:val;ue\')
(u\'foo\', [], u\'val;ue\')
>>> VCardLine.ParseLine(\'foo;BAR;\\baz:value\')
(u\'foo\', [(u\'bar\', None), (u\'\\baz\', None)], u\'value\')
>>> VCardLine.ParseLine(\'FOO;bar=comma\,semicolon\;\'
...                     \'backslash\\\\:value\')
(u\'foo\', [(u\'bar\', u\'comma,semicolon;backslash\\\')], u\'value\')'

@classmethod
def ParseLine(self, text):

    def parse_quoted(char, state, parsed, name, attrs):
        pair = ('\\' + char)
        parsed = (parsed[:(-1)] + self.QUOTE_RMAP.get(pair, pair))
        return (parse_char, state, parsed, name, attrs)
    def parse_char(char, state, parsed, name, attrs):
        if (char == '\\'):
            parsed += char
            return (parse_quoted, state, parsed, name, attrs)
        else:
            if ((state == 0) and (char in (';', ':'))):
                name = parsed.lower()
                parsed = ''
                state += (((char == ';') and 1) or 2)
            elif ((state == 1) and (char in (';', ':'))):
                if ('=' in parsed):
                    (k, v) = parsed.split('=', 1)
                else:
                    k = parsed
                    v = None
                attrs.append((k.lower(), v))
                parsed = ''
                if (char == ':'):
                    state += 1
            else:
                parsed += char
            return (parse_char, state, parsed, name, attrs)
    (parser, state, parsed, name, attrs) = (parse_char, 0, '', None, [])
    for char in unicode(text):
        (parser, state, parsed, name, attrs) = parser(char, state, parsed, name, attrs)
    return (name, attrs, parsed)
