MCPcopy Create free account
hub / github.com/dolthub/doltgresql / getJEntryAt

Function getJEntryAt

postgres/parser/json/jentry.go:96–109  ·  view source on GitHub ↗
(b []byte, idx int, offset int)

Source from the content-addressed store, hash-verified

94}
95
96func getJEntryAt(b []byte, idx int, offset int) (jEntry, error) {
97 enc, err := getUint32At(b, idx)
98 if err != nil {
99 return jEntry{}, err
100 }
101 length := enc & jEntryOffLenMask
102 if (enc & jEntryIsOffFlag) != 0 {
103 length -= uint32(offset)
104 }
105 return jEntry{
106 length: length,
107 typCode: enc & jEntryTypeMask,
108 }, nil
109}
110
111// decodeJEntry decodes a 4-byte JEntry from a buffer. The current offset is
112// required because a JEntry can either encode a length or an offset, and while

Callers 4

nextEncodedMethod · 0.85
nextEncodedMethod · 0.85
iterObjectMethod · 0.85
nthJEntryMethod · 0.85

Calls 1

getUint32AtFunction · 0.85

Tested by

no test coverage detected