generic json for fix messages
This commit is contained in:
@ -89,6 +89,24 @@ func (m FieldMap) Get(parser Field) MessageRejectError {
|
||||
return m.GetField(parser.Tag(), parser)
|
||||
}
|
||||
|
||||
// RawValues returns a copy of the underlying TagValue slice for a tag.
|
||||
// For repeating groups, the first entry is the count and the remaining
|
||||
// entries are the flattened inner-field values across all repetitions.
|
||||
func (m FieldMap) RawValues(tag Tag) []TagValue {
|
||||
m.rwLock.RLock()
|
||||
defer m.rwLock.RUnlock()
|
||||
|
||||
f, ok := m.tagLookup[tag]
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
out := make([]TagValue, len(f))
|
||||
copy(out, f)
|
||||
|
||||
return out
|
||||
}
|
||||
|
||||
// Has returns true if the Tag is present in this FieldMap.
|
||||
func (m FieldMap) Has(tag Tag) bool {
|
||||
m.rwLock.RLock()
|
||||
|
||||
@ -86,6 +86,16 @@ func (tv TagValue) String() string {
|
||||
return string(tv.bytes)
|
||||
}
|
||||
|
||||
// Tag returns the FIX tag for this TagValue.
|
||||
func (tv TagValue) Tag() Tag {
|
||||
return tv.tag
|
||||
}
|
||||
|
||||
// Value returns the raw FIX value bytes for this TagValue.
|
||||
func (tv TagValue) Value() []byte {
|
||||
return tv.value
|
||||
}
|
||||
|
||||
func bytesTotal(bytes []byte) (total int) {
|
||||
for _, b := range bytes {
|
||||
total += int(b)
|
||||
|
||||
Reference in New Issue
Block a user