Merge commit '0f6aab9da6fe982218a01f4a5b896e65fcced437' as 'third_party/flatbuffers'

This commit is contained in:
Siarhei Fedartsou
2024-06-22 13:33:34 +02:00
1814 changed files with 326902 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
// <auto-generated>
// automatically generated by the FlatBuffers compiler, do not modify
// </auto-generated>
namespace KeywordTest
{
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
public enum ABC : int
{
@void = 0,
where = 1,
@stackalloc = 2,
};
}
@@ -0,0 +1,108 @@
// <auto-generated>
// automatically generated by the FlatBuffers compiler, do not modify
// </auto-generated>
namespace KeywordTest
{
using global::System;
using global::System.Collections.Generic;
using global::Google.FlatBuffers;
public struct KeywordsInTable : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); }
public static KeywordsInTable GetRootAsKeywordsInTable(ByteBuffer _bb) { return GetRootAsKeywordsInTable(_bb, new KeywordsInTable()); }
public static KeywordsInTable GetRootAsKeywordsInTable(ByteBuffer _bb, KeywordsInTable obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
public KeywordsInTable __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public KeywordTest.ABC Is { get { int o = __p.__offset(4); return o != 0 ? (KeywordTest.ABC)__p.bb.GetInt(o + __p.bb_pos) : KeywordTest.ABC.@void; } }
public bool MutateIs(KeywordTest.ABC @is) { int o = __p.__offset(4); if (o != 0) { __p.bb.PutInt(o + __p.bb_pos, (int)@is); return true; } else { return false; } }
public KeywordTest.@public Private { get { int o = __p.__offset(6); return o != 0 ? (KeywordTest.@public)__p.bb.GetInt(o + __p.bb_pos) : KeywordTest.@public.NONE; } }
public bool MutatePrivate(KeywordTest.@public @private) { int o = __p.__offset(6); if (o != 0) { __p.bb.PutInt(o + __p.bb_pos, (int)@private); return true; } else { return false; } }
public int Type { get { int o = __p.__offset(8); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
public bool MutateType(int type) { int o = __p.__offset(8); if (o != 0) { __p.bb.PutInt(o + __p.bb_pos, type); return true; } else { return false; } }
public bool Default { get { int o = __p.__offset(10); return o != 0 ? 0!=__p.bb.Get(o + __p.bb_pos) : (bool)false; } }
public bool MutateDefault(bool @default) { int o = __p.__offset(10); if (o != 0) { __p.bb.Put(o + __p.bb_pos, (byte)(@default ? 1 : 0)); return true; } else { return false; } }
public static Offset<KeywordTest.KeywordsInTable> CreateKeywordsInTable(FlatBufferBuilder builder,
KeywordTest.ABC @is = KeywordTest.ABC.@void,
KeywordTest.@public @private = KeywordTest.@public.NONE,
int type = 0,
bool @default = false) {
builder.StartTable(4);
KeywordsInTable.AddType(builder, type);
KeywordsInTable.AddPrivate(builder, @private);
KeywordsInTable.AddIs(builder, @is);
KeywordsInTable.AddDefault(builder, @default);
return KeywordsInTable.EndKeywordsInTable(builder);
}
public static void StartKeywordsInTable(FlatBufferBuilder builder) { builder.StartTable(4); }
public static void AddIs(FlatBufferBuilder builder, KeywordTest.ABC @is) { builder.AddInt(0, (int)@is, 0); }
public static void AddPrivate(FlatBufferBuilder builder, KeywordTest.@public @private) { builder.AddInt(1, (int)@private, 0); }
public static void AddType(FlatBufferBuilder builder, int type) { builder.AddInt(2, type, 0); }
public static void AddDefault(FlatBufferBuilder builder, bool @default) { builder.AddBool(3, @default, false); }
public static Offset<KeywordTest.KeywordsInTable> EndKeywordsInTable(FlatBufferBuilder builder) {
int o = builder.EndTable();
return new Offset<KeywordTest.KeywordsInTable>(o);
}
public KeywordsInTableT UnPack() {
var _o = new KeywordsInTableT();
this.UnPackTo(_o);
return _o;
}
public void UnPackTo(KeywordsInTableT _o) {
_o.Is = this.Is;
_o.Private = this.Private;
_o.Type = this.Type;
_o.Default = this.Default;
}
public static Offset<KeywordTest.KeywordsInTable> Pack(FlatBufferBuilder builder, KeywordsInTableT _o) {
if (_o == null) return default(Offset<KeywordTest.KeywordsInTable>);
return CreateKeywordsInTable(
builder,
_o.Is,
_o.Private,
_o.Type,
_o.Default);
}
}
public class KeywordsInTableT
{
[Newtonsoft.Json.JsonProperty("is")]
public KeywordTest.ABC Is { get; set; }
[Newtonsoft.Json.JsonProperty("private")]
public KeywordTest.@public Private { get; set; }
[Newtonsoft.Json.JsonProperty("type")]
public int Type { get; set; }
[Newtonsoft.Json.JsonProperty("default")]
public bool Default { get; set; }
public KeywordsInTableT() {
this.Is = KeywordTest.ABC.@void;
this.Private = KeywordTest.@public.NONE;
this.Type = 0;
this.Default = false;
}
}
static public class KeywordsInTableVerify
{
static public bool Verify(Google.FlatBuffers.Verifier verifier, uint tablePos)
{
return verifier.VerifyTableStart(tablePos)
&& verifier.VerifyField(tablePos, 4 /*Is*/, 4 /*KeywordTest.ABC*/, 4, false)
&& verifier.VerifyField(tablePos, 6 /*Private*/, 4 /*KeywordTest.@public*/, 4, false)
&& verifier.VerifyField(tablePos, 8 /*Type*/, 4 /*int*/, 4, false)
&& verifier.VerifyField(tablePos, 10 /*Default*/, 1 /*bool*/, 1, false)
&& verifier.VerifyTableEnd(tablePos);
}
}
}
@@ -0,0 +1,105 @@
// <auto-generated>
// automatically generated by the FlatBuffers compiler, do not modify
// </auto-generated>
namespace KeywordTest
{
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
public enum KeywordsInUnion : byte
{
NONE = 0,
@static = 1,
@internal = 2,
};
public class KeywordsInUnionUnion {
public KeywordsInUnion Type { get; set; }
public object Value { get; set; }
public KeywordsInUnionUnion() {
this.Type = KeywordsInUnion.NONE;
this.Value = null;
}
public T As<T>() where T : class { return this.Value as T; }
public KeywordTest.KeywordsInTableT Asstatic() { return this.As<KeywordTest.KeywordsInTableT>(); }
public static KeywordsInUnionUnion Fromstatic(KeywordTest.KeywordsInTableT _static) { return new KeywordsInUnionUnion{ Type = KeywordsInUnion.@static, Value = _static }; }
public KeywordTest.KeywordsInTableT Asinternal() { return this.As<KeywordTest.KeywordsInTableT>(); }
public static KeywordsInUnionUnion Frominternal(KeywordTest.KeywordsInTableT _internal) { return new KeywordsInUnionUnion{ Type = KeywordsInUnion.@internal, Value = _internal }; }
public static int Pack(Google.FlatBuffers.FlatBufferBuilder builder, KeywordsInUnionUnion _o) {
switch (_o.Type) {
default: return 0;
case KeywordsInUnion.@static: return KeywordTest.KeywordsInTable.Pack(builder, _o.Asstatic()).Value;
case KeywordsInUnion.@internal: return KeywordTest.KeywordsInTable.Pack(builder, _o.Asinternal()).Value;
}
}
}
public class KeywordsInUnionUnion_JsonConverter : Newtonsoft.Json.JsonConverter {
public override bool CanConvert(System.Type objectType) {
return objectType == typeof(KeywordsInUnionUnion) || objectType == typeof(System.Collections.Generic.List<KeywordsInUnionUnion>);
}
public override void WriteJson(Newtonsoft.Json.JsonWriter writer, object value, Newtonsoft.Json.JsonSerializer serializer) {
var _olist = value as System.Collections.Generic.List<KeywordsInUnionUnion>;
if (_olist != null) {
writer.WriteStartArray();
foreach (var _o in _olist) { this.WriteJson(writer, _o, serializer); }
writer.WriteEndArray();
} else {
this.WriteJson(writer, value as KeywordsInUnionUnion, serializer);
}
}
public void WriteJson(Newtonsoft.Json.JsonWriter writer, KeywordsInUnionUnion _o, Newtonsoft.Json.JsonSerializer serializer) {
if (_o == null) return;
serializer.Serialize(writer, _o.Value);
}
public override object ReadJson(Newtonsoft.Json.JsonReader reader, System.Type objectType, object existingValue, Newtonsoft.Json.JsonSerializer serializer) {
var _olist = existingValue as System.Collections.Generic.List<KeywordsInUnionUnion>;
if (_olist != null) {
for (var _j = 0; _j < _olist.Count; ++_j) {
reader.Read();
_olist[_j] = this.ReadJson(reader, _olist[_j], serializer);
}
reader.Read();
return _olist;
} else {
return this.ReadJson(reader, existingValue as KeywordsInUnionUnion, serializer);
}
}
public KeywordsInUnionUnion ReadJson(Newtonsoft.Json.JsonReader reader, KeywordsInUnionUnion _o, Newtonsoft.Json.JsonSerializer serializer) {
if (_o == null) return null;
switch (_o.Type) {
default: break;
case KeywordsInUnion.@static: _o.Value = serializer.Deserialize<KeywordTest.KeywordsInTableT>(reader); break;
case KeywordsInUnion.@internal: _o.Value = serializer.Deserialize<KeywordTest.KeywordsInTableT>(reader); break;
}
return _o;
}
}
static public class KeywordsInUnionVerify
{
static public bool Verify(Google.FlatBuffers.Verifier verifier, byte typeId, uint tablePos)
{
bool result = true;
switch((KeywordsInUnion)typeId)
{
case KeywordsInUnion.@static:
result = KeywordTest.KeywordsInTableVerify.Verify(verifier, tablePos);
break;
case KeywordsInUnion.@internal:
result = KeywordTest.KeywordsInTableVerify.Verify(verifier, tablePos);
break;
default: result = true;
break;
}
return result;
}
}
}
+105
View File
@@ -0,0 +1,105 @@
// <auto-generated>
// automatically generated by the FlatBuffers compiler, do not modify
// </auto-generated>
namespace KeywordTest
{
using global::System;
using global::System.Collections.Generic;
using global::Google.FlatBuffers;
public struct Table2 : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); }
public static Table2 GetRootAsTable2(ByteBuffer _bb) { return GetRootAsTable2(_bb, new Table2()); }
public static Table2 GetRootAsTable2(ByteBuffer _bb, Table2 obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
public Table2 __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public KeywordTest.KeywordsInUnion TypeType { get { int o = __p.__offset(4); return o != 0 ? (KeywordTest.KeywordsInUnion)__p.bb.Get(o + __p.bb_pos) : KeywordTest.KeywordsInUnion.NONE; } }
public TTable? Type<TTable>() where TTable : struct, IFlatbufferObject { int o = __p.__offset(6); return o != 0 ? (TTable?)__p.__union<TTable>(o + __p.bb_pos) : null; }
public KeywordTest.KeywordsInTable TypeAsstatic() { return Type<KeywordTest.KeywordsInTable>().Value; }
public KeywordTest.KeywordsInTable TypeAsinternal() { return Type<KeywordTest.KeywordsInTable>().Value; }
public static Offset<KeywordTest.Table2> CreateTable2(FlatBufferBuilder builder,
KeywordTest.KeywordsInUnion type_type = KeywordTest.KeywordsInUnion.NONE,
int typeOffset = 0) {
builder.StartTable(2);
Table2.AddType(builder, typeOffset);
Table2.AddTypeType(builder, type_type);
return Table2.EndTable2(builder);
}
public static void StartTable2(FlatBufferBuilder builder) { builder.StartTable(2); }
public static void AddTypeType(FlatBufferBuilder builder, KeywordTest.KeywordsInUnion typeType) { builder.AddByte(0, (byte)typeType, 0); }
public static void AddType(FlatBufferBuilder builder, int typeOffset) { builder.AddOffset(1, typeOffset, 0); }
public static Offset<KeywordTest.Table2> EndTable2(FlatBufferBuilder builder) {
int o = builder.EndTable();
return new Offset<KeywordTest.Table2>(o);
}
public Table2T UnPack() {
var _o = new Table2T();
this.UnPackTo(_o);
return _o;
}
public void UnPackTo(Table2T _o) {
_o.Type = new KeywordTest.KeywordsInUnionUnion();
_o.Type.Type = this.TypeType;
switch (this.TypeType) {
default: break;
case KeywordTest.KeywordsInUnion.static:
_o.Type.Value = this.Type<KeywordTest.KeywordsInTable>().HasValue ? this.Type<KeywordTest.KeywordsInTable>().Value.UnPack() : null;
break;
case KeywordTest.KeywordsInUnion.internal:
_o.Type.Value = this.Type<KeywordTest.KeywordsInTable>().HasValue ? this.Type<KeywordTest.KeywordsInTable>().Value.UnPack() : null;
break;
}
}
public static Offset<KeywordTest.Table2> Pack(FlatBufferBuilder builder, Table2T _o) {
if (_o == null) return default(Offset<KeywordTest.Table2>);
var _type_type = _o.Type == null ? KeywordTest.KeywordsInUnion.NONE : _o.Type.Type;
var _type = _o.Type == null ? 0 : KeywordTest.KeywordsInUnionUnion.Pack(builder, _o.Type);
return CreateTable2(
builder,
_type_type,
_type);
}
}
public class Table2T
{
[Newtonsoft.Json.JsonProperty("type_type")]
private KeywordTest.KeywordsInUnion TypeType {
get {
return this.Type != null ? this.Type.Type : KeywordTest.KeywordsInUnion.NONE;
}
set {
this.Type = new KeywordTest.KeywordsInUnionUnion();
this.Type.Type = value;
}
}
[Newtonsoft.Json.JsonProperty("type")]
[Newtonsoft.Json.JsonConverter(typeof(KeywordTest.KeywordsInUnionUnion_JsonConverter))]
public KeywordTest.KeywordsInUnionUnion Type { get; set; }
public Table2T() {
this.Type = null;
}
}
static public class Table2Verify
{
static public bool Verify(Google.FlatBuffers.Verifier verifier, uint tablePos)
{
return verifier.VerifyTableStart(tablePos)
&& verifier.VerifyField(tablePos, 4 /*TypeType*/, 1 /*KeywordTest.KeywordsInUnion*/, 1, false)
&& verifier.VerifyUnion(tablePos, 4, 6 /*Type*/, KeywordTest.KeywordsInUnionVerify.Verify, false)
&& verifier.VerifyTableEnd(tablePos);
}
}
}
+15
View File
@@ -0,0 +1,15 @@
// <auto-generated>
// automatically generated by the FlatBuffers compiler, do not modify
// </auto-generated>
namespace KeywordTest
{
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
public enum @public : int
{
NONE = 0,
};
}