mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-17 01:26:45 +00:00
Initial commit of .NET port of FlatBuffers
Include C# codegen in flatc and .NET FlatBuffer access via the FlatBufferBuilder class Tested: on Windows. Change-Id: If5228a8df60a10e0751b245c6c64530264ea2d8a
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
3f85183c88
commit
9a1f7be6fd
24
tests/MyGame/Example/Test.cs
Normal file
24
tests/MyGame/Example/Test.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
// automatically generated, do not modify
|
||||
|
||||
namespace MyGame.Example
|
||||
{
|
||||
|
||||
using FlatBuffers;
|
||||
|
||||
public class Test : Struct {
|
||||
public Test __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
|
||||
|
||||
public short A() { return bb.GetShort(bb_pos + 0); }
|
||||
public byte B() { return bb.Get(bb_pos + 2); }
|
||||
|
||||
public static int CreateTest(FlatBufferBuilder builder, short A, byte B) {
|
||||
builder.Prep(2, 4);
|
||||
builder.Pad(1);
|
||||
builder.PutByte(B);
|
||||
builder.PutShort(A);
|
||||
return builder.Offset;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user