[#164] sdk/object: Add HasParent method
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
2a2e4d8577
commit
1305bc750e
3 changed files with 29 additions and 0 deletions
|
@ -296,6 +296,12 @@ func (o *rwObject) setParent(v *Object) {
|
|||
})
|
||||
}
|
||||
|
||||
func (o *rwObject) initRelations() {
|
||||
o.setHeaderField(func(h *object.Header) {
|
||||
h.SetSplit(new(object.SplitHeader))
|
||||
})
|
||||
}
|
||||
|
||||
func (o *rwObject) resetRelations() {
|
||||
o.setHeaderField(func(h *object.Header) {
|
||||
h.SetSplit(nil)
|
||||
|
@ -340,3 +346,9 @@ func (o *rwObject) cutPayload() *rwObject {
|
|||
|
||||
return (*rwObject)(ov2)
|
||||
}
|
||||
|
||||
func (o *rwObject) HasParent() bool {
|
||||
return (*object.Object)(o).
|
||||
GetHeader().
|
||||
GetSplit() != nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue