internal

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: CC0-1.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DecimalDot uint = 10
	MinusSign  uint = 11
	Newline    uint = 12
	WhiteSpace uint = 13
	ErrDigit   uint = 14

	Break       uint = 0x01
	HasDecimals uint = 0x02
	HasNewline  uint = 0x04
	HasValue    uint = 0x08
	IsNegative  uint = 0x10
)

Variables

This section is empty.

Functions

func ConvertSignedTemplate added in v1.0.1

func ConvertSignedTemplate[T SignedNumber](r *ByteReader,
	processNonDigit func(uint, uint, T) (uint, error),
	processDigit func(uint, uint, T) (T, uint),
) (T, uint, error)

func ConvertTemplate added in v1.0.1

func ConvertTemplate[T Number](
	r *ByteReader,
	processNonDigit func(uint, uint, T) (uint, error),
	processDigit func(uint, uint, T) (T, uint),
) (T, uint, error)

func GetTypeKind added in v1.0.1

func GetTypeKind[T any]() reflect.Kind

func ProcessDigit

func ProcessDigit[T constraints.Integer](digit uint, flags uint, res T) (T, uint)

func ProcessFloatNonDigit

func ProcessFloatNonDigit[T constraints.Float](digit uint, flags uint, res T) (uint, error)

func ProcessIntNonDigit

func ProcessIntNonDigit[T constraints.Signed](digit uint, flags uint, res T) (uint, error)

func ProcessNonDigit

func ProcessNonDigit[T Number](digit uint, flags uint, res T) (uint, error)

func ProcessSignedNonDigit

func ProcessSignedNonDigit[T SignedNumber](digit uint, flags uint, res T) (uint, error)

func ProcessUintNonDigit

func ProcessUintNonDigit[T constraints.Unsigned](digit uint, flags uint, res T) (uint, error)

Types

type ByteReader

type ByteReader struct {
	// contains filtered or unexported fields
}

func NewByteReader

func NewByteReader(r io.Reader, chunkSize int) *ByteReader

func (*ByteReader) NextByte

func (r *ByteReader) NextByte() (byte, error)

func (*ByteReader) NextDataByte

func (r *ByteReader) NextDataByte() (byte, error)

func (*ByteReader) NextDigit

func (r *ByteReader) NextDigit() (uint, error)

type Number

type Number interface {
	constraints.Float | constraints.Integer
}

type SignedNumber

type SignedNumber interface {
	constraints.Float | constraints.Signed
}

type SliceReader

type SliceReader[T any] struct {
	Buf1 []T
	Buf2 [][]T
	Buf3 [][][]T
	// contains filtered or unexported fields
}

func NewSliceReader

func NewSliceReader[T any](
	byteReader *ByteReader, conv func(*ByteReader) (T, uint, error), dim uint,
) *SliceReader[T]

func RunSliceReader

func RunSliceReader[T any](
	r io.Reader, chunkSize int,
	conv func(*ByteReader) (T, uint, error), dim uint) (*SliceReader[T], error)

func (*SliceReader[T]) Run

func (s *SliceReader[T]) Run() error

Jump to

Keyboard shortcuts

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