• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// automatically generated by the FlatBuffers compiler, do not modify
2
3/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
4
5import * as flatbuffers from 'flatbuffers';
6
7
8
9/**
10 * File specific information.
11 * Symbols declared within a file may be recovered by iterating over all
12 * symbols and examining the `declaration_file` field.
13 */
14export class SchemaFile implements flatbuffers.IUnpackableObject<SchemaFileT> {
15  bb: flatbuffers.ByteBuffer|null = null;
16  bb_pos = 0;
17  __init(i:number, bb:flatbuffers.ByteBuffer):SchemaFile {
18  this.bb_pos = i;
19  this.bb = bb;
20  return this;
21}
22
23static getRootAsSchemaFile(bb:flatbuffers.ByteBuffer, obj?:SchemaFile):SchemaFile {
24  return (obj || new SchemaFile()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
25}
26
27static getSizePrefixedRootAsSchemaFile(bb:flatbuffers.ByteBuffer, obj?:SchemaFile):SchemaFile {
28  bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
29  return (obj || new SchemaFile()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
30}
31
32/**
33 * Filename, relative to project root.
34 */
35filename():string|null
36filename(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
37filename(optionalEncoding?:any):string|Uint8Array|null {
38  const offset = this.bb!.__offset(this.bb_pos, 4);
39  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
40}
41
42/**
43 * Names of included files, relative to project root.
44 */
45includedFilenames(index: number):string
46includedFilenames(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array
47includedFilenames(index: number,optionalEncoding?:any):string|Uint8Array|null {
48  const offset = this.bb!.__offset(this.bb_pos, 6);
49  return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
50}
51
52includedFilenamesLength():number {
53  const offset = this.bb!.__offset(this.bb_pos, 6);
54  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
55}
56
57static getFullyQualifiedName():string {
58  return 'reflection.SchemaFile';
59}
60
61static startSchemaFile(builder:flatbuffers.Builder) {
62  builder.startObject(2);
63}
64
65static addFilename(builder:flatbuffers.Builder, filenameOffset:flatbuffers.Offset) {
66  builder.addFieldOffset(0, filenameOffset, 0);
67}
68
69static addIncludedFilenames(builder:flatbuffers.Builder, includedFilenamesOffset:flatbuffers.Offset) {
70  builder.addFieldOffset(1, includedFilenamesOffset, 0);
71}
72
73static createIncludedFilenamesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
74  builder.startVector(4, data.length, 4);
75  for (let i = data.length - 1; i >= 0; i--) {
76    builder.addOffset(data[i]!);
77  }
78  return builder.endVector();
79}
80
81static startIncludedFilenamesVector(builder:flatbuffers.Builder, numElems:number) {
82  builder.startVector(4, numElems, 4);
83}
84
85static endSchemaFile(builder:flatbuffers.Builder):flatbuffers.Offset {
86  const offset = builder.endObject();
87  builder.requiredField(offset, 4) // filename
88  return offset;
89}
90
91static createSchemaFile(builder:flatbuffers.Builder, filenameOffset:flatbuffers.Offset, includedFilenamesOffset:flatbuffers.Offset):flatbuffers.Offset {
92  SchemaFile.startSchemaFile(builder);
93  SchemaFile.addFilename(builder, filenameOffset);
94  SchemaFile.addIncludedFilenames(builder, includedFilenamesOffset);
95  return SchemaFile.endSchemaFile(builder);
96}
97
98unpack(): SchemaFileT {
99  return new SchemaFileT(
100    this.filename(),
101    this.bb!.createScalarList<string>(this.includedFilenames.bind(this), this.includedFilenamesLength())
102  );
103}
104
105
106unpackTo(_o: SchemaFileT): void {
107  _o.filename = this.filename();
108  _o.includedFilenames = this.bb!.createScalarList<string>(this.includedFilenames.bind(this), this.includedFilenamesLength());
109}
110}
111
112export class SchemaFileT implements flatbuffers.IGeneratedObject {
113constructor(
114  public filename: string|Uint8Array|null = null,
115  public includedFilenames: (string)[] = []
116){}
117
118
119pack(builder:flatbuffers.Builder): flatbuffers.Offset {
120  const filename = (this.filename !== null ? builder.createString(this.filename!) : 0);
121  const includedFilenames = SchemaFile.createIncludedFilenamesVector(builder, builder.createObjectOffsetList(this.includedFilenames));
122
123  return SchemaFile.createSchemaFile(builder,
124    filename,
125    includedFilenames
126  );
127}
128}
129