file

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GClocFile

type GClocFile struct {
	Name     string `xml:"name,attr" json:"name"`         // Name of the file
	Language string `xml:"language,attr" json:"language"` // Language of the file
	Codes    uint32 `xml:"codes,attr" json:"codes"`       // Number of lines of code
	Comments uint32 `xml:"comments,attr" json:"comments"` // Number of lines of comments
	Blanks   uint32 `xml:"blanks,attr" json:"blanks"`     // Number of blank lines
}

GClocFile represents a file with its lines of code, comments and blanks.

func AnalyzeFile

func AnalyzeFile(filename string, language *language.Language, opts *option.GClocOptions) *GClocFile

AnalyzeFile analyzes a file and returns a GClocFile.

func AnalyzeReader

func AnalyzeReader(filename string, language *language.Language, file io.Reader, opts *option.GClocOptions) *GClocFile

type GClocFiles

type GClocFiles []GClocFile

GClocFiles is a slice of GClocFile.

func (GClocFiles) Len

func (gf GClocFiles) Len() int

Len returns the number of files.

func (GClocFiles) SortByBlanks

func (gf GClocFiles) SortByBlanks()

SortByBlanks sorts the files by number of blank lines. (DESC)

func (GClocFiles) SortByCodes

func (gf GClocFiles) SortByCodes()

SortByCodes sorts the files by number of lines of code. (DESC)

func (GClocFiles) SortByComments

func (gf GClocFiles) SortByComments()

SortByComments sorts the files by number of lines of comments. (DESC)

func (GClocFiles) SortByName

func (gf GClocFiles) SortByName()

SortByName sorts the files by name. (ASC)

Jump to

Keyboard shortcuts

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