kmgGoReader

package
v0.0.0-...-05317bf Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2015 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FilePos

type FilePos struct {
	// contains filtered or unexported fields
}

func NewPosFile

func NewPosFile(filepath string, content []byte) *FilePos

func (*FilePos) GetLineWithPos

func (p *FilePos) GetLineWithPos(pos int) int

func (*FilePos) PosString

func (p *FilePos) PosString(pos int) string

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

func NewReader

func NewReader(buf []byte, filePos *FilePos) *Reader

func NewReaderWithPosFile

func NewReaderWithPosFile(filename string, content []byte) *Reader

func (*Reader) BufToCurrent

func (r *Reader) BufToCurrent(start int) []byte

func (*Reader) GetFileLineInfo

func (r *Reader) GetFileLineInfo() string

func (*Reader) IsEof

func (r *Reader) IsEof() bool

func (*Reader) IsMatchAfter

func (r *Reader) IsMatchAfter(s []byte) bool

func (*Reader) MustReadMatch

func (r *Reader) MustReadMatch(s []byte)

func (*Reader) MustReadWithSize

func (r *Reader) MustReadWithSize(size int) []byte

func (*Reader) NextByte

func (r *Reader) NextByte() byte

func (*Reader) Pos

func (r *Reader) Pos() int

func (*Reader) ReadAllSpace

func (r *Reader) ReadAllSpace()

func (*Reader) ReadAllSpaceWithoutLineBreak

func (r *Reader) ReadAllSpaceWithoutLineBreak()

func (*Reader) ReadByte

func (r *Reader) ReadByte() byte

func (*Reader) ReadRune

func (r *Reader) ReadRune() rune

func (*Reader) ReadUntilByte

func (r *Reader) ReadUntilByte(b byte) []byte

读取到某个字符,或者读取到结束(该字符会已经被读过)

func (*Reader) ReadUntilRuneCb

func (r *Reader) ReadUntilRuneCb(cb func(run rune) bool) []byte

回调返回真的时候,停止读取,(这个回调提到的字符串也包含在内)

func (*Reader) ReadUntilString

func (r *Reader) ReadUntilString(s []byte) []byte

读取到某个字符串,或者读取到结束(该字符串会已经被读过)

func (*Reader) UnreadByte

func (r *Reader) UnreadByte()

func (*Reader) UnreadRune

func (r *Reader) UnreadRune() rune

Jump to

Keyboard shortcuts

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