1. 04 Nov, 2019 1 commit
  2. 21 Feb, 2019 1 commit
  3. 08 Oct, 2018 1 commit
    • Benjamin Krämer's avatar
      Ported FieldMaskUtil from Java to C# (#5045) · 80e530da
      Benjamin Krämer authored
      * Ported FieldMaskUtil from Java to C#
      
      * Merged FieldMaskUtil into FieldMaskPartial
      
      - Removed FieldMaskUtil
      - Moved FieldMaskTree to root
      - Updated tests
      
      * Improved tests
      
      - Removed internal method FieldMaskTree.GetFieldPaths
      - Proof FieldMask.Paths only contains expected values
      
      * Added FieldMaskTreeTest to Makefile
      
      * Added FieldMaskTree to Makefile
      80e530da
  4. 05 Oct, 2018 1 commit
  5. 09 Jul, 2018 1 commit
  6. 19 Dec, 2017 1 commit
  7. 09 Dec, 2017 1 commit
  8. 12 Nov, 2017 1 commit
  9. 03 Jul, 2017 1 commit
    • Jon Skeet's avatar
      Make Any easier to work with in C# · 62d7fe56
      Jon Skeet authored
      - Add a TryUnpack method which doesn't throw if the type is wrong
      - Make GetTypeName public for easier determination of the message type
      
      Fixes #3294.
      62d7fe56
  10. 14 Jul, 2016 2 commits
  11. 11 May, 2016 2 commits
  12. 29 Apr, 2016 1 commit
  13. 15 Feb, 2016 1 commit
  14. 20 Jan, 2016 1 commit
    • Jon Skeet's avatar
      Ensure that FieldMask, Timestamp and Duration ToString() calls don't throw · dd43dcca
      Jon Skeet authored
      The usage of ICustomDiagnosticMessage here is non-essential - ToDiagnosticString
      doesn't actually get called by ToString() in this case, due to JsonFormatter code. It was
      intended to make it clearer that it *did* have a custom format... but then arguably I should
      do the same for Value, Struct, Any etc.
      
      Moving some of the code out of JsonFormatter and into Duration/Timestamp/FieldMask likewise
      feels somewhat nice, somewhat nasty... basically there are JSON-specific bits of formatting, but
      also domain-specific bits of computation. <sigh>
      
      Thoughts welcome.
      dd43dcca
  15. 15 Jan, 2016 2 commits
  16. 11 Jan, 2016 1 commit
  17. 15 Dec, 2015 1 commit
    • Jon Skeet's avatar
      Make ToString() valid without a type registry · aabc6c41
      Jon Skeet authored
      This addresses issue #1008, by creating a JsonFormatter which is private and only different
      to JsonFormatter.Default in terms of reference equality.
      
      Other plausible designs:
      
      - The same, but expose the diagnostic-only formatter
      - Add something to settings to say "I don't have a type registry at all"
      - Change the behaviour of JsonFormatter.Default (bad idea IMO, as we really *don't* want the result of this used as regular JSON to be parsed)
      
      Note that just trying to find a separate fix to issue #933 and using that to override Any.ToString() differently wouldn't work for messages that *contain* an Any.
      
      Generated code changes follow in the next commit.
      aabc6c41
  18. 30 Oct, 2015 1 commit
  19. 04 Sep, 2015 1 commit
    • Jon Skeet's avatar
      Pack/Unpack implementation for Any. · e50461d8
      Jon Skeet authored
      We still need the JSON representation, which relies on something like a DescriptorPool to fetch message types from based on the type URL. That will come a bit later.
      (The DescriptorPool comment in this commit is just a note which will prove useful if we use DescriptorPool itself.)
      e50461d8
  20. 06 Aug, 2015 1 commit
  21. 03 Aug, 2015 1 commit
  22. 31 Jul, 2015 1 commit
  23. 22 Jul, 2015 2 commits
    • Jon Skeet's avatar
      Implemented Jan's suggestion of FieldCollection, replacing FieldAccessorCollection. · c1c6b2d0
      Jon Skeet authored
      I think Jan was actually suggesting keeping both, but that feels redundant to me. The test diff is misleading here IMO, because I wouldn't expect real code using reflection to use several accessors one after another like this, unless it was within a loop. Evidence to the contrary would be welcome :)
      
      This change also incidentally goes part way to fixing the issue of the JSON formatter not writing out the fields in field number order - with this change, it does except for oneofs, which we can fix in a follow-up change.
      
      I haven't actually added a test with a message with fields deliberately out of order - I'm happy to do so though. It feels like it would make sense to be in google/src/protobuf, but it's not entirely clear what the rules of engagement are for adding new messages there. (unittest_proto3.proto?)
      c1c6b2d0
    • Jon Skeet's avatar
      First pass at making field access simpler. · 20bf6a56
      Jon Skeet authored
      This is definitely not ready to ship - I'm "troubled" by the disconnect between a list of fields in declaration order, and a mapping of field accessors by field number/name. Discussion required, but I find that easier when we've got code to look at :)
      20bf6a56
  24. 21 Jul, 2015 1 commit
    • Jon Skeet's avatar
      Revamp to reflection. · 53c399a1
      Jon Skeet authored
      Changes in brief:
      1. Descriptor is now the entry point for all reflection.
      2. IReflectedMessage has gone; there's now a Descriptor property in IMessage, which is explicitly implemented (due to the static property).
      3. FieldAccessorTable has gone away
      4. IFieldAccessor and OneofFieldAccessor still exist; we *could* put the functionality straight into FieldDescriptor and OneofDescriptor... I'm unsure about that.
      5. There's a temporary property MessageDescriptor.FieldAccessorsByFieldNumber to make the test changes small - we probably want this to go away
      6. Discovery for delegates is now via attributes applied to properties and the Clear method of a oneof
      
      I'm happy with 1-3.
      4 I'm unsure about - feedback welcome.
      5 will go away
      6 I'm unsure about, both in design and implementation. Should we have a ProtobufMessageAttribute too? Should we find all the relevant attributes in MessageDescriptor and pass them down, to avoid an O(N^2) scenario?
      
      Generated code changes coming in the next commit.
      53c399a1
  25. 17 Jul, 2015 1 commit