1
0
mirror of https://github.com/garraflavatra/go-fmp.git synced 2025-06-28 04:25:11 +00:00
Files
go-fmp/fmp/fmp_table.go
2025-06-12 21:21:55 +02:00

48 lines
891 B
Go

package fmp
func (ctx *FmpFile) Tables() []*FmpTable {
tables := make([]*FmpTable, 0)
for key, ent := range *ctx.Dictionary {
if key != 3 {
continue
}
println("Found a 3")
for key, ent = range *ent.Children {
if key != 16 {
continue
}
println("Found a 3.16")
for key, ent = range *ent.Children {
if key != 5 {
continue
}
println("Found a 3.16.5")
for tablePath := range *ent.Children {
if key >= 128 {
continue
}
// Found a table!
println("Found a table at 3.16.5.", tablePath)
}
}
}
}
// metaDict := ctx.Dictionary.get([]uint64{4, 1, 7})
// if metaDict == nil {
// return tables
// }
// for _, meta := range *metaDict.Children {
// name := decodeByteSeq(meta.Children.get([]uint64{16}).Value)
// table := &FmpTable{Name: name}
// tables = append(tables, table)
// }
return tables
}