Skip to content
Snippets Groups Projects
  1. Oct 21, 2016
    • Baptiste Lepilleur's avatar
      Java: fix unsigned default value code generation and add 'L' suffix for long default value (#4051) · 5b5fcbfc
      Baptiste Lepilleur authored
      * Java: emit "signed" equivalent of unsigned default value in generated code and add "L" suffix to long default value.
      
      * Updated generated code
      
      * Only convert ulong to "signed" equivalent. ubyte and ushort don't need specific handling as "user facing" type is int. uint need 'L' suffix as "user facing" type is long.
      
      * Added missing cast to primitive type of default value which is in "user facing" type in builder.add<type>() calls.
      
      * Do not cast default value to actual type in C#.
      5b5fcbfc
  2. Oct 12, 2016
  3. Oct 07, 2016
  4. Sep 12, 2016
  5. Sep 01, 2016
  6. Aug 26, 2016
  7. Aug 22, 2016
  8. Aug 15, 2016
  9. Aug 14, 2016
  10. Aug 03, 2016
  11. Jul 25, 2016
  12. Jul 23, 2016
  13. Jul 20, 2016
  14. Jul 09, 2016
  15. Jul 08, 2016
  16. Jun 22, 2016
  17. Jun 20, 2016
  18. May 28, 2016
  19. May 26, 2016
  20. Apr 26, 2016
  21. Apr 15, 2016
  22. Apr 14, 2016
  23. Apr 13, 2016
  24. Jan 21, 2016
  25. Jan 18, 2016
  26. Dec 05, 2015
  27. Dec 04, 2015
    • Michael Collins's avatar
      Add Get Bytes Method Generator for C# · e083e466
      Michael Collins authored
      I updated idl_gen_general.cpp to add support for generating a Get Bytes
      method for a vector to the generated C# source code. Given a byte vector
      field named Foo, a method named GetFooBytes() will be generated in the
      C# source code that will return an ArraySegment<byte> value referencing
      the vector data in the underlying ByteBuffer.
      
      I added a method to Table.cs named __vector_as_arraysegment that is used
      by the code generated by the change to the C# generator.
      __vector_as_arraysegment will take the offset of the vector and will
      return the ArraySegment<byte> value corresponding to the bytes that
      store the vector data.
      
      I updated FlatBuffersExampleTests.cs to add tests to validate my
      implementation of Table.__vector_as_arraysegment. I added tests to
      demonstrate that the bytes for the monster's name can be extracted from
      the underlying byte array. I also added tests to show that
      Table.__vector_as_arraysegment returns a null value if the vector is not
      present in the FlatBuffer.
      
      I used the updated flatc.exe program to regenerate the C# source files
      for the MyGame example. The new Monster class includes the GetXXXBytes
      methods to return the byte arrays containing data for vectors.
      e083e466
    • Wouter van Oortmerssen's avatar
      Added --gen-all to generate code for a schema and all its includes. · 45bda6e0
      Wouter van Oortmerssen authored
      Also refactored the way options are stored.
      
      Change-Id: I709ac908cd2aba396c9c282725cf1d42ccce0882
      Tested: on Linux.
      45bda6e0
  28. Nov 23, 2015
    • Donnell's avatar
      Fix C# vector of enum code generation · 644bcbde
      Donnell authored
      Fixes a bug where the logic to determine when to use a C# enum flags
      both enums and vectors of enums.  This causes the C# generator to
      generate code that doesn't compile for tables that contain vectors of
      enums.
      
      The fix also consolidates type generation functions a bit and adds
      some additional casting functions for clarity.
      644bcbde
  29. Nov 17, 2015
    • Shuhei Tanuma's avatar
      C# Unity can't cast integer represented enum value. · 37e28d98
      Shuhei Tanuma authored
      ```
      namespace MyGame;
      
      enum CommandType : byte {
      	None = 0,
      }
      
      table Command {
      	id:int;
      	type:CommandType;
      }
      ```
      
      then generate c# files. it'll output compile error like these.
      
      ```
      Assets/MyGame/Command.cs(18,39): error CS1041: Identifier expected
      Assets/MyGame/Command.cs(18,39): error CS1737: Optional parameter cannot precede required parameters
      
      16:   public static Offset<Command> CreateCommand(FlatBufferBuilder builder,
      17:   int id = 0,
      18:   CommandType type = (CommandType)0) {
      ```
      37e28d98
Loading