table

package
v1.2.18 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2021 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DEBUG bool

Functions

func Dash added in v1.0.32

func Dash(l int, length int) string

func LenUTF8

func LenUTF8(s string) int

func Pad

func Pad(s string, length int) string

pad pads the given string with empty space to the right if it is less then length

Types

type Filters

type Filters struct {
	*Table
}

func NewFilters

func NewFilters(lineNo int, sc Score) *Filters

type Formatter

type Formatter interface {
	WriteLine(line string) error
	WriteDashLine(line string) error
}

type Lyrics

type Lyrics struct {
	*Table
}

func NewLyrics

func NewLyrics(name string, lineNo int, sc Score) *Lyrics

func (*Lyrics) Finish

func (t *Lyrics) Finish() (err error)

type Properties

type Properties struct {
	*Table
}

func NewProperties

func NewProperties(lineNo int, sc Score) *Properties

func (*Properties) Finish

func (t *Properties) Finish() (err error)

type Scales

type Scales struct {
	*Table
}

func NewScales

func NewScales(lineNo int, sc Score) *Scales

func (*Scales) Finish

func (s *Scales) Finish() (err error)

type Score

type Score interface {
	AddTrack(*track.Track)
	AddTuning(t *tuning.Tuning)
	AddFilter(t *filter.Filter)
	AddScale(t items.Mode)
	AddTimbre(t *timbre.Timbre)
	AddSketch(name string) interface {
		ParseLine([]string) error
		AddColumn(string)
		SetRealColNum(n int)
		SetGroupCol(pos int, subcols []string)
	}
	AddProperty(key, value string)
	AddLyrics(map[string][]string)
	AddInclude(file, sketch string, params []string) error
	AddToken(key, value string)
	NoEmptyLines() bool
}

type Sketch

type Sketch struct {
	*Table
	// contains filtered or unexported fields
}

func NewSketch

func NewSketch(name string, lineNo int, sc Score) *Sketch

func (*Sketch) IsEmptyLine added in v1.0.34

func (s *Sketch) IsEmptyLine(data []string) bool

func (*Sketch) ParseLine

func (s *Sketch) ParseLine(line string) error

func (*Sketch) WriteTo

func (p *Sketch) WriteTo(f Formatter) error

type Table

type Table struct {
	Score Score

	Data [][]string // lines -> cols
	// contains filtered or unexported fields
}

func NewTable

func NewTable(name string, lineNo int, sc Score) *Table

func (*Table) AddCol

func (t *Table) AddCol(name string)

func (*Table) AddLine

func (t *Table) AddLine(data []string)

func (*Table) CalcColWidths

func (t *Table) CalcColWidths() error

func (*Table) Cols

func (t *Table) Cols() []string

func (*Table) Dash added in v1.0.32

func (i *Table) Dash(col int) string

func (*Table) Finish

func (t *Table) Finish() error

func (*Table) LineNo

func (t *Table) LineNo() int

func (*Table) Name

func (t *Table) Name() string

func (*Table) Pad

func (i *Table) Pad(col int, s string) string

func (*Table) ParseLine

func (t *Table) ParseLine(line string) error

func (*Table) WriteTo

func (t *Table) WriteTo(f Formatter) error

type Timbres

type Timbres struct {
	*Table
}

func NewTimbres

func NewTimbres(lineNo int, sc Score) *Timbres

type Tokens

type Tokens struct {
	*Table
}

func NewTokens

func NewTokens(name string, lineNo int, sc Score) *Tokens

func (*Tokens) Finish

func (t *Tokens) Finish() (err error)

type Tracks

type Tracks struct {
	*Table
}

func NewTracks

func NewTracks(lineNo int, sc Score) *Tracks

func (*Tracks) Finish

func (t *Tracks) Finish() (err error)

type Tunings

type Tunings struct {
	*Table
}

func NewTunings

func NewTunings(lineNo int, sc Score) *Tunings

Jump to

Keyboard shortcuts

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