Anonymous avatar Anonymous committed 0adb907

fixed read_obj_array

Comments (0)

Files changed (3)

cmd/groot-ls/main.go

 		if i+1 >= nkeys {
 			str = "`--"
 		}
-		fmt.Printf("%s%s '%s' title='%s' type=%s\n",
+		fmt.Printf("%s%s %s title='%s' type=%s\n",
 			indent, str, k.Name(), k.Title(), k.Class())
 		if v, ok := k.Value().(*groot.Directory); ok {
 			path := append(path, k.Name())

pkg/groot/buffer.go

 		// skip version
 		b.read_nbytes(2)
 		// skip object bits and unique id
-		b.read_nbytes(8)
+		id := b.ntou4()
+		bits := b.ntou4()
+		//b.read_nbytes(8)
+		dprintf("id=%v bits=%v\n", id, bits)
 	}
-	name := "??"
-	if vers > 1 {
-		name = b.read_tstring()
-	}
-	title := b.read_tstring()
+	name :=  b.read_tstring()
 
 	nobjs := int(b.ntoi4())
 	lbound := b.ntoi4()
 
-	printf("read_obj_array: vers=%v pos=%v bcnt=%v name='%v' title='%v' nobjs=%v lbound=%v\n",
-		vers, pos, bcnt, name, title, nobjs, lbound)
+	dprintf("read_obj_array: vers=%v pos=%v bcnt=%v name='%v' nobjs=%v lbound=%v\n",
+		vers, pos, bcnt, name, nobjs, lbound)
 
 	elmts = make([]Object, nobjs)
 	for i := 0; i < nobjs; i++ {

pkg/groot/tree.go

 		b.ntoi8() //fEstimate
 	}
 
-	printf("=> entries=%v tot_bytes=%v zip_bytes=%v\n", 
-		tree.entries, tree.tot_bytes, tree.zip_bytes)
+	dprintf("=> (%s) entries=%v tot_bytes=%v zip_bytes=%v\n", 
+		tree.name, tree.entries, tree.tot_bytes, tree.zip_bytes)
+
+	branches := b.read_obj_array()
+	dprintf("-- #nbranches: %v\n", len(branches))
 	return
 }
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.