formatter

package
v0.0.0-...-48a436e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Binary formatterFunc
	Ascii  formatterFunc
	Bcd    formatterFunc
)

Functions

This section is empty.

Types

type AsciiFormatter

type AsciiFormatter struct {
}

func (*AsciiFormatter) GetBytes

func (af *AsciiFormatter) GetBytes(value string) ([]byte, error)

func (*AsciiFormatter) GetPackedLength

func (af *AsciiFormatter) GetPackedLength(unpackedLength int) int

func (*AsciiFormatter) GetString

func (af *AsciiFormatter) GetString(value []byte) string

type BcdFormatter

type BcdFormatter struct {
}

func (*BcdFormatter) GetBytes

func (bf *BcdFormatter) GetBytes(value string) ([]byte, error)

func (*BcdFormatter) GetPackedLength

func (bf *BcdFormatter) GetPackedLength(unpackedLength int) int

func (*BcdFormatter) GetString

func (bf *BcdFormatter) GetString(value []byte) string

type BinaryFormatter

type BinaryFormatter struct {
}

func (*BinaryFormatter) GetBytes

func (bf *BinaryFormatter) GetBytes(value string) ([]byte, error)

func (*BinaryFormatter) GetPackedLength

func (bf *BinaryFormatter) GetPackedLength(unpackedLength int) int

func (*BinaryFormatter) GetString

func (bf *BinaryFormatter) GetString(value []byte) string

type IFormatter

type IFormatter interface {
	GetBytes(value string) ([]byte, error)
	GetString([]byte) string
	GetPackedLength(unpackedLength int) int
}

func NewAsciiFormatter

func NewAsciiFormatter() IFormatter

func NewBcdFormatter

func NewBcdFormatter() IFormatter

func NewBinaryFormatter

func NewBinaryFormatter() IFormatter

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL