linereader

package
v0.0.0-...-944e809 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LineReader

type LineReader struct {
	R        *bufio.Reader
	FileName string
	LineNum  int
}

LineReader read text stream line by line

func New

func New(r io.Reader, filename string) *LineReader

New create LineReader from io.Reader,

note: use &LineReader{br, filename, 0} to create from bufio.Reader

func (*LineReader) Error

func (lr *LineReader) Error(snippet, msg string) error

Error create an error with current file name and line number information

func (*LineReader) ReadLine

func (lr *LineReader) ReadLine(lineEnd byte, trim bool, skipEmpty bool) (s string, err error)

ReadLine read next line, for example lr.ReadLine('\n', true, true)

Jump to

Keyboard shortcuts

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