MCPcopy Create free account
hub / github.com/Tencent/UnLua / lpb_unpackfield

Function lpb_unpackfield

Plugins/UnLuaExtensions/LuaProtobuf/Source/src/pb.cpp:1927–1945  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1925}
1926
1927static int lpb_unpackfield(lpb_Env *e, const pb_Field* f, uint32_t tag, int last) {
1928 if (!f) {
1929 pb_skipvalue(e->s, tag);
1930 return 0;
1931 }
1932 if (f->type && f->type->is_map) {
1933 lpbD_checktype(e, f, tag);
1934 if (!last) lua_newtable(e->L);
1935 lpbD_map(e, f);
1936 }
1937 else if (f->repeated) {
1938 if (!last) lua_newtable(e->L);
1939 lpbD_repeated(e, f, tag);
1940 }
1941 else {
1942 lpbD_field(e, f, tag);
1943 }
1944 return f->sort_index;
1945}
1946
1947static int lpbD_unpack(lpb_Env* e, const pb_Type* t) {
1948 lua_State* L = e->L;

Callers 1

lpbD_unpackFunction · 0.85

Calls 5

pb_skipvalueFunction · 0.85
lpbD_checktypeFunction · 0.85
lpbD_mapFunction · 0.85
lpbD_repeatedFunction · 0.85
lpbD_fieldFunction · 0.85

Tested by

no test coverage detected