587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
|
if (buf[*i] != '=')
return;
if ((len = *i - *last) > 0)
[cache appendCStringWithoutUTF8Checking: buf + *last
length: len];
cache_c = [cache cString];
cache_len = [cache cStringLength];
if ((tmp = memchr(cache_c, ':', cache_len)) != NULL ) {
attrName = [[OFString alloc] initWithCString: tmp + 1
length: cache_len -
(tmp - cache_c) -
1];
attrPrefix = [[OFString alloc] initWithCString: cache_c
length: tmp - cache_c];
} else {
|
>
|
|
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
|
if (buf[*i] != '=')
return;
if ((len = *i - *last) > 0)
[cache appendCStringWithoutUTF8Checking: buf + *last
length: len];
[cache removeLeadingAndTrailingWhitespaces];
cache_c = [cache cString];
cache_len = [cache cStringLength];
if ((tmp = memchr(cache_c, ':', cache_len)) != NULL) {
attrName = [[OFString alloc] initWithCString: tmp + 1
length: cache_len -
(tmp - cache_c) -
1];
attrPrefix = [[OFString alloc] initWithCString: cache_c
length: tmp - cache_c];
} else {
|
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
|
}
/* Expecting delimiter */
- (void)_parseExpectDelimiterWithBuffer: (const char*)buf
i: (size_t*)i
last: (size_t*)last
{
if (buf[*i] != '\'' && buf[*i] != '"')
@throw [OFMalformedXMLException newWithClass: isa];
delim = buf[*i];
*last = *i + 1;
state = OF_XMLPARSER_IN_ATTR_VALUE;
}
/* Looking for attribute value */
- (void)_parseInAttributeValueWithBuffer: (const char*)buf
i: (size_t*)i
last: (size_t*)last
|
>
>
>
>
>
>
<
|
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
|
}
/* Expecting delimiter */
- (void)_parseExpectDelimiterWithBuffer: (const char*)buf
i: (size_t*)i
last: (size_t*)last
{
*last = *i + 1;
if (buf[*i] == ' ' || buf[*i] == '\t' || buf[*i] == '\n' ||
buf[*i] == '\r')
return;
if (buf[*i] != '\'' && buf[*i] != '"')
@throw [OFMalformedXMLException newWithClass: isa];
delim = buf[*i];
state = OF_XMLPARSER_IN_ATTR_VALUE;
}
/* Looking for attribute value */
- (void)_parseInAttributeValueWithBuffer: (const char*)buf
i: (size_t*)i
last: (size_t*)last
|