decSource decodes the float array from the specified source
(start xml.StartElement, data []byte, source *Source)
| 152 | |
| 153 | // decSource decodes the float array from the specified source |
| 154 | func (d *Decoder) decFloatArray(start xml.StartElement, data []byte, source *Source) error { |
| 155 | |
| 156 | // Create float array and associates it to the parent source |
| 157 | farray := &FloatArray{} |
| 158 | farray.Id = findAttrib(start, "id").Value |
| 159 | farray.Count, _ = strconv.Atoi(findAttrib(start, "count").Value) |
| 160 | source.ArrayElement = farray |
| 161 | |
| 162 | // Allocates memory for array |
| 163 | farray.Data = make([]float32, farray.Count, farray.Count) |
| 164 | |
| 165 | // Reads the numbers from the data |
| 166 | err := decFloat32Sequence(data, farray.Data) |
| 167 | if err != nil { |
| 168 | return err |
| 169 | } |
| 170 | return nil |
| 171 | } |
| 172 | |
| 173 | func (d *Decoder) decNameArray(start xml.StartElement, data []byte, source *Source) error { |
| 174 |
no test coverage detected