goview

package
v0.35.2 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Source added in v0.14.0

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

Source stores a list of lines, typically a continuous section of source code that forms a part of (or the entirety of) a whole source file.

func NewSource added in v0.14.0

func NewSource() *Source

NewSource returns a new Source

func (*Source) Contents added in v0.14.0

func (source *Source) Contents() string

Contents returns the stringified contents this SourceFile.

func (*Source) P added in v0.14.0

func (source *Source) P(format string, args ...interface{})

P writes a new line of content to this SourceFile. The arguments are treated exactly as in fmt.Printf. Note that there is an implicit in the SourceFile contents "\n" after each call to P().

type SourceFile

type SourceFile struct {
	Directory string
	Name      string // without any directory components
	// contains filtered or unexported fields
}

SourceFile contains a single file to be output, including both its content and location.

func NewFile

func NewFile(directory, name string) *SourceFile

NewFile creates an empty SourceFile with the specified Directory and Name.

func (*SourceFile) Append added in v0.14.0

func (sf *SourceFile) Append(source *Source)

Append appends the lines in Source to the lines in SourceFile.

func (*SourceFile) Contents

func (sf *SourceFile) Contents() string

Contents returns the stringified contents this SourceFile.

func (*SourceFile) P

func (sf *SourceFile) P(format string, args ...interface{})

P appends a printf-formatted line to SourcerFile.

type View

type View struct {
	Files []*SourceFile
}

View contains a list of files to be output.

func New

func New(capacity int) *View

New returns a new, empty View.

func (*View) Append

func (view *View) Append(file *SourceFile) *SourceFile

Append appends file to this View.

Jump to

Keyboard shortcuts

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