MCPcopy Create free account
hub / github.com/ZeppelinMC/Zeppelin / decodeMapString

Method decodeMapString

protocol/nbt/qnbt/map.go:5–30  ·  view source on GitHub ↗
(m map[string]string)

Source from the content-addressed store, hash-verified

3import "fmt"
4
5func (d *Decoder) decodeMapString(m map[string]string) error {
6 var name string
7 for {
8 tag, err := d.rd.readBytesString(1)
9 if err != nil {
10 return err
11 }
12
13 if tag == end_t_b {
14 return nil
15 }
16 if err := d.readStringNonCopy(&name); err != nil {
17 return err
18 }
19
20 if tag != string_t_b {
21 return fmt.Errorf("expected string tag, got %s", tagName(tag))
22 }
23
24 var v string
25 if err := d.readString(&v); err != nil {
26 return err
27 }
28 m[name] = v
29 }
30}

Callers 2

decodeStructCompoundMethod · 0.95
readListArrayMethod · 0.95

Calls 4

readStringNonCopyMethod · 0.95
readStringMethod · 0.95
tagNameFunction · 0.85
readBytesStringMethod · 0.80

Tested by

no test coverage detected