mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-20 21:17:31 +00:00
[JS/TS] Size prefix support (#5326)
* WIP size prefix support * Consider size prefix in overloaded variant * Work on code gen * Disabled helper functions in code gen * Enabled helper functions in code gen * Fix size prefixed test * Fix bad function call * Add SIZE_PREFIX_LENGTH * Fix review comments
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
b56d60f058
commit
0bb3ce6935
@@ -65,6 +65,15 @@ NamespaceA.NamespaceB.TableInNestedNS.getRootAsTableInNestedNS = function(bb, ob
|
||||
return (obj || new NamespaceA.NamespaceB.TableInNestedNS).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.ByteBuffer} bb
|
||||
* @param {NamespaceA.NamespaceB.TableInNestedNS=} obj
|
||||
* @returns {NamespaceA.NamespaceB.TableInNestedNS}
|
||||
*/
|
||||
NamespaceA.NamespaceB.TableInNestedNS.getSizePrefixedRootAsTableInNestedNS = function(bb, obj) {
|
||||
return (obj || new NamespaceA.NamespaceB.TableInNestedNS).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {number}
|
||||
*/
|
||||
|
||||
@@ -38,6 +38,15 @@ static getRootAsTableInNestedNS(bb:flatbuffers.ByteBuffer, obj?:TableInNestedNS)
|
||||
return (obj || new TableInNestedNS).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param flatbuffers.ByteBuffer bb
|
||||
* @param TableInNestedNS= obj
|
||||
* @returns TableInNestedNS
|
||||
*/
|
||||
static getSizePrefixedRootAsTableInNestedNS(bb:flatbuffers.ByteBuffer, obj?:TableInNestedNS):TableInNestedNS {
|
||||
return (obj || new TableInNestedNS).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns number
|
||||
*/
|
||||
|
||||
@@ -53,6 +53,15 @@ NamespaceA.TableInFirstNS.getRootAsTableInFirstNS = function(bb, obj) {
|
||||
return (obj || new NamespaceA.TableInFirstNS).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.ByteBuffer} bb
|
||||
* @param {NamespaceA.TableInFirstNS=} obj
|
||||
* @returns {NamespaceA.TableInFirstNS}
|
||||
*/
|
||||
NamespaceA.TableInFirstNS.getSizePrefixedRootAsTableInFirstNS = function(bb, obj) {
|
||||
return (obj || new NamespaceA.TableInFirstNS).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {NamespaceA.NamespaceB.TableInNestedNS=} obj
|
||||
* @returns {NamespaceA.NamespaceB.TableInNestedNS|null}
|
||||
@@ -184,6 +193,15 @@ NamespaceC.TableInC.getRootAsTableInC = function(bb, obj) {
|
||||
return (obj || new NamespaceC.TableInC).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.ByteBuffer} bb
|
||||
* @param {NamespaceC.TableInC=} obj
|
||||
* @returns {NamespaceC.TableInC}
|
||||
*/
|
||||
NamespaceC.TableInC.getSizePrefixedRootAsTableInC = function(bb, obj) {
|
||||
return (obj || new NamespaceC.TableInC).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {NamespaceA.TableInFirstNS=} obj
|
||||
* @returns {NamespaceA.TableInFirstNS|null}
|
||||
@@ -282,6 +300,15 @@ NamespaceA.SecondTableInA.getRootAsSecondTableInA = function(bb, obj) {
|
||||
return (obj || new NamespaceA.SecondTableInA).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.ByteBuffer} bb
|
||||
* @param {NamespaceA.SecondTableInA=} obj
|
||||
* @returns {NamespaceA.SecondTableInA}
|
||||
*/
|
||||
NamespaceA.SecondTableInA.getSizePrefixedRootAsSecondTableInA = function(bb, obj) {
|
||||
return (obj || new NamespaceA.SecondTableInA).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {NamespaceC.TableInC=} obj
|
||||
* @returns {NamespaceC.TableInC|null}
|
||||
|
||||
@@ -29,6 +29,15 @@ static getRootAsTableInFirstNS(bb:flatbuffers.ByteBuffer, obj?:TableInFirstNS):T
|
||||
return (obj || new TableInFirstNS).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param flatbuffers.ByteBuffer bb
|
||||
* @param TableInFirstNS= obj
|
||||
* @returns TableInFirstNS
|
||||
*/
|
||||
static getSizePrefixedRootAsTableInFirstNS(bb:flatbuffers.ByteBuffer, obj?:TableInFirstNS):TableInFirstNS {
|
||||
return (obj || new TableInFirstNS).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param NamespaceA.NamespaceB.TableInNestedNS= obj
|
||||
* @returns NamespaceA.NamespaceB.TableInNestedNS|null
|
||||
@@ -147,6 +156,15 @@ static getRootAsTableInC(bb:flatbuffers.ByteBuffer, obj?:TableInC):TableInC {
|
||||
return (obj || new TableInC).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param flatbuffers.ByteBuffer bb
|
||||
* @param TableInC= obj
|
||||
* @returns TableInC
|
||||
*/
|
||||
static getSizePrefixedRootAsTableInC(bb:flatbuffers.ByteBuffer, obj?:TableInC):TableInC {
|
||||
return (obj || new TableInC).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param NamespaceA.TableInFirstNS= obj
|
||||
* @returns NamespaceA.TableInFirstNS|null
|
||||
@@ -233,6 +251,15 @@ static getRootAsSecondTableInA(bb:flatbuffers.ByteBuffer, obj?:SecondTableInA):S
|
||||
return (obj || new SecondTableInA).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param flatbuffers.ByteBuffer bb
|
||||
* @param SecondTableInA= obj
|
||||
* @returns SecondTableInA
|
||||
*/
|
||||
static getSizePrefixedRootAsSecondTableInA(bb:flatbuffers.ByteBuffer, obj?:SecondTableInA):SecondTableInA {
|
||||
return (obj || new SecondTableInA).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param NamespaceC.TableInC= obj
|
||||
* @returns NamespaceC.TableInC|null
|
||||
|
||||
Reference in New Issue
Block a user