Beispiel #1
0
        public TreeDiagnosticsReader(ITreeReader inner)
        {
            Inner = inner;

            LastPropertyName = "<Database>";
            Path             = new Stack <TreeDiagnostics>();
            Tree             = Open();
        }
Beispiel #2
0
        private TreeDiagnostics Open()
        {
            TreeDiagnostics item = new TreeDiagnostics(LastPropertyName, Position);

            if (Path.Count > 0)
            {
                Path.Peek().AddChild(item);
            }
            Path.Push(item);

            return(item);
        }
Beispiel #3
0
        public T[] ReadBlockArray <T>() where T : unmanaged
        {
            // Add array type to diagnostics for array
            TreeDiagnostics diagnostics = Path.Peek();

            diagnostics.Name = $"{typeof(T).Name}[] {diagnostics.Name ?? ""}";

            T[] array = Inner.ReadBlockArray <T>();

            // Close array (no separate end token for BlockArray)
            Close();

            return(array);
        }
Beispiel #4
0
 public TreeDiagnostics AddChild(TreeDiagnostics child)
 {
     Children = Children ?? new List <TreeDiagnostics>();
     Children.Add(child);
     return(child);
 }
Beispiel #5
0
        private void Close()
        {
            TreeDiagnostics item = Path.Pop();

            item.EndPosition = Position;
        }