mirror of
https://github.com/garraflavatra/go-fmp.git
synced 2025-06-28 04:25:11 +00:00
Tables
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user