organize_text

package
v0.0.0-...-381c4e2 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Assignment

type Assignment struct {
	IsRoot    bool
	Depth     int
	Etiketten kennung.EtikettSet
	Named     schnittstellen.MutableSetLike[*obj]
	Unnamed   schnittstellen.MutableSetLike[*obj]
	Children  []*Assignment
	Parent    *Assignment
}

func (Assignment) AlignmentSpacing

func (a Assignment) AlignmentSpacing() int

func (*Assignment) AllEtiketten

func (a *Assignment) AllEtiketten(mes kennung.EtikettMutableSet) (err error)

func (*Assignment) Contains

func (a *Assignment) Contains(e *kennung.Etikett) bool

func (Assignment) GetDepth

func (a Assignment) GetDepth() int

func (Assignment) MaxDepth

func (a Assignment) MaxDepth() (d int)

func (Assignment) MaxKopfUndSchwanz

func (a Assignment) MaxKopfUndSchwanz(
	o Options,
) (kopf, schwanz int)

func (Assignment) MaxLen

func (a Assignment) MaxLen() (m int)

func (*Assignment) SortChildren

func (parent *Assignment) SortChildren()

func (Assignment) String

func (a Assignment) String() (s string)

func (*Assignment) SubtractFromSet

func (a *Assignment) SubtractFromSet(es kennung.EtikettMutableSet) (err error)

type AssignmentTreeConstructor

type AssignmentTreeConstructor struct {
	Options
}

func (*AssignmentTreeConstructor) Assignments

func (atc *AssignmentTreeConstructor) Assignments() (roots []*Assignment, err error)

type Changes

type Changes struct {
	Changed SkuMap
	// contains filtered or unexported fields
}

func ChangesFrom

func ChangesFrom(
	a, b *Text,
	original sku.TransactedSet,
) (c Changes, err error)

type ErrorRead

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

type Factory

type Factory struct {
	Options
}

func (*Factory) Make

func (f *Factory) Make() (ot *Text, err error)

type Flags

type Flags struct {
	Options

	ExtraEtiketten collections_ptr.Flag[kennung.Etikett, *kennung.Etikett]
	// contains filtered or unexported fields
}

func MakeFlags

func MakeFlags() Flags

func MakeFlagsWithMetadatei

func MakeFlagsWithMetadatei(m metadatei.Metadatei) Flags

func (*Flags) AddToFlagSet

func (o *Flags) AddToFlagSet(f *flag.FlagSet)

func (*Flags) GetOptions

func (o *Flags) GetOptions(
	printOptions erworben_cli_print_options.PrintOptions,
	q *query.Group,
	organize *sku_fmt.Organize,
	organizeNew *sku_fmt.OrganizeNew,
	abbr kennung.Abbr,
) Options

type Metadatei

type Metadatei struct {
	kennung.EtikettSet
	Matchers schnittstellen.SetLike[sku.Query]
	Comments []string
	Typ      kennung.Typ
}

func (Metadatei) AsMetadatei

func (m Metadatei) AsMetadatei() (m1 metadatei.Metadatei)

func (Metadatei) GetOptionComments

func (m Metadatei) GetOptionComments(
	f optionCommentFactory,
) (ocs []Option, err error)

func (Metadatei) HasMetadateiContent

func (m Metadatei) HasMetadateiContent() bool

func (*Metadatei) ReadFrom

func (m *Metadatei) ReadFrom(r1 io.Reader) (n int64, err error)

func (Metadatei) RemoveFromTransacted

func (m Metadatei) RemoveFromTransacted(sk *sku.Transacted) (err error)

func (Metadatei) WriteTo

func (m Metadatei) WriteTo(w1 io.Writer) (n int64, err error)

type Option

type Option interface {
	GetOption() Option
	schnittstellen.Stringer
	ApplyToText(Options, *Assignment) error
	ApplyToReader(Options, *assignmentLineReader) error
	ApplyToWriter(Options, *assignmentLineWriter) error
}

type Options

type Options struct {
	Konfig *konfig.Compiled

	Typ               kennung.Typ
	GroupingEtiketten kennung.EtikettSlice
	ExtraEtiketten    kennung.EtikettSet
	Transacted        schnittstellen.SetLike[*sku.Transacted]

	Abbr kennung.Abbr

	UsePrefixJoints        bool
	UseRightAlignedIndents bool
	UseRefiner             bool
	UseMetadateiHeader     bool

	PrintOptions erworben_cli_print_options.PrintOptions
	// contains filtered or unexported fields
}

func (Options) Factory

func (o Options) Factory() *Factory

type Refiner

type Refiner struct {
	Enabled         bool
	UsePrefixJoints bool
}

func (*Refiner) Refine

func (atc *Refiner) Refine(a *Assignment) (err error)

passed-in assignment may be nil?

type SkuMap

type SkuMap map[string]*sku.Transacted

func (*SkuMap) Add

func (sm *SkuMap) Add(sk *sku.Transacted) error

func (*SkuMap) Clone

func (sm *SkuMap) Clone() SkuMap

func (*SkuMap) Del

func (sm *SkuMap) Del(sk *sku.Transacted) error

func (*SkuMap) Len

func (sm *SkuMap) Len() int

type Text

type Text struct {
	Options
	Metadatei
	*Assignment
}

func New

func New(options Options) (ot *Text, err error)

func (*Text) GetSkus

func (ot *Text) GetSkus(
	original sku.TransactedSet,
) (out map[string]*sku.Transacted, err error)

func (*Text) ReadFrom

func (t *Text) ReadFrom(r io.Reader) (n int64, err error)

func (*Text) Refine

func (t *Text) Refine() (err error)

func (Text) WriteTo

func (ot Text) WriteTo(out io.Writer) (n int64, err error)

Jump to

Keyboard shortcuts

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