-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathobjects.go
78 lines (65 loc) · 1.91 KB
/
objects.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package pdf
import "io"
// Object represents all of the types that can be handled
// by the file store. Those types (defined in this package) are:
// - Boolean
// - Integer
// - Real
// - String
// - Name
// - Array
// - Dictionary
// - Stream
// - Null
type Object interface {
// private to reduce the public api
// and limit objects to those defined in this package
writeTo(w io.Writer) (int64, error)
}
// Boolean objects represent the logical values of true and false.
// - §7.3.2
type Boolean bool
// Integer objects represent mathematical integers.
// - §7.3.3
type Integer int32
// Real objects represent mathematical real numbers.
// - §7.3.3
type Real float32
// A String object consists of zero or more bytes.
// - §7.3.4
type String []byte
// A Name object is an atomic symbol uniquely defined by a sequence of
// any characters (8-bit values) except null (character code 0)
// - §7.3.5
type Name string
// An Array object is a one-dimensional collection of objects
// arranged sequentially.
// - §7.3.6
type Array []Object
// A Dictionary object is an associative table mapping Names to Objects.
// - §7.3.7
type Dictionary map[Name]Object
// A Stream object is a sequence of bytes.
// - §7.3.8
type Stream struct {
Dictionary
Stream []byte
}
// The Null object has a type and value that are unequal to any other object.
// - §7.3.9
// The embedded error is used to tell why the Null exists (e.g., why it was returned from file.Get()
type Null struct{ Error error }
// An ObjectReference references a specific Object with the exact
// ObjectNumber and GenerationNumbers specified.
// Indirectly defined in
type ObjectReference struct {
ObjectNumber uint // positive integer
GenerationNumber uint // non-negative integer
}
// An IndirectObject gives an Object an ObjectReference by which
// other Objects can refer to it.
// - §7.3.10
type IndirectObject struct {
ObjectReference
Object
}