uncsv

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cell

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

func (Cell) IsQuoted

func (c Cell) IsQuoted() bool

func (Cell) Modified

func (c Cell) Modified() bool

func (Cell) Quote

func (c Cell) Quote(mode *Mode) Cell

func (*Cell) Restore

func (c *Cell) Restore(mode *Mode)

func (Cell) Source added in v1.4.0

func (c Cell) Source() []byte

func (Cell) SourceText added in v1.4.0

func (c Cell) SourceText(m *Mode) string

func (Cell) Text

func (c Cell) Text() string

type Mode

type Mode struct {
	NonUTF8     bool
	Comma       byte
	DefaultTerm string
	// contains filtered or unexported fields
}

func (*Mode) Dump

func (mode *Mode) Dump(rows []Row, w io.Writer)

func (*Mode) HasBom

func (m *Mode) HasBom() bool

func (*Mode) IsUTF16BE added in v1.5.0

func (m *Mode) IsUTF16BE() bool

func (*Mode) IsUTF16LE added in v1.5.0

func (m *Mode) IsUTF16LE() bool

func (*Mode) SetEncoding

func (m *Mode) SetEncoding(name string) error

type Row

type Row struct {
	// Cell must have one or more element at least
	Cell []Cell
	// Term is one of "", "\n", and "\r\n"
	Term string
}

func NewRow

func NewRow(mode *Mode) Row

func ReadAll

func ReadAll(r io.Reader, mode *Mode) ([]Row, error)

func ReadLine

func ReadLine(br *bufio.Reader, mode *Mode) (*Row, error)

func (*Row) Delete

func (row *Row) Delete(i int)

func (*Row) Insert

func (row *Row) Insert(i int, text string, mode *Mode)

func (*Row) Rebuild

func (row *Row) Rebuild(mode *Mode) []byte

func (*Row) Replace

func (row *Row) Replace(i int, text string, mode *Mode)

Jump to

Keyboard shortcuts

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