-
Notifications
You must be signed in to change notification settings - Fork 35
/
objstring.go
51 lines (41 loc) · 1.08 KB
/
objstring.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
// Copyright 2017 The go-hep Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package rootio
import "reflect"
type tobjString struct {
obj tobject
str string
}
func (*tobjString) Class() string {
return "TObjString"
}
func (obj *tobjString) Name() string {
return obj.str
}
func (obj *tobjString) Title() string {
return "Collectable string class"
}
// ROOTUnmarshaler is the interface implemented by an object that can
// unmarshal itself from a ROOT buffer
func (obj *tobjString) UnmarshalROOT(r *RBuffer) error {
start := r.Pos()
_, pos, bcnt := r.ReadVersion()
if err := obj.obj.UnmarshalROOT(r); err != nil {
return err
}
obj.str = r.ReadString()
r.CheckByteCount(pos, bcnt, start, "TObjString")
return r.Err()
}
func init() {
f := func() reflect.Value {
o := &tobjString{}
return reflect.ValueOf(o)
}
Factory.add("TObjString", f)
Factory.add("*rootio.tobjString", f)
}
var _ Object = (*tobjString)(nil)
var _ Named = (*tobjString)(nil)
var _ ROOTUnmarshaler = (*tobjString)(nil)