// InterpretInto interprets a raw DataRecord into an existing slice of
// InterpretedFields. If the slice is not long enough it will be reallocated.
InterpretInto interprets a raw DataRecord into an existing slice of
InterpretedFields. If the slice is not long enough it will be reallocated.
// InterpretInto interprets a raw DataRecord into an existing slice of // InterpretedFields . If the slice is not long enough it will be reallocated .
func (i *Interpreter) InterpretInto(rec DataRecord, fieldList []InterpretedField) []InterpretedField {
	tpl := i.session.lookupTemplateFieldSpecifiers(rec.TemplateID)
	if tpl == nil {
		return nil
	}
	if len(fieldList) < len(tpl) {
		fieldList = make([]InterpretedField, len(tpl))
	} else {
		fieldList = fieldList[:len(tpl)]
	}
	for j, field := range tpl {
		fieldList[j].FieldID = field.FieldID
		fieldList[j].EnterpriseID = field.EnterpriseID
		if entry, ok := i.dictionary[dictionaryKey{field.EnterpriseID, field.FieldID}]; ok {
			fieldList[j].Name = entry.Name
			fieldList[j].Value = interpretBytes(&rec.Fields[j], entry.Type)
		} else {
			fieldList[j].RawValue = rec.Fields[j]
		}
	}
	return fieldList
}
func ( i * Interpreter ) InterpretInto ( rec DataRecord , fieldList [ ] InterpretedField ) [ ] InterpretedField { tpl := i . session . lookupTemplateFieldSpecifiers ( rec . TemplateID ) if tpl == nil { return nil } if len ( fieldList ) < len ( tpl ) { fieldList = make ( [ ] InterpretedField , len ( tpl ) ) } else { fieldList = fieldList [ : len ( tpl ) ] } for j , field := range tpl { fieldList [ j ] . FieldID = field . FieldID fieldList [ j ] . EnterpriseID = field . EnterpriseID if entry , ok := i . dictionary [ dictionaryKey { field . EnterpriseID , field . FieldID } ] ; ok { fieldList [ j ] . Name = entry . Name fieldList [ j ] . Value = interpretBytes ( & rec . Fields [ j ] , entry . Type ) } else { fieldList [ j ] . RawValue = rec . Fields [ j ] } } return fieldList }
InterpretInto interprets a raw DataRecord into an existing slice of
InterpretedFields.
InterpretInto interprets a raw DataRecord into an existing slice of InterpretedFields .