lexml

package module
v0.0.0-...-b885f78 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatPrint

func FormatPrint(dataAltSlice []DataAlt)

Types

type Data

type Data struct {
	Type   *Tag
	Index  int
	Value  string
	Inners []Data
}

Data type is a recursive representation of a parsed XML file content

func (Data) Alter

func (data Data) Alter() DataAlt

Alter method generate a DataAlt Type

func (Data) LookupId

func (data Data) LookupId(id int) []DataAlt

LookupId method search recursively throught the Content of a given Set Type and returns a list of pointers to every Data elements that are equal to the given id

func (Data) LookupIndex

func (data Data) LookupIndex(depth int, x int, y int) DataAlt

LookupIndex method search recursively througt the Content of a given Set Type and returns the element present at a specific index of a given depth. depth is based on x and y is the index in the Inners Type

func (Data) LookupName

func (data Data) LookupName(name string) []DataAlt

LookupName method search recursively throught the Content of a given Set Type and returns a list of pointers to every Data elements that are equal to the given id

func (Data) PreFormatAll

func (data Data) PreFormatAll() []DataAlt

type DataAlt

type DataAlt struct {
	Type  *Tag
	Index int
	Value string
}

DataAlt type is an altered Data Type without the Inners element, it's used when returning a list of specific Data elements from a LookupId, LookupName or LookupIndex functions

type Set

type Set struct {
	Fields  []Tag
	Content Data
	Raw     []byte
}

Set type is the entrypoint struct to interact with this program with Fields as a list of Tag types, Content that represent the whole XML file, Raw wich represent the raw byte data of the file

func NewSet

func NewSet(buff []byte) *Set

NewSet function generates a set that's retuned as pointer

func (Set) Parse

func (set Set) Parse() ([]Tag, Data, error)

Parse method convert the whole file into a DataSet datastructure

type Tag

type Tag struct {
	Id   int
	Name string
}

Tags type represent fields of a XML file, those are generated on the go

Jump to

Keyboard shortcuts

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