A working proxy exists.
This commit is contained in:
@@ -2,35 +2,38 @@ package ipp
|
||||
|
||||
import "io"
|
||||
|
||||
type textWithoutLanguage struct {
|
||||
// TextWithoutLanguage is the TextWithoutLanguage attribute
|
||||
type TextWithoutLanguage struct {
|
||||
name string
|
||||
value string
|
||||
}
|
||||
|
||||
func NewtextWithoutLanguage(name, value string) *textWithoutLanguage {
|
||||
c := new(textWithoutLanguage)
|
||||
// NewtextWithoutLanguage creates a new textWithoutLanguage attribute
|
||||
func NewtextWithoutLanguage(name, value string) *TextWithoutLanguage {
|
||||
c := new(TextWithoutLanguage)
|
||||
c.name = name
|
||||
c.value = value
|
||||
return c
|
||||
}
|
||||
|
||||
func (c textWithoutLanguage) Name() string {
|
||||
// Name returns the name of the attribute
|
||||
func (c TextWithoutLanguage) Name() string {
|
||||
return c.name
|
||||
}
|
||||
|
||||
func (c textWithoutLanguage) String() string {
|
||||
func (c TextWithoutLanguage) String() string {
|
||||
return c.name + ":" + c.value
|
||||
}
|
||||
|
||||
func (c *textWithoutLanguage) valueTag() tag {
|
||||
func (c *TextWithoutLanguage) valueTag() tag {
|
||||
return textWithoutLanguageValueTag
|
||||
}
|
||||
|
||||
func (c *textWithoutLanguage) unmarshal(byteStream io.Reader) {
|
||||
func (c *TextWithoutLanguage) unmarshal(byteStream io.Reader) {
|
||||
c.name, c.value = unmarshalSingleValue(byteStream)
|
||||
}
|
||||
|
||||
func (c *textWithoutLanguage) marshal() []byte {
|
||||
func (c *TextWithoutLanguage) marshal() []byte {
|
||||
l := 5 + len(c.name) + len(c.value)
|
||||
b := make([]byte, l)
|
||||
b[0] = byte(textWithoutLanguageValueTag)
|
||||
@@ -38,7 +41,7 @@ func (c *textWithoutLanguage) marshal() []byte {
|
||||
return b
|
||||
}
|
||||
|
||||
func (c *textWithoutLanguage) size() int {
|
||||
func (c *TextWithoutLanguage) size() int {
|
||||
l := 1 + 4 // The attribute tag + 2 lengths
|
||||
l += len(c.name)
|
||||
l += len(c.value)
|
||||
|
||||
Reference in New Issue
Block a user