Commits

Anonymous committed 251e826

non working tree-streamer

Comments (0)

Files changed (2)

pkg/groot/buffer.go

   }
 */
 
+func (b *Buffer) read_attline() (color, style, width uint16) {
+	/*vers, pos, bcnt := */ b.read_version()
+	color = b.ntou2()
+	style = b.ntou2()
+	width = b.ntou2()
+	//FIXME: check_byte_count(s,c,"TAttLine")
+	return
+}
+
+func (b *Buffer) read_attfill() (color, style uint16) {
+	/*vers, pos, bcnt := */ b.read_version()
+	color = b.ntou2()
+	style = b.ntou2()
+	//FIXME: check_byte_count(s,c,"TAttFill")
+	return
+}
+
+func (b *Buffer) read_attmarker() (color, style uint16, width float32) {
+	/*vers, pos, bcnt := */ b.read_version()
+	color = b.ntou2()
+	style = b.ntou2()
+	width = b.ntof()
+	//FIXME: check_byte_count(s,c,"TAttMarker")
+	return
+}
+
 //FIXME
 // readObjectAny
 // readTList

pkg/groot/tree.go

 	name     string
 	title    string
 	entries  uint64
+	tot_bytes uint64
+	zip_bytes uint64
 	branches []Branch
 }
 
 	return tree.title
 }
 
+func (tree *Tree) Entries() uint64 {
+	return tree.entries
+}
+
 func (tree *Tree) ROOTDecode(b *Buffer) (err error) {
 
 	vers, pos, bcnt := b.read_version()
-	printf("vers=%v pos=%v bcnt=%v\n", vers, pos, bcnt)
+	dprintf("vers=%v pos=%v bcnt=%v\n", vers, pos, bcnt)
 	tree.name, tree.title = b.read_tnamed()
-	printf("name='%v' title='%v'\n", tree.name, tree.title)
+	dprintf("name='%v' title='%v'\n", tree.name, tree.title)
+	b.read_attline()
+	b.read_attfill()
 
+	if vers <= 4 {
+		b.ntoi4() //fScanField
+		b.ntoi4() //fMaxEntryLoop
+		b.ntoi4() //fMaxVirtualSize
+		tree.entries = uint64(b.ntod())
+		tree.tot_bytes = uint64(b.ntod())
+		tree.zip_bytes = uint64(b.ntod())
+		b.ntoi4() //fAutoSave
+		b.ntoi4() //fEstimate
+	} else if vers <= 9 {
+		tree.entries = uint64(b.ntod())
+		tree.tot_bytes = uint64(b.ntod())
+		tree.zip_bytes = uint64(b.ntod())
+		b.ntod() //fSaveBytes
+		b.ntoi4() //fTimerInterval
+		b.ntoi4() //fScanField
+		b.ntoi4() //fUpdate
+		b.ntoi4() //fMaxEntryLoop
+		b.ntoi4() //fMaxVirtualSize
+		b.ntoi4() //fAutoSave
+		b.ntoi4() //fEstimate
+	} else if vers < 16 { //FIXME: what is the exact version ?
+		tree.entries = uint64(b.ntod())
+		tree.tot_bytes = uint64(b.ntod())
+		tree.zip_bytes = uint64(b.ntod())
+		b.ntod() //fSaveBytes
+		b.ntod() //fWeight
+		b.ntoi4() //fTimerInterval
+		b.ntoi4() //fScanField
+		b.ntoi4() //fUpdate
+		b.ntoi4() //fMaxEntryLoop
+		b.ntoi4() //fMaxVirtualSize
+		b.ntoi4() //fAutoSave
+		b.ntoi4() //fEstimate
+	} else { // vers >= 16
+		tree.entries = b.ntou8()
+		tree.tot_bytes = b.ntou8()
+		tree.zip_bytes = b.ntou8()
+		b.ntou8() //fSavedBytes
+		if vers >= 18 {
+			b.ntoi8() //fFlushedBytes
+		}
+		b.ntod()  //fWeight
+		b.ntoi4() //fTimerInterval
+		b.ntoi4() //fScanField
+		b.ntoi4() //fUpdate
+		if vers >= 18 {
+			b.ntoi4() //fDefaultEntryOffsetLen
+		}
+		b.ntoi8() //fMaxEntries
+		b.ntoi8() //fMaxEntryLoop
+		b.ntou8() //fMaxVirtualSize
+		b.ntou8() //fAutoSave
+		if vers >= 18 {
+			b.ntoi8() //fAutoFlush
+		}
+		b.ntoi8() //fEstimate
+	}
+
+	dprintf("=> entries=%v tot_bytes=%v zip_bytes=%v\n", 
+		tree.entries, tree.tot_bytes, tree.zip_bytes)
 	return
 }