Simplify unmarshalling.

This commit is contained in:
Henrik, Sölver
2021-06-09 19:51:48 +02:00
committed by Henrik Sölver
parent 61abe8dbd4
commit 71fcac40f0
17 changed files with 452 additions and 179 deletions

View File

@@ -2,6 +2,10 @@
// SPDX-License-Identifier: BSD-3-Clause
package ipp
import (
"bufio"
)
type KeyWord struct {
sos *SetOfStrings
}
@@ -21,10 +25,6 @@ func (k KeyWord) String() string {
return k.sos.String()
}
func (k *KeyWord) size() int {
return k.sos.size()
}
func (k *KeyWord) valueTag() tag {
return k.sos.valueTag()
}
@@ -33,7 +33,10 @@ func (k *KeyWord) marshal() []byte {
return k.sos.marshal()
}
func (k *KeyWord) unmarshal(byteStream *bufio.Reader) {
k.sos.unmarshal(byteStream, keyWordValueTag)
}
func (k *KeyWord) addValue(v interface{}) {
k.sos.AddValue(v.(string))
}