Skip to content
Snippets Groups Projects
  1. Sep 12, 2016
  2. Sep 01, 2016
  3. Aug 26, 2016
  4. Aug 22, 2016
  5. Aug 14, 2016
  6. Aug 03, 2016
  7. Jun 15, 2016
  8. May 26, 2016
  9. Apr 20, 2016
  10. Apr 18, 2016
  11. Apr 14, 2016
  12. Jan 18, 2016
  13. 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
  14. 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
  15. Oct 29, 2015
  16. Aug 19, 2015
  17. Aug 15, 2015
  18. Aug 07, 2015
  19. Aug 01, 2015
  20. Jul 28, 2015
  21. May 08, 2015
    • Mormegil's avatar
      Union accessors in C# should use generic type for the table · 221193ea
      Mormegil authored
      When accessing a union field, we should return the same object type
      as was given to the method, i.e. the parameter should have a generic
      type for any Table-derived type. This way, we do not need to make
      superfluous casts (which also reduce type safety) like
      
      var myUnionType = (MyUnionType)buff.GetUnionField(new MyUnionType());
      
      when we can do just
      var myUnionType = buff.GetUnionField(new MyUnionType());
      
      Change-Id: Idac1b638e46cc50b1f2dc19f10741481202b1515
      221193ea
  22. May 06, 2015
    • Mormegil's avatar
      [BREAKING CHANGE] Field accessors should use property getters in C# · 0ee1b99c
      Mormegil authored
      In C#, plain field accessors should not be nonparametric methods
      but should be standard property getters.
      
      The accessor methods with parameters were renamed to `GetXxx`
      because a method cannot be named identically to a property.
      
      Also, `ByteBuffer.Position`, `FlatBufferBuilder.Offset` and
      `FlatBufferBuilder.DataBuffer` are now properties instead
      of nonparametric accessor methods, for more idiomatic C# style.
      
      This is a breaking change, all client C# code accessing these
      fields needs to be changed (i.e. remove those `()` or add the
      `Get` prefix).
      
      Issue: #77
      Change-Id: Iaabe9ada076e5ea2c69911cf6170fdda2df3487e
      0ee1b99c
  23. Apr 13, 2015
    • Mormegil's avatar
      Enums use native enums in C# · e3b432cb
      Mormegil authored
      Enums should not be (badly) emulated with classes in C# but should
      use native C# enums instead. Java implementation made an explicit
      choice not to use the (more complex) Java enums, but C# enums are
      just light-weight syntactic coating over integral types.
      
      Fixes issue #171.
      
      Change-Id: I9f4d6ba5324400a1e52982e49b58603cb7d7cca7
      e3b432cb
  24. Apr 10, 2015
    • Advay Mengle's avatar
      Seal all classes in Java/C# · 557c57eb
      Advay Mengle authored
      Makes enums/structs/tables unsubclassable (final or sealed) and
      prevents instantiation of enum classes (which are solely static
      constants).
      
      Tested (Mac OS 10.10.2):
      1. run flattests
      2. cd tests && ../flatc -c monster_test.fbs && ../flatc -j
      monster_test.fbs && ../flatc -g monster_test.fbs && ../flatc -n
      monster_test.fbs  # Note deltas for C# and Java.
      3. ./JavaTest.sh
      
      **Breaking api change**
      
      Change-Id: Ie008c941c36d212690da58ddc72c9b228eb7a093
      557c57eb
  25. Mar 13, 2015
  26. Feb 04, 2015
    • Florian Enner's avatar
      added reuse option for root objects · b0910e75
      Florian Enner authored
      getRootAs..() function now has a second implementation that
      accepts an existing object to allow object reuse, much like
      all other methods that refer to objects.
      
      Change-Id: Iffef567c903a130761ef7de98867e5465d29a04d
      b0910e75
  27. Jan 26, 2015
  28. Sep 25, 2014
  29. Sep 22, 2014
  30. Sep 18, 2014
  31. Sep 15, 2014
Loading