Differences From Artifact [23e15b2038]:
- File
src/OFXMLElement.m
— part of check-in
[d5ddb2cb48]
at
2012-06-06 13:09:08
on branch trunk
— Rework OFDataArray API.
Also adds more checks. (user: js, size: 26150) [annotate] [blame] [check-ins using] [more...]
To Artifact [dff10de86f]:
- File src/OFXMLElement.m — part of check-in [11d3d69a22] at 2012-06-10 13:28:05 on branch trunk — More API improvements. (user: js, size: 26115) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
511 512 513 514 515 516 517 | /* Start of tag */ cString[i++] = '<'; if (prefix != nil && ![ns isEqual: defaultNS]) { length += [prefix UTF8StringLength] + 1; @try { cString = [self resizeMemory: cString | | | | 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 | /* Start of tag */ cString[i++] = '<'; if (prefix != nil && ![ns isEqual: defaultNS]) { length += [prefix UTF8StringLength] + 1; @try { cString = [self resizeMemory: cString size: length]; } @catch (id e) { [self freeMemory: cString]; @throw e; } memcpy(cString + i, [prefix UTF8String], [prefix UTF8StringLength]); i += [prefix UTF8StringLength]; cString[i++] = ':'; } memcpy(cString + i, [name UTF8String], [name UTF8StringLength]); i += [name UTF8StringLength]; /* xmlns if necessary */ if (prefix == nil && ((ns != nil && ![ns isEqual: defaultNS]) || (ns == nil && defaultNS != nil))) { length += [ns UTF8StringLength] + 9; @try { cString = [self resizeMemory: cString size: length]; } @catch (id e) { [self freeMemory: cString]; @throw e; } memcpy(cString + i, " xmlns='", 8); i += 8; |
︙ | ︙ | |||
571 572 573 574 575 576 577 | length += [attributeName UTF8StringLength] + (attributePrefix != nil ? [attributePrefix UTF8StringLength] + 1 : 0) + [tmp UTF8StringLength] + 4; @try { cString = [self resizeMemory: cString | | | 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 | length += [attributeName UTF8StringLength] + (attributePrefix != nil ? [attributePrefix UTF8StringLength] + 1 : 0) + [tmp UTF8StringLength] + 4; @try { cString = [self resizeMemory: cString size: length]; } @catch (id e) { [self freeMemory: cString]; @throw e; } cString[i++] = ' '; if (attributePrefix != nil) { |
︙ | ︙ | |||
647 648 649 650 651 652 653 | if (indent) [tmp addItem: "\n"]; length += [tmp count] + [name UTF8StringLength] + 2 + (indent ? level * indentation : 0); @try { cString = [self resizeMemory: cString | | | 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 | if (indent) [tmp addItem: "\n"]; length += [tmp count] + [name UTF8StringLength] + 2 + (indent ? level * indentation : 0); @try { cString = [self resizeMemory: cString size: length]; } @catch (id e) { [self freeMemory: cString]; @throw e; } cString[i++] = '>'; |
︙ | ︙ | |||
669 670 671 672 673 674 675 | cString[i++] = '<'; cString[i++] = '/'; if (prefix != nil) { length += [prefix UTF8StringLength] + 1; @try { cString = [self resizeMemory: cString | | | 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 | cString[i++] = '<'; cString[i++] = '/'; if (prefix != nil) { length += [prefix UTF8StringLength] + 1; @try { cString = [self resizeMemory: cString size: length]; } @catch (id e) { [self freeMemory: cString]; @throw e; } memcpy(cString + i, [prefix UTF8String], [prefix UTF8StringLength]); |
︙ | ︙ |