Documentation ¶
Overview ¶
Package lsb provides a Lazy String Buffer: efficient, and NOT concurrency safe!
found in `path/path.go` - chapeaux to Rob Pike
Note: I would not mind to see this below "strings" :-)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Friendly ¶
type Friendly interface { Index(i int) byte // read a previously appended byte Append(c byte) // extend by adding c at the end Unpend() // undo last Append - Backtracking - track back String() string // the final string - result Pos() int // bytes written }
Friendly - interface exposed for go doc only
type LazyStringBuffer ¶
type LazyStringBuffer struct {
// contains filtered or unexported fields
}
LazyStringBuffer is a lazily constructed path buffer. It supports append, reading previously appended bytes, and retrieving the final string. It does not allocate a buffer to hold the output until that output diverges from s.
func (*LazyStringBuffer) Append ¶
func (b *LazyStringBuffer) Append(c byte)
Append appends c to the buffer b
func (*LazyStringBuffer) Index ¶
func (b *LazyStringBuffer) Index(i int) byte
Index returns the byte at i
func (*LazyStringBuffer) String ¶
func (b *LazyStringBuffer) String() string
String returns the content as string
Click to show internal directories.
Click to hide internal directories.