121 lines
6.1 KiB
C#
121 lines
6.1 KiB
C#
// <auto-generated>
|
|
// automatically generated by the FlatBuffers compiler, do not modify
|
|
// </auto-generated>
|
|
|
|
namespace SCHALE.Common.FlatData
|
|
{
|
|
|
|
using global::System;
|
|
using global::System.Collections.Generic;
|
|
using global::SCHALE.Common.Crypto;
|
|
using global::Google.FlatBuffers;
|
|
|
|
public struct StringTestExcel : IFlatbufferObject
|
|
{
|
|
private Table __p;
|
|
public ByteBuffer ByteBuffer { get { return __p.bb; } }
|
|
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); }
|
|
public static StringTestExcel GetRootAsStringTestExcel(ByteBuffer _bb) { return GetRootAsStringTestExcel(_bb, new StringTestExcel()); }
|
|
public static StringTestExcel GetRootAsStringTestExcel(ByteBuffer _bb, StringTestExcel obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
|
|
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
|
|
public StringTestExcel __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
|
|
|
public string String(int j) { int o = __p.__offset(4); return o != 0 ? __p.__string(__p.__vector(o) + j * 4) : null; }
|
|
public int StringLength { get { int o = __p.__offset(4); return o != 0 ? __p.__vector_len(o) : 0; } }
|
|
public string Sentence1 { get { int o = __p.__offset(6); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
|
|
#if ENABLE_SPAN_T
|
|
public Span<byte> GetSentence1Bytes() { return __p.__vector_as_span<byte>(6, 1); }
|
|
#else
|
|
public ArraySegment<byte>? GetSentence1Bytes() { return __p.__vector_as_arraysegment(6); }
|
|
#endif
|
|
public byte[] GetSentence1Array() { return __p.__vector_as_array<byte>(6); }
|
|
public string Script { get { int o = __p.__offset(8); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
|
|
#if ENABLE_SPAN_T
|
|
public Span<byte> GetScriptBytes() { return __p.__vector_as_span<byte>(8, 1); }
|
|
#else
|
|
public ArraySegment<byte>? GetScriptBytes() { return __p.__vector_as_arraysegment(8); }
|
|
#endif
|
|
public byte[] GetScriptArray() { return __p.__vector_as_array<byte>(8); }
|
|
|
|
public static Offset<SCHALE.Common.FlatData.StringTestExcel> CreateStringTestExcel(FlatBufferBuilder builder,
|
|
VectorOffset StringOffset = default(VectorOffset),
|
|
StringOffset Sentence1Offset = default(StringOffset),
|
|
StringOffset ScriptOffset = default(StringOffset)) {
|
|
builder.StartTable(3);
|
|
StringTestExcel.AddScript(builder, ScriptOffset);
|
|
StringTestExcel.AddSentence1(builder, Sentence1Offset);
|
|
StringTestExcel.AddString(builder, StringOffset);
|
|
return StringTestExcel.EndStringTestExcel(builder);
|
|
}
|
|
|
|
public static void StartStringTestExcel(FlatBufferBuilder builder) { builder.StartTable(3); }
|
|
public static void AddString(FlatBufferBuilder builder, VectorOffset stringOffset) { builder.AddOffset(0, stringOffset.Value, 0); }
|
|
public static VectorOffset CreateStringVector(FlatBufferBuilder builder, StringOffset[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
|
|
public static VectorOffset CreateStringVectorBlock(FlatBufferBuilder builder, StringOffset[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
|
|
public static VectorOffset CreateStringVectorBlock(FlatBufferBuilder builder, ArraySegment<StringOffset> data) { builder.StartVector(4, data.Count, 4); builder.Add(data); return builder.EndVector(); }
|
|
public static VectorOffset CreateStringVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add<StringOffset>(dataPtr, sizeInBytes); return builder.EndVector(); }
|
|
public static void StartStringVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
|
|
public static void AddSentence1(FlatBufferBuilder builder, StringOffset sentence1Offset) { builder.AddOffset(1, sentence1Offset.Value, 0); }
|
|
public static void AddScript(FlatBufferBuilder builder, StringOffset scriptOffset) { builder.AddOffset(2, scriptOffset.Value, 0); }
|
|
public static Offset<SCHALE.Common.FlatData.StringTestExcel> EndStringTestExcel(FlatBufferBuilder builder) {
|
|
int o = builder.EndTable();
|
|
return new Offset<SCHALE.Common.FlatData.StringTestExcel>(o);
|
|
}
|
|
public StringTestExcelT UnPack() {
|
|
var _o = new StringTestExcelT();
|
|
this.UnPackTo(_o);
|
|
return _o;
|
|
}
|
|
public void UnPackTo(StringTestExcelT _o) {
|
|
byte[] key = TableEncryptionService.CreateKey("StringTest");
|
|
_o.String = new List<string>();
|
|
for (var _j = 0; _j < this.StringLength; ++_j) {_o.String.Add(TableEncryptionService.Convert(this.String(_j), key));}
|
|
_o.Sentence1 = TableEncryptionService.Convert(this.Sentence1, key);
|
|
_o.Script = TableEncryptionService.Convert(this.Script, key);
|
|
}
|
|
public static Offset<SCHALE.Common.FlatData.StringTestExcel> Pack(FlatBufferBuilder builder, StringTestExcelT _o) {
|
|
if (_o == null) return default(Offset<SCHALE.Common.FlatData.StringTestExcel>);
|
|
var _String = default(VectorOffset);
|
|
if (_o.String != null) {
|
|
var __String = new StringOffset[_o.String.Count];
|
|
for (var _j = 0; _j < __String.Length; ++_j) { __String[_j] = builder.CreateString(_o.String[_j]); }
|
|
_String = CreateStringVector(builder, __String);
|
|
}
|
|
var _Sentence1 = _o.Sentence1 == null ? default(StringOffset) : builder.CreateString(_o.Sentence1);
|
|
var _Script = _o.Script == null ? default(StringOffset) : builder.CreateString(_o.Script);
|
|
return CreateStringTestExcel(
|
|
builder,
|
|
_String,
|
|
_Sentence1,
|
|
_Script);
|
|
}
|
|
}
|
|
|
|
public class StringTestExcelT
|
|
{
|
|
public List<string> String { get; set; }
|
|
public string Sentence1 { get; set; }
|
|
public string Script { get; set; }
|
|
|
|
public StringTestExcelT() {
|
|
this.String = null;
|
|
this.Sentence1 = null;
|
|
this.Script = null;
|
|
}
|
|
}
|
|
|
|
|
|
static public class StringTestExcelVerify
|
|
{
|
|
static public bool Verify(Google.FlatBuffers.Verifier verifier, uint tablePos)
|
|
{
|
|
return verifier.VerifyTableStart(tablePos)
|
|
&& verifier.VerifyVectorOfStrings(tablePos, 4 /*String*/, false)
|
|
&& verifier.VerifyString(tablePos, 6 /*Sentence1*/, false)
|
|
&& verifier.VerifyString(tablePos, 8 /*Script*/, false)
|
|
&& verifier.VerifyTableEnd(tablePos);
|
|
}
|
|
}
|
|
|
|
}
|