Go: enable listing all indirect objects

This commit is contained in:
Přemysl Eric Janouch 2021-12-09 13:19:41 +01:00
parent 97ffe3d46e
commit d0f80aa6ae
Signed by: p
GPG Key ID: A0420B94F92B9493

View File

@ -503,6 +503,17 @@ type Updater struct {
Trailer map[string]Object
}
// ListIndirect returns the whole cross-reference table as Reference Objects.
func (u *Updater) ListIndirect() []Object {
result := []Object{}
for i := 0; i < len(u.xref); i++ {
if u.xref[i].nonfree {
result = append(result, NewReference(uint(i), u.xref[i].generation))
}
}
return result
}
func (u *Updater) parseStream(lex *Lexer, stack *[]Object) (Object, error) {
lenStack := len(*stack)
if lenStack < 1 {