MCPcopy Create free account
hub / github.com/google/gapid / xml

Method xml

core/os/android/binaryxml/xml_start_element.go:82–100  ·  view source on GitHub ↗
(ctx *xmlContext)

Source from the content-addressed store, hash-verified

80}
81
82func (c *xmlStartElement) xml(ctx *xmlContext) string {
83 b := bytes.Buffer{}
84 b.WriteString(strings.Repeat(ctx.tab, ctx.indent))
85 b.WriteRune('<')
86 b.WriteString(c.name.get())
87 if ns, ok := ctx.stack.head().(*xmlStartNamespace); ok {
88 b.WriteRune('\n')
89 b.WriteString(strings.Repeat(ctx.tab, ctx.indent+2))
90 b.WriteString(`xmlns:`)
91 b.WriteString(ns.namespacePrefix.get())
92 b.WriteString(`="`)
93 b.WriteString(ns.namespaceURI.get())
94 b.WriteString(`" `)
95 }
96 b.WriteString(c.attributes.xml(ctx))
97 b.WriteRune('>')
98 c.updateContext(ctx)
99 return b.String()
100}
101
102func (c *xmlStartElement) encode() []byte {
103 return encodeChunk(resXMLStartElementType, func(w binary.Writer) {

Callers

nothing calls this directly

Calls 7

updateContextMethod · 0.95
WriteStringMethod · 0.80
getMethod · 0.65
xmlMethod · 0.65
StringMethod · 0.65
WriteRuneMethod · 0.45
headMethod · 0.45

Tested by

no test coverage detected