1
0
mirror of https://github.com/garraflavatra/go-fmp.git synced 2025-06-28 04:25:11 +00:00
This commit is contained in:
2025-06-14 15:19:36 +02:00
parent d9ffc3e573
commit b94fa28ba9
7 changed files with 49 additions and 65 deletions

View File

@ -2,46 +2,16 @@ package fmp
func (ctx *FmpFile) Tables() []*FmpTable {
tables := make([]*FmpTable, 0)
ent := ctx.Dictionary.GetEntry([]uint64{3, 16, 5})
for key, ent := range *ctx.Dictionary {
if key != 3 {
for path, tableEnt := range *ent.Children {
if path < 128 {
continue
}
debug("Found a 3")
for key, ent = range *ent.Children {
if key != 16 {
continue
}
debug("Found a 3.16")
for key, ent = range *ent.Children {
if key != 5 {
continue
}
debug("Found a 3.16.5")
for tablePath := range *ent.Children {
if key >= 128 {
continue
}
// Found a table!
debug("Found a table at 3.16.5.%d", tablePath)
}
}
}
name := decodeByteSeq(tableEnt.Children.GetValue([]uint64{16}))
table := &FmpTable{ID: path, Name: name}
tables = append(tables, table)
}
// 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
}