ObjFW  Diff

Differences From Artifact [ac132aa128]:

To Artifact [e09b35486d]:


880
881
882
883
884
885
886
887

888
889
890
891
892
893
894
895
896

897
898
899
900

901
902
903
904
905
906
907

908
909
910
911
912
913
914
915
916
917
918

919
920

921
922
923
924
925
926
927
928
929
930
931
932
933
934

935
936
937
938
939
940

941
942
943
944
945
946
947
880
881
882
883
884
885
886

887
888
889
890
891
892
893
894
895

896
897
898
899

900
901
902
903
904
905
906

907
908
909
910
911
912
913
914
915
916
917

918
919

920
921
922
923
924
925
926
927
928
929
930
931
932
933

934
935
936
937
938
939

940
941
942
943
944
945
946
947







-
+








-
+



-
+






-
+










-
+

-
+













-
+





-
+







	if (_children == nil)
		_children = [[OFMutableArray alloc] init];

	[_children addObject: child];
}

- (void)insertChild: (OFXMLNode *)child
	    atIndex: (size_t)index
	    atIndex: (size_t)idx
{
	if ([child isKindOfClass: [OFXMLAttribute class]])
		@throw [OFInvalidArgumentException exception];

	if (_children == nil)
		_children = [[OFMutableArray alloc] init];

	[_children insertObject: child
			atIndex: index];
			atIndex: idx];
}

- (void)insertChildren: (OFArray *)children
	       atIndex: (size_t)index
	       atIndex: (size_t)idx
{
	for (OFXMLNode *node in children)
		if ([node isKindOfClass: [OFXMLAttribute class]])
			@throw [OFInvalidArgumentException exception];

	[_children insertObjectsFromArray: children
				  atIndex: index];
				  atIndex: idx];
}

- (void)removeChild: (OFXMLNode *)child
{
	if ([child isKindOfClass: [OFXMLAttribute class]])
		@throw [OFInvalidArgumentException exception];

	[_children removeObject: child];
}

- (void)removeChildAtIndex: (size_t)index
- (void)removeChildAtIndex: (size_t)idx
{
	[_children removeObjectAtIndex: index];
	[_children removeObjectAtIndex: idx];
}

- (void)replaceChild: (OFXMLNode *)child
	    withNode: (OFXMLNode *)node
{
	if ([node isKindOfClass: [OFXMLAttribute class]] ||
	    [child isKindOfClass: [OFXMLAttribute class]])
		@throw [OFInvalidArgumentException exception];

	[_children replaceObject: child
		      withObject: node];
}

- (void)replaceChildAtIndex: (size_t)index
- (void)replaceChildAtIndex: (size_t)idx
		   withNode: (OFXMLNode *)node
{
	if ([node isKindOfClass: [OFXMLAttribute class]])
		@throw [OFInvalidArgumentException exception];

	[_children replaceObjectAtIndex: index
	[_children replaceObjectAtIndex: idx
			     withObject: node];
}

- (OFXMLElement *)elementForName: (OFString *)elementName
{
	return [[self elementsForName: elementName] firstObject];
}