mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-27 00:12:19 +00:00
TS: Add missing generate files (#8075)
Co-authored-by: Michael Le <michael.le647@gmail.com>
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { KeyValue, KeyValueT } from '../reflection/key-value.js';
|
||||
@@ -205,12 +207,31 @@ mutate_padding(value:number):boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* If the field uses 64-bit offsets.
|
||||
*/
|
||||
offset64():boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 30);
|
||||
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
|
||||
}
|
||||
|
||||
mutate_offset64(value:boolean):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 30);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bb!.writeInt8(this.bb_pos + offset, +value);
|
||||
return true;
|
||||
}
|
||||
|
||||
static getFullyQualifiedName():string {
|
||||
return 'reflection.Field';
|
||||
}
|
||||
|
||||
static startField(builder:flatbuffers.Builder) {
|
||||
builder.startObject(13);
|
||||
builder.startObject(14);
|
||||
}
|
||||
|
||||
static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset) {
|
||||
@@ -289,6 +310,10 @@ static addPadding(builder:flatbuffers.Builder, padding:number) {
|
||||
builder.addFieldInt16(12, padding, 0);
|
||||
}
|
||||
|
||||
static addOffset64(builder:flatbuffers.Builder, offset64:boolean) {
|
||||
builder.addFieldInt8(13, +offset64, +false);
|
||||
}
|
||||
|
||||
static endField(builder:flatbuffers.Builder):flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4) // name
|
||||
@@ -311,7 +336,8 @@ unpack(): FieldT {
|
||||
this.bb!.createObjList<KeyValue, KeyValueT>(this.attributes.bind(this), this.attributesLength()),
|
||||
this.bb!.createScalarList<string>(this.documentation.bind(this), this.documentationLength()),
|
||||
this.optional(),
|
||||
this.padding()
|
||||
this.padding(),
|
||||
this.offset64()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -330,6 +356,7 @@ unpackTo(_o: FieldT): void {
|
||||
_o.documentation = this.bb!.createScalarList<string>(this.documentation.bind(this), this.documentationLength());
|
||||
_o.optional = this.optional();
|
||||
_o.padding = this.padding();
|
||||
_o.offset64 = this.offset64();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -347,7 +374,8 @@ constructor(
|
||||
public attributes: (KeyValueT)[] = [],
|
||||
public documentation: (string)[] = [],
|
||||
public optional: boolean = false,
|
||||
public padding: number = 0
|
||||
public padding: number = 0,
|
||||
public offset64: boolean = false
|
||||
){}
|
||||
|
||||
|
||||
@@ -371,6 +399,7 @@ pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||
Field.addDocumentation(builder, documentation);
|
||||
Field.addOptional(builder, this.optional);
|
||||
Field.addPadding(builder, this.padding);
|
||||
Field.addOffset64(builder, this.offset64);
|
||||
|
||||
return Field.endField(builder);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user