buf

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2017 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MinCapIncrease is the minimum amount by which to grow a Buf.
	MinCapIncrease = 512
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Buf

type Buf struct {
	Buf []rune
	Len int
}

Buf is a reusable rune buffer.

func (*Buf) Append

func (b *Buf) Append(r, sep []rune)

Append appends r to b.Buf separated by sep when b.Buf is not already empty.

Append dynamically grows b.Buf as necessary to accommodate r and the separator. Specifically, when b.Buf is not empty, b.Buf will grow by increments of MinCapIncrease.

After a call to Append, b.Len will be len(b.Buf)+len(r)+len(sep) Call Reset to reset the Buf.

func (*Buf) AppendString

func (b *Buf) AppendString(s, sep string)

AppendString is a utility func wrapping Append.

func (*Buf) Reset

func (b *Buf) Reset()

Reset resets b.

func (*Buf) String

func (b *Buf) String() string

String satisfies fmt.Stringer.

Jump to

Keyboard shortcuts

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