efile

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseDocumentHeader

func ParseDocumentHeader(line string) (*klists.KList[*EAttribute], error)

func ParseETable

func ParseETable(root *ENode, path string) (*klists.KList[*klists.KList[string]], error)

@bref 解析一个节点下的表格数据,并返回 指定节点的结果集

func ParseETables added in v0.4.3

func ParseETables(root *ENode) (map[string]*klists.KList[*klists.KList[string]], error)

@bref 解析所有表格数据,并返回 所有表与结果集

func ParseEText

func ParseEText(line string, sep string) (*klists.KList[string], error)

@bref 解析一行 e文本数据

func ParseNodeLine

func ParseNodeLine(line string) (string, bool, *klists.KList[*EAttribute], error)

@bref 解析一行 xml element

@param `line` `string` 一行单个 xml element, 例如 `<a f=1 h=2 />`, 假如是 `<a f=1 h=2 /></a>` 会解析失败

@return

		string: 解析出来的name字段
		bool:   是否为自闭合语句; 例如: <a f=1 h=2 />
	 *klists.KList[*EAttribute]: 解析出来的属性列表
  error: 错误信息

Types

type EAttribute

type EAttribute struct {
	Name  string
	Value string
}

type ENode

type ENode struct {
	Id uint32

	Name  string
	Value *bytes.Buffer

	Attribes map[string]string     //  []*EAttribute
	Children *klists.KList[*ENode] //  []*ENode
	// contains filtered or unexported fields
}

func GetENodeByPath

func GetENodeByPath(root *ENode, path string) (*ENode, error)

func NewNode

func NewNode(id uint32, parent *ENode, name string, attributes map[string]string, pChildren *klists.KList[*ENode]) *ENode

func ParseRootBytes

func ParseRootBytes(buf *bytes.Buffer) (*ENode, error)

func ParseRootEFile

func ParseRootEFile(path string) (*ENode, error)

func ParseRootString

func ParseRootString(content string) (*ENode, error)

func (*ENode) AddAttribute

func (node *ENode) AddAttribute(name string, value string)

func (*ENode) AddChildren

func (node *ENode) AddChildren(children *ENode)

func (*ENode) DelAttribute

func (node *ENode) DelAttribute(name string)

func (*ENode) DelChildrenById

func (node *ENode) DelChildrenById(id uint32)

func (*ENode) DelChildrenByName

func (node *ENode) DelChildrenByName(name string)

func (*ENode) FindFirstNodeById

func (node *ENode) FindFirstNodeById(id uint32) *ENode

按id从tree结构中获取指定node

func (*ENode) FindFirstNodeByName

func (node *ENode) FindFirstNodeByName(name string) *ENode

按name从tree结构中获取指定node

func (*ENode) GetAttribute

func (node *ENode) GetAttribute(name string) (string, error)

func (*ENode) GetENodeById

func (node *ENode) GetENodeById(id uint32) *ENode

func (*ENode) GetENodeByName

func (node *ENode) GetENodeByName(name string) *ENode

func (*ENode) ToJson

func (node *ENode) ToJson() string

Jump to

Keyboard shortcuts

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