diff options
author | Andrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu> | 2012-05-03 01:00:01 -0400 |
---|---|---|
committer | Andrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu> | 2012-05-03 01:00:01 -0400 |
commit | 5cdae5950c357564300c0ee3fb4dc9e7bbf4946b (patch) | |
tree | 1ca6c09455b060b9f607c3e275ac14b5c57bbdc1 /nexgb/xgbgen/type.go | |
parent | 39507f86ab0468292c24081a80f41c1799d6b477 (diff) | |
download | haven-5cdae5950c357564300c0ee3fb4dc9e7bbf4946b.tar.gz haven-5cdae5950c357564300c0ee3fb4dc9e7bbf4946b.tar.xz haven-5cdae5950c357564300c0ee3fb4dc9e7bbf4946b.zip |
holy toldeo... things might actually be working
Diffstat (limited to 'nexgb/xgbgen/type.go')
-rw-r--r-- | nexgb/xgbgen/type.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/nexgb/xgbgen/type.go b/nexgb/xgbgen/type.go index d8e76a2..3498463 100644 --- a/nexgb/xgbgen/type.go +++ b/nexgb/xgbgen/type.go @@ -334,6 +334,18 @@ func (s *Struct) Initialize(p *Protocol) { } } +// HasList returns whether there is a field in this struct that is a list. +// When true, a more involved calculation is necessary to compute this struct's +// size. +func (s *Struct) HasList() bool { + for _, field := range s.Fields { + if _, ok := field.(*ListField); ok { + return true + } + } + return false +} + type Union struct { srcName string xmlName string |