reference

package
v1.1.12 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2021 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidRefString = fmt.Errorf("invalid refence string")

Functions

func IsReference

func IsReference(str string) bool

Types

type Reference

type Reference struct {
	Type
	File  string
	Table string
	Row   string // empty for score tables
	Col   string
	Part  string // empty for shortcut tables
}

func NewFileCtx

func NewFileCtx(file string) Reference

func NewScoreColCtx

func NewScoreColCtx(file, table, col string) Reference

func NewScoreCtx

func NewScoreCtx(file, table string) Reference

func NewShortCutCtx

func NewShortCutCtx(file, table string) Reference

func Parse

func Parse(ref string) (r *Reference, err error)

func ParseContext

func ParseContext(ctx string) (r *Reference, err error)

ParseContext tries to guess the context from the given string. Returns an error, if the context is not complete.

func (Reference) Cols

func (r Reference) Cols() []string

Cols returns the columns

func (*Reference) Complete

func (r *Reference) Complete(ctx Reference) error

Complete tries to complete the reference via the given context reference

func (Reference) Dup added in v1.0.30

func (r Reference) Dup() Reference

func (Reference) IsComplete

func (r Reference) IsComplete() bool

IsComplete checks, if the reference is complete

func (Reference) String

func (r Reference) String() string

'piano=SCORE.timbre[CHORUS] 'piano=SCORE.timbre 'piano=SCORE 'piano =SCORE.timbre[CHORUS] =SCORE.timbre =SCORE =.timbre[CHORUS] =.timbre 'piano=.timbre[CHORUS] 'piano=.timbre 'piano=SCORE[CHORUS]

oder

'UVI.ks.tremolo.cello 'UVI.ks.tremolo .ks.tremolo.cello .ks.tremolo

func (Reference) Valid

func (r Reference) Valid() bool

Valid checks, if the reference is valid

type Type

type Type int
const (
	Unknown Type = iota
	File
	Score
	ShortCut
	ShortCutCell
	ScoreCol
	ScorePart
	ScoreColPart
	FileCtx
	ScoreCtx
	ScoreColCtx
	ShortCutCtx
)

func (Type) String

func (t Type) String() string

Jump to

Keyboard shortcuts

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