-
Notifications
You must be signed in to change notification settings - Fork 1
/
storage.go
50 lines (39 loc) · 803 Bytes
/
storage.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
package cfb
import (
"fmt"
"io"
)
type Storage struct {
d *DirectoryEntry
}
func (d *DirectoryEntry) storage() (*Storage, error) {
if d.Type() != StorageObject {
return nil, ErrWrongObjectType
}
return &Storage{d}, nil
}
func (s *Storage) String() string {
return fmt.Sprintf("Storage{Path:%q}", s.Path())
}
func (s *Storage) Name() string {
return s.d.Name()
}
func (s *Storage) Path() string {
return s.d.Path()
}
func (s *Storage) Type() ObjectType {
return StorageObject
}
func (s *Storage) Size() uint64 {
return 0
}
func (s *Storage) ReadAt(b []byte, offset int64) (int, error) {
return 0, io.EOF
}
func (s *Storage) Seek(offset int64, whence int) (int64, error) {
// TODO: error check
return 0, nil
}
func (s *Storage) Read(b []byte) (int, error) {
return 0, io.EOF
}