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 ¶
View Source
const ( RWEvIdWrite = iota // ev=RWEvWrite RWEvIdWrite2 // ev=RWEvWrite2 RWEvIdPreWrite // ev=RWEvPreWrite )
View Source
const EndRune = -1
Variables ¶
This section is empty.
Functions ¶
func Append ¶
func Append(rw ReadWriterAt, b []byte) error
func ExpandRuneIndexFn ¶
// Returns index where truth was found.
func ExpandRuneLastIndexFn ¶
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 ¶
func ReaderIter ¶
Iterate over n+1 runes, with the last rune being eofRune(-1).
func RuneIndexFn ¶
On error, returns best failing index. Use errors.Is(err, io.EOF) to handle limitedreaders.
func RuneLastIndexFn ¶
On error, returns best failing index. Use errors.Is(err, io.EOF) to handle limitedreaders.
func SetBytes ¶
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 ¶
type BytesReadWriterAt struct {
// contains filtered or unexported fields
}
func NewBytesReadWriterAt ¶
func NewBytesReadWriterAt(b []byte) *BytesReadWriterAt
func (*BytesReadWriterAt) OverwriteAt ¶
func (rw *BytesReadWriterAt) OverwriteAt(i, del int, p []byte) error
Implement WriterAt
func (*BytesReadWriterAt) ReadFastAt ¶
func (rw *BytesReadWriterAt) ReadFastAt(i, n int) ([]byte, error)
Implement ReaderAt
type LimitedReaderAt ¶
type LimitedReaderAt struct { ReaderAt // contains filtered or unexported fields }
func NewLimitedReaderAt ¶
func NewLimitedReaderAt(r ReaderAt, min, max int) *LimitedReaderAt
min<=max; allows arguments min<0 && max>length
func NewLimitedReaderAtPad ¶
func NewLimitedReaderAtPad(r ReaderAt, min, max, pad int) *LimitedReaderAt
func (*LimitedReaderAt) Max ¶
func (r *LimitedReaderAt) Max() int
func (*LimitedReaderAt) Min ¶
func (r *LimitedReaderAt) Min() int
func (*LimitedReaderAt) ReadFastAt ¶
func (r *LimitedReaderAt) ReadFastAt(i, n int) ([]byte, error)
type RWEvPreWrite ¶
type RWEvWrite2 ¶
type RWEvents ¶
type RWEvents struct { ReadWriterAt EvReg evreg.Register }
Runs callbacks on operations.
func NewRWEvents ¶
func NewRWEvents(rw ReadWriterAt) *RWEvents
type ReadWriterAt ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.