util

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: MIT, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chars

type Chars struct {

	// XXX Piggybacking item index here is a horrible idea. But I'm trying to
	// minimize the memory footprint by not wasting padded spaces.
	Index int32
	// contains filtered or unexported fields
}

func RunesToChars

func RunesToChars(runes []rune) Chars

func ToChars

func ToChars(bytes []byte) Chars

ToChars converts byte array into rune array

func (*Chars) Bytes

func (chars *Chars) Bytes() []byte

func (*Chars) CopyRunes

func (chars *Chars) CopyRunes(dest []rune)

func (*Chars) Get

func (chars *Chars) Get(i int) rune

func (*Chars) IsBytes

func (chars *Chars) IsBytes() bool

func (*Chars) LeadingWhitespaces

func (chars *Chars) LeadingWhitespaces() int

func (*Chars) Length

func (chars *Chars) Length() int

func (*Chars) Prepend

func (chars *Chars) Prepend(prefix string)

func (*Chars) String

func (chars *Chars) String() string

String returns the string representation of a Chars object.

func (*Chars) ToRunes

func (chars *Chars) ToRunes() []rune

func (*Chars) ToString

func (chars *Chars) ToString() string

func (*Chars) TrailingWhitespaces

func (chars *Chars) TrailingWhitespaces() int

func (*Chars) TrimLength

func (chars *Chars) TrimLength() uint16

TrimLength returns the length after trimming leading and trailing whitespaces

func (*Chars) TrimTrailingWhitespaces

func (chars *Chars) TrimTrailingWhitespaces()

type Slab

type Slab struct {
	I16 []int16
	I32 []int32
}

func MakeSlab

func MakeSlab(size16 int, size32 int) *Slab

Jump to

Keyboard shortcuts

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