MCPcopy
hub / github.com/ugorji/go / CodecEncodeSelf

Method CodecEncodeSelf

codec/values_codecgen_generated_test.go:6995–7038  ·  view source on GitHub ↗
(e *Encoder)

Source from the content-addressed store, hash-verified

6993
6994func (codecgenH) codecSelferViaCodecgen() {}
6995func (x *codecgenH) CodecEncodeSelf(e *Encoder) {
6996 var h codecSelfer19780
6997 z, r := GenHelper().Encoder(e)
6998 _, _, _ = h, z, r
6999 if z.EncBasicHandle().CheckCircularRef {
7000 z.EncEncode(x)
7001 return
7002 }
7003 if x == nil {
7004 r.EncodeNil()
7005 } else {
7006 yy2arr2 := z.EncBasicHandle().StructToArray
7007 _ = yy2arr2
7008 const yyr2 bool = false // struct tag has 'toArray'
7009 if yyr2 || yy2arr2 {
7010 z.EncWriteArrayStart(1)
7011 z.EncWriteArrayElem()
7012 r.EncodeInt(int64(x.TestCodecgenG.TestCodecgenG))
7013 z.EncWriteArrayEnd()
7014 } else {
7015 z.EncWriteMapStart(1)
7016 if z.EncBasicHandle().Canonical {
7017 z.EncWriteMapElemKey()
7018 if z.IsJSONHandle() {
7019 z.EncWr().WriteStr("\"TestCodecgenG\"")
7020 } else {
7021 r.EncodeString(`TestCodecgenG`)
7022 }
7023 z.EncWriteMapElemValue()
7024 r.EncodeInt(int64(x.TestCodecgenG.TestCodecgenG))
7025 } else {
7026 z.EncWriteMapElemKey()
7027 if z.IsJSONHandle() {
7028 z.EncWr().WriteStr("\"TestCodecgenG\"")
7029 } else {
7030 r.EncodeString(`TestCodecgenG`)
7031 }
7032 z.EncWriteMapElemValue()
7033 r.EncodeInt(int64(x.TestCodecgenG.TestCodecgenG))
7034 }
7035 z.EncWriteMapEnd()
7036 }
7037 }
7038}
7039
7040func (x *codecgenH) CodecDecodeSelf(d *Decoder) {
7041 var h codecSelfer19780

Callers

nothing calls this directly

Calls 15

GenHelperFunction · 0.85
EncoderMethod · 0.80
EncBasicHandleMethod · 0.80
EncEncodeMethod · 0.80
EncWriteArrayStartMethod · 0.80
EncWriteArrayElemMethod · 0.80
EncWriteArrayEndMethod · 0.80
EncWriteMapStartMethod · 0.80
EncWriteMapElemKeyMethod · 0.80
WriteStrMethod · 0.80
EncWrMethod · 0.80
EncWriteMapElemValueMethod · 0.80

Tested by

no test coverage detected