utf8

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2020 License: Apache-2.0 Imports: 2 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSequencesPrealloc

func NewSequencesPrealloc(start, end rune,
	preallocSequences Sequences,
	preallocRangeStack RangeStack,
	preallocStartBytes, preallocEndBytes []byte) (Sequences, RangeStack, error)

Types

type Range

type Range struct {
	Start byte
	End   byte
}

Range describes a single range of byte values

func (Range) String

func (u Range) String() string

type RangeStack

type RangeStack []scalarRange

func (RangeStack) Pop

func (s RangeStack) Pop() (RangeStack, scalarRange)

func (RangeStack) Push

func (s RangeStack) Push(v scalarRange) RangeStack

type Sequence

type Sequence []Range

Sequence is a collection of Range

func SequenceFromEncodedRange

func SequenceFromEncodedRange(start, end []byte) (Sequence, error)

SequenceFromEncodedRange creates sequence from the encoded bytes

func (Sequence) Matches

func (u Sequence) Matches(bytes []byte) bool

Matches checks to see if the provided byte slice matches the Sequence

func (Sequence) String

func (u Sequence) String() string

type Sequences

type Sequences []Sequence

Sequences is a collection of Sequence

func NewSequences

func NewSequences(start, end rune) (Sequences, error)

NewSequences constructs a collection of Sequence which describe the byte ranges covered between the start and end runes.

Jump to

Keyboard shortcuts

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