Exemple #1
0
 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
     }
 }
Exemple #2
0
 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));
     }
 }
Exemple #3
0
 public static IEnumerable <ListTreeNode <T> > GetNodes <T>(this ListTreeNode <T> self,
                                                            Utf8String jsonPointer)
     where T : IListTreeItem, IValue <T>
 {
     return(self.GetNodes(new JsonPointer(jsonPointer)));
 }