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 HasSuffix(r ReaderAt, i int, s []byte) bool
- func Index(r ReaderAt, i int, sep []byte, ignoreCase bool) (int, int, error)
- func IndexCtx(ctx context.Context, r ReaderAt, i int, sep []byte, opt *IndexOpt) (index int, n int, _ error)
- func IsWordRune(ru rune) bool
- func LastIndex(r ReaderAt, i int, sep []byte, ignoreCase bool) (int, int, error)
- func LastIndexCtx(ctx context.Context, r ReaderAt, i int, sep []byte, opt *IndexOpt) (int, int, error)
- 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 NewScanner(rd ReaderAt) *pscan.Scanner
- 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 WordAtIndex(r ReaderAt, index int) ([]byte, int, error)
- func WordIsolated(r ReaderAt, i, le int) bool
- type BytesReadWriterAt
- type IndexOpt
- 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 IndexCtx ¶
func IndexCtx(ctx context.Context, r ReaderAt, i int, sep []byte, opt *IndexOpt) (index int, n int, _ error)
Returns (-1, 0, nil) if not found.
func IsWordRune ¶
Also used at: selectword, movecursorjump{left,right}
func LastIndexCtx ¶ added in v1.3.4
func LastIndexCtx(ctx context.Context, r ReaderAt, i int, sep []byte, opt *IndexOpt) (int, int, error)
Returns (-1, 0, nil) if not found.
func LineEndIndex ¶
index after '\n' (with isNewLine true), or max index
func NewScanner ¶ added in v1.3.7
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 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 IndexOpt ¶ added in v1.3.4
type IndexOpt struct { IgnoreCase bool IgnoreCaseDiacritics bool // also lower the case of diacritics (slow) IgnoreDiacritics bool }
func (*IndexOpt) IgnoringDiacritics ¶ added in v1.3.4
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