Documentation ¶
Index ¶
- Constants
- func Append(rw ReadWriterAt, b []byte) error
- func ExpandRuneIndexFn(r ReaderAt, i int, truth bool, f func(rune) bool) int
- func ExpandRuneLastIndexFn(r ReaderAt, i int, truth bool, f func(rune) bool) int
- func HasPrefix(r ReaderAt, i int, s []byte) bool
- func Index(r ReaderAt, i int, sep []byte, toLower bool) (int, error)
- func IndexCtx(ctx context.Context, r ReaderAt, i int, sep []byte, toLower bool) (int, error)
- func IsWordRune(ru rune) bool
- func LineEndIndex(r ReaderAt, i int) (int, bool, error)
- func LineStartIndex(r ReaderAt, i int) (int, error)
- func LinesIndexes(r ReaderAt, a, b int) (int, int, bool, error)
- func MakeBytesCopy(b []byte) []byte
- func NewlineIndex(r ReaderAt, i int) (int, int, error)
- func NewlineLastIndex(r ReaderAt, i int) (int, int, error)
- func REqual(r ReaderAt, i, n int, p []byte) (bool, error)
- func ReadFastFull(rd ReaderAt) ([]byte, error)
- func ReadFullCopy(rd ReaderAt) ([]byte, error)
- func ReadLastRuneAt(r ReaderAt, i int) (rune, int, error)
- func ReadRuneAt(r ReaderAt, i int) (rune, int, error)
- func ReaderIter(r ReaderAt, fn func(i int, ru rune) bool) error
- func RuneIndexFn(r ReaderAt, i int, truth bool, f func(rune) bool) (index, size int, err error)
- func RuneLastIndexFn(r ReaderAt, i int, truth bool, f func(rune) bool) (index, size int, err error)
- func SetBytes(rw ReadWriterAt, b []byte) error
- func SetString(rw ReadWriterAt, s string) error
- func ToLowerAsciiCopy(p []byte) []byte
- func WordAtIndex(r ReaderAt, index int) ([]byte, int, error)
- func WordIsolated(r ReaderAt, i, le int) bool
- type BytesReadWriterAt
- type LimitedReaderAt
- type RWEvPreWrite
- type RWEvWrite
- type RWEvWrite2
- type RWEvents
- type ReadWriterAt
- type ReaderAt
- type WriterAt
Constants ¶
const ( RWEvIdWrite = iota // ev=RWEvWrite RWEvIdWrite2 // ev=RWEvWrite2 RWEvIdPreWrite // ev=RWEvPreWrite )
const EndRune = -1
Variables ¶
This section is empty.
Functions ¶
func Append ¶ added in v1.3.0
func Append(rw ReadWriterAt, b []byte) error
func ExpandRuneIndexFn ¶ added in v1.3.0
// Returns index where truth was found.
func ExpandRuneLastIndexFn ¶ added in v1.3.0
Returns last index before truth was found.
func IsWordRune ¶
Also used at: selectword, movecursorjump{left,right}
func LineEndIndex ¶
index after '\n' (with isNewLine true), or max index
func MakeBytesCopy ¶ added in v1.3.0
func ReadFastFull ¶ added in v1.3.0
Result might not be a copy.
func ReadFullCopy ¶ added in v1.3.0
Result might not be a copy.
func ReaderIter ¶
Iterate over n+1 runes, with the last rune being eofRune(-1).
func RuneIndexFn ¶ added in v1.3.0
On error, returns best failing index. Use errors.Is(err, io.EOF) to handle limitedreaders.
func RuneLastIndexFn ¶ added in v1.3.0
On error, returns best failing index. Use errors.Is(err, io.EOF) to handle limitedreaders.
func SetBytes ¶ added in v1.3.0
func SetBytes(rw ReadWriterAt, b []byte) error
func SetString ¶
func SetString(rw ReadWriterAt, s string) error
func ToLowerAsciiCopy ¶
Lower case at byte level without expanding in size the resulting byte slice.
func WordIsolated ¶
Types ¶
type BytesReadWriterAt ¶ added in v1.3.0
type BytesReadWriterAt struct {
// contains filtered or unexported fields
}
func NewBytesReadWriterAt ¶ added in v1.3.0
func NewBytesReadWriterAt(b []byte) *BytesReadWriterAt
func (*BytesReadWriterAt) Max ¶ added in v1.3.0
func (rw *BytesReadWriterAt) Max() int
Implement ReaderAt
func (*BytesReadWriterAt) Min ¶ added in v1.3.0
func (rw *BytesReadWriterAt) Min() int
Implement ReaderAt
func (*BytesReadWriterAt) OverwriteAt ¶ added in v1.3.0
func (rw *BytesReadWriterAt) OverwriteAt(i, del int, p []byte) error
Implement WriterAt
func (*BytesReadWriterAt) ReadFastAt ¶ added in v1.3.0
func (rw *BytesReadWriterAt) ReadFastAt(i, n int) ([]byte, error)
Implement ReaderAt
type LimitedReaderAt ¶ added in v1.3.0
type LimitedReaderAt struct { ReaderAt // contains filtered or unexported fields }
func NewLimitedReaderAt ¶ added in v1.3.0
func NewLimitedReaderAt(r ReaderAt, min, max int) *LimitedReaderAt
min<=max; allows arguments min<0 && max>length
func NewLimitedReaderAtPad ¶ added in v1.3.0
func NewLimitedReaderAtPad(r ReaderAt, min, max, pad int) *LimitedReaderAt
func (*LimitedReaderAt) Max ¶ added in v1.3.0
func (r *LimitedReaderAt) Max() int
func (*LimitedReaderAt) Min ¶ added in v1.3.0
func (r *LimitedReaderAt) Min() int
func (*LimitedReaderAt) ReadFastAt ¶ added in v1.3.0
func (r *LimitedReaderAt) ReadFastAt(i, n int) ([]byte, error)
type RWEvPreWrite ¶ added in v1.3.0
type RWEvWrite2 ¶ added in v1.3.0
type RWEvents ¶ added in v1.3.0
type RWEvents struct { ReadWriterAt EvReg evreg.Register }
Runs callbacks on operations.
func NewRWEvents ¶ added in v1.3.0
func NewRWEvents(rw ReadWriterAt) *RWEvents