MCPcopy Index your code
hub / github.com/godbus/dbus / Decode

Method Decode

decoder.go:62–84  ·  view source on GitHub ↗
(sig Signature)

Source from the content-addressed store, hash-verified

60}
61
62func (dec *decoder) Decode(sig Signature) (vs []any, err error) {
63 defer func() {
64 var ok bool
65 v := recover()
66 if err, ok = v.(error); ok {
67 if err == io.EOF || err == io.ErrUnexpectedEOF {
68 err = FormatError("unexpected EOF")
69 }
70 }
71 }()
72 vs = make([]any, 0)
73 s := sig.str
74 for s != "" {
75 err, rem := validSingle(s, &depthCounter{})
76 if err != nil {
77 return nil, err
78 }
79 v := dec.decode(s[:len(s)-len(rem)], 0)
80 vs = append(vs, v)
81 s = rem
82 }
83 return vs, nil
84}
85
86// read2buf reads exactly n bytes from the reader dec.in into the buffer dec.buf
87// to reduce memory allocs.

Callers 15

HandleDataMethod · 0.80
DecodeMessageWithFDsFunction · 0.80
FuzzProtoFunction · 0.80
ReadMessageMethod · 0.80
decodeMessageBodyFunction · 0.80
TestEncodeArrayOfMapsFunction · 0.80
TestEncodeSliceInterfaceFunction · 0.80

Calls 3

decodeMethod · 0.95
FormatErrorTypeAlias · 0.85
validSingleFunction · 0.85

Tested by 15

FuzzProtoFunction · 0.64
TestEncodeArrayOfMapsFunction · 0.64
TestEncodeSliceInterfaceFunction · 0.64
TestEncodeIntFunction · 0.64
TestEncodeUintFunction · 0.64