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

Method encode

core/os/android/binaryxml/xml_start_element.go:102–119  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

100}
101
102func (c *xmlStartElement) encode() []byte {
103 return encodeChunk(resXMLStartElementType, func(w binary.Writer) {
104 w.Uint32(c.lineNumber)
105 c.comment.encode(w)
106 }, func(w binary.Writer) {
107 c.namespace.encode(w)
108 c.name.encode(w)
109 w.Uint16(20) // attributeStart
110 w.Uint16(xmlAttributeSize) // attributeSize
111 w.Uint16(uint16(len(c.attributes))) // attributeCount
112 w.Uint16(0) // id_index
113 w.Uint16(0) // class_index
114 w.Uint16(0) // style_index
115 for _, at := range c.attributes {
116 at.encode(w)
117 }
118 })
119}
120
121func (c *xmlStartElement) addAttribute(attr *xmlAttribute) {
122 c.attributes = append(c.attributes, *attr)

Callers

nothing calls this directly

Calls 4

encodeChunkFunction · 0.85
Uint32Method · 0.65
encodeMethod · 0.65
Uint16Method · 0.65

Tested by

no test coverage detected