1
0
mirror of https://github.com/garraflavatra/go-fmp.git synced 2025-06-28 12:35:12 +00:00
Files
go-fmp/fmp/fmp_table.go

48 lines
891 B
Go
Raw Normal View History

2025-06-12 11:44:57 +02:00
package fmp
func (ctx *FmpFile) Tables() []*FmpTable {
tables := make([]*FmpTable, 0)
2025-06-12 15:12:34 +02:00
2025-06-12 21:21:55 +02:00
for key, ent := range *ctx.Dictionary {
if key != 3 {
2025-06-12 15:12:34 +02:00
continue
}
2025-06-12 21:21:55 +02:00
println("Found a 3")
2025-06-12 15:12:34 +02:00
2025-06-12 21:21:55 +02:00
for key, ent = range *ent.Children {
if key != 16 {
2025-06-12 15:12:34 +02:00
continue
}
2025-06-12 21:21:55 +02:00
println("Found a 3.16")
2025-06-12 15:12:34 +02:00
2025-06-12 21:21:55 +02:00
for key, ent = range *ent.Children {
if key != 5 {
2025-06-12 15:12:34 +02:00
continue
}
2025-06-12 21:21:55 +02:00
println("Found a 3.16.5")
2025-06-12 15:12:34 +02:00
2025-06-12 21:21:55 +02:00
for tablePath := range *ent.Children {
if key >= 128 {
2025-06-12 15:12:34 +02:00
continue
}
// Found a table!
2025-06-12 21:21:55 +02:00
println("Found a table at 3.16.5.", tablePath)
2025-06-12 15:12:34 +02:00
}
}
}
2025-06-12 11:44:57 +02:00
}
2025-06-12 15:12:34 +02:00
// 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)
// }
2025-06-12 11:44:57 +02:00
return tables
}