public static void RemoveValue <T>(this ListTreeNode <T> self, Utf8String jsonPointer) where T : IListTreeItem, IValue <T> { foreach (var node in self.GetNodes(new JsonPointer(jsonPointer))) { if (node.Parent.IsMap()) { node.Prev.SetValue(default(T)); // remove key } node.SetValue(default(T)); // remove } }
public static void SetValue <T>(this ListTreeNode <T> self, Utf8String jsonPointer, ArraySegment <Byte> bytes) where T : IListTreeItem, IValue <T> { foreach (var node in self.GetNodes(jsonPointer)) { node.SetValue(default(T).New( bytes, ValueNodeType.Boolean, node.Value.ParentIndex)); } }
public static IEnumerable <ListTreeNode <T> > GetNodes <T>(this ListTreeNode <T> self, Utf8String jsonPointer) where T : IListTreeItem, IValue <T> { return(self.GetNodes(new JsonPointer(jsonPointer))); }