xml

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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type XMLResult

type XMLResult struct {
	XMLName      xml.Name            `xml:"results"`
	XMLFiles     *XMLResultFiles     `xml:"files,omitempty"`
	XMLLanguages *XMLResultLanguages `xml:"languages,omitempty"`
}

XMLResult stores the results in XML format.

func NewXMLResultFromCloc

func NewXMLResultFromCloc(total *language.Language, sortedLanguages language.Languages, _ XMLResultType) *XMLResult

NewXMLResultFromCloc returns XMLResult with default data set.

func (*XMLResult) Encode

func (x *XMLResult) Encode()

Encode outputs XMLResult in a human readable format.

type XMLResultFiles

type XMLResultFiles struct {
	Files file.GClocFiles `xml:"file"`
	Total XMLTotalFiles   `xml:"total"`
}

XMLResultFiles stores per file results in XML format.

type XMLResultLanguages

type XMLResultLanguages struct {
	Languages []language.GClocLanguage `xml:"language"`
	Total     XMLTotalLanguages        `xml:"total"`
}

XMLResultLanguages stores the results in XML format.

type XMLResultType

type XMLResultType int8

XMLResultType is the result type in XML format.

const (
	// XMLResultWithLangs is the result type for each language in XML format
	XMLResultWithLangs XMLResultType = iota
	// XMLResultWithFiles is the result type for each file in XML format
	XMLResultWithFiles
)

type XMLTotalFiles

type XMLTotalFiles struct {
	Codes    uint32 `xml:"codes,attr"`
	Comments uint32 `xml:"comments,attr"`
	Blanks   uint32 `xml:"blanks,attr"`
}

XMLTotalFiles is the total result per file in XML format.

type XMLTotalLanguages

type XMLTotalLanguages struct {
	SumFiles uint32 `xml:"sum_files,attr"`
	Codes    uint32 `xml:"codes,attr"`
	Comments uint32 `xml:"comments,attr"`
	Blanks   uint32 `xml:"blanks,attr"`
}

XMLTotalLanguages is the total result in XML format.

Jump to

Keyboard shortcuts

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