MCPcopy Create free account
hub / github.com/brimdata/super / readTypeEnum

Method readTypeEnum

sio/bsupio/types.go:368–386  ·  view source on GitHub ↗
(b *buffer)

Source from the content-addressed store, hash-verified

366}
367
368func (d *Decoder) readTypeEnum(b *buffer) error {
369 nsym, err := readUvarintAsInt(b)
370 if err != nil {
371 return errBadFormat
372 }
373 if nsym > super.MaxEnumSymbols {
374 return fmt.Errorf("too many enum symbols encountered (%d)", nsym)
375 }
376 var symbols []string
377 for range nsym {
378 s, err := d.readCountedString(b)
379 if err != nil {
380 return err
381 }
382 symbols = append(symbols, s)
383 }
384 d.enter(d.sctx.LookupTypeEnum(symbols))
385 return nil
386}
387
388func (d *Decoder) readCountedString(b *buffer) (string, error) {
389 n, err := readUvarintAsInt(b)

Callers 1

decodeMethod · 0.95

Calls 4

readCountedStringMethod · 0.95
enterMethod · 0.95
readUvarintAsIntFunction · 0.85
LookupTypeEnumMethod · 0.80

Tested by

no test coverage detected