Documentation
¶
Index ¶
- func ParseDocumentHeader(line string) (*klists.KList[*EAttribute], error)
- func ParseETable(root *ENode, path string) (*klists.KList[*klists.KList[string]], error)
- func ParseEText(line string, sep string) (*klists.KList[string], error)
- func ParseNodeLine(line string) (string, bool, *klists.KList[*EAttribute], error)
- type EAttribute
- type ENode
- func GetENodeByPath(root *ENode, path string) (*ENode, error)
- func NewNode(id uint32, parent *ENode, name string, attributes map[string]string, ...) *ENode
- func ParseRootBytes(buf *bytes.Buffer) (*ENode, error)
- func ParseRootEFile(path string) (*ENode, error)
- func ParseRootString(content string) (*ENode, error)
- func (node *ENode) AddAttribute(name string, value string)
- func (node *ENode) AddChildren(children *ENode)
- func (node *ENode) DelAttribute(name string)
- func (node *ENode) DelChildrenById(id uint32)
- func (node *ENode) DelChildrenByName(name string)
- func (node *ENode) FindFirstNodeById(id uint32) *ENode
- func (node *ENode) FindFirstNodeByName(name string) *ENode
- func (node *ENode) GetAttribute(name string) (string, error)
- func (node *ENode) GetENodeById(id uint32) *ENode
- func (node *ENode) GetENodeByName(name string) *ENode
- func (node *ENode) ToJson() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseDocumentHeader ¶
func ParseDocumentHeader(line string) (*klists.KList[*EAttribute], error)
func ParseETable ¶
func ParseEText ¶
@bref 解析一行 e文本数据
func ParseNodeLine ¶
@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 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 ParseRootEFile ¶
func ParseRootString ¶
func (*ENode) AddAttribute ¶
func (*ENode) AddChildren ¶
func (*ENode) DelAttribute ¶
func (*ENode) DelChildrenById ¶
func (*ENode) DelChildrenByName ¶
func (*ENode) FindFirstNodeById ¶
按id从tree结构中获取指定node
func (*ENode) FindFirstNodeByName ¶
按name从tree结构中获取指定node
func (*ENode) GetENodeById ¶
func (*ENode) GetENodeByName ¶
Click to show internal directories.
Click to hide internal directories.