aboutsummaryrefslogtreecommitdiff
path: root/csharp
Commit message (Collapse)AuthorAgeFilesLines
* Generated code changes following previous commit.Jon Skeet2015-07-2118-728/+686
|
* Revamp to reflection.Jon Skeet2015-07-2122-179/+327
| | | | | | | | | | | | | | | | | 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.
* update addressbook exampleJan Tattermusch2015-07-203-6/+6
|
* regenerate Addressbook.csJan Tattermusch2015-07-201-39/+39
|
* First part of JSON formatting for well-known types. I think we need a ↵Jon Skeet2015-07-203-1/+80
| | | | reflection API rethink before doing the rest.
* Fix typo in buildall.shJan Tattermusch2015-07-171-1/+1
|
* First pass at the big rename from ProtocolBuffers to Google.Protobuf.Jon Skeet2015-07-1799-51/+43
| | | | We'll see what I've missed when CI fails...
* Fixes from PR review.Jon Skeet2015-07-173-14/+89
|
* Make the map test actually test the code...Jon Skeet2015-07-161-0/+7
|
* First pass at wrapper types.Jon Skeet2015-07-169-405/+834
| | | | | - We do still generate the message types, as otherwise reflection breaks, even though it doesn't actually use those types. - JSON handling hasn't been implemented yet
* Fixes to ByteString's equality handling.Jon Skeet2015-07-162-20/+41
|
* First part of implementing wrapper types. Not ready yet!Jon Skeet2015-07-164-1/+2424
|
* Remove the struct-based iterator for RepeatedField.Jon Skeet2015-07-162-63/+6
| | | | | | We don't use it in the runtime or generated code anywhere now, so the extra small performance boost isn't as critical, and it has some undesirable consequences. The tests have needed to change as iterator block enumerators don't throw when we might expect them to.
* added comment for ByteString.CopyFromJan Tattermusch2015-07-151-0/+2
|
* C# cleanup - assorted nitsJan Tattermusch2015-07-155-10/+3
|
* Don't create nested types (or field accessors) for map types.Jon Skeet2015-07-152-5771/+0
| | | | I'm sure I've implemented this before, but somehow it's been lost in a maze of twisty little branches, all alike.
* Generated code for well-known typesJon Skeet2015-07-1417-113/+4763
|
* Generate the well-known types in C#Jon Skeet2015-07-143-10/+34
| | | | | | | | | | This involves: - Specifying a namespace in each proto (including ones we'd previously missed) - Updating the generation script - Changing codegen to implement IReflectedMessage.Fields explicitly (a good thing anyway) - Changing reflection tests to take account of the explicit interface implementation Non-generated code in this commit; generated code to follow
* Changing reflection namespace (part 4)Jon Skeet2015-07-148-11/+0
| | | | Update code already within Google.Protobuf.Reflection which was importing Google.Protobuf.DescriptorProtos
* Changing reflection namespace (part 3)Jon Skeet2015-07-144-233/+233
| | | | | | | | Change the C# namespace in descriptor.proto to Google.Protobuf.Reflection. This then means changing where the generated code lives, which means updating the project file... It also involves regenerating the C++ - which has updated the well-known types as well, for no terribly obvious reason...
* Changing reflection namespace (part 2)Jon Skeet2015-07-147-487/+487
| | | | Generated code changes from previous commit
* Changing reflection namespace (part 1)Jon Skeet2015-07-1430-2629/+2617
| | | | | | | - Move types into Google.Protobuf.Reflection - Change codegen to reflect that in generated types Generated code changes coming in part 2
* Merge pull request #582 from jskeet/csharp-jsonJon Skeet2015-07-1418-162/+1486
|\ | | | | JSON formatting in C#
| * Changes suggested during review.Jon Skeet2015-07-142-27/+4
| | | | | | | | | | - Remove the indexers in FieldAccessorTable - Add a TODO for field ordering in oneof
| * Fixes to JsonFormatterJon Skeet2015-07-102-11/+112
| | | | | | | | | | - Handle oneof properly - Omit unknown enum values
| * Generated code changes for previous submitJon Skeet2015-07-107-113/+113
| |
| * Oneof reflection support. (Generated code changes in next commit.)Jon Skeet2015-07-104-35/+86
| |
| * Use the new JsonFormatter to implement ToString on generated messages.Jon Skeet2015-07-107-0/+452
| |
| * Initial implementation of JSON formattingJon Skeet2015-07-107-3/+746
| | | | | | | | | | | | - No parsing - Reflection based, so not hugely efficient - No line breaks or indentation
* | Update Google.Protobuf.nuspecJan Tattermusch2015-07-121-1/+1
| |
* | enable building nuget packageJan Tattermusch2015-07-104-13/+41
|/
* Knock-on effects of moving GetSampleMessage.Jon Skeet2015-07-091-8/+8
|
* Lots more tests for FieldCodec, MapField, RepeatedFieldJon Skeet2015-07-097-18/+516
| | | | ... and some implementation changes to go with them.
* Fix descriptor reflection in various waysJon Skeet2015-07-0917-378/+178
| | | | | | | | - The protos are no longer publicly exposed at all - Oneof detection now works (as we default to -1, not 0) - OneofDescriptor exposes the fields in the oneof - Removed unnecessary code for replacing protos - remnant of extensions - There's now just the non-generic form of IDescriptor
* Regenerated code due to previous commit.Jon Skeet2015-07-097-371/+823
| | | | Note that now we need a proto3 version of addressbook.proto. This may affect other platforms, and could do with an overhaul to follow proto3 conventions anyway (e.g. repeated field names). Will need to think about that carefully before merging into master. Raised issue #565 for this.
* Changes to generated code due to previous commit.Jon Skeet2015-07-097-939/+692
|
* Implement reflection properly for fields.Jon Skeet2015-07-0914-220/+436
| | | | | | | | | | | | | - FieldAccessorTable is now non-generic - We don't have a static field per message type in the umbrella class. (Message descriptors are accessed via the file descriptor.) - Removed the "descriptor assigner" complication from the descriptor fixup; without extensions, we don't need it - MapField implements IDictionary (more tests would be good...) - RepeatedField implements IList (more tests would be good) - Use expression trees to build accessors. (Will need to test this on various platforms... probably need a fallback strategy just using reflection directly.) - Added FieldDescriptor.IsMap - Added tests for reflection with generated messages Changes to generated code coming in next commit.
* Minor fix-ups as suggested in PR #560.Jon Skeet2015-07-096-58/+103
| | | | | - Added new line at the end of SampleEnum - Moved GeneratedMessageTest.GetSampleMessage to a new class, SampleMessages, and renamed it to CreateFullTestAllTypes.
* Fix copyright lines for all C# code.Jon Skeet2015-06-3057-215/+508
| | | | | | Everything should now be consistent - the only difference between files is the year (aside from generated files). Fixes issue #531.
* Tidying up and extra tests.Jon Skeet2015-06-3017-457/+871
| | | | This is mostly just making things internal instead of public, removing and reordering a bunch of code in CodedInputStream/CodedOutputStream, and generally tidying up.
* Tests changed enough to buildJon Skeet2015-06-303-15/+36
|
* First pass (not yet compiling) at removing all the array handling code from ↵Jon Skeet2015-06-309-1818/+666
| | | | | | | Coded*Stream. Prod code works, but some tests are broken. Obviously those need fixing, then more tests, and review benchmarks.
* Fix for doubly-nested types - issue #307.Jon Skeet2015-06-292-21/+313
| | | | No specific test case - if the generated code compiles, the issue is fixed :)
* More cleanup, based around searches for "Google.ProtocolBuffers"Jon Skeet2015-06-2628-1774/+40
| | | | | | | - Remove some old proto2-based C#-only messages - Remove the "build" directory which only contained out-of-date files - Remove the csharp_namespace option from proto2 messages - Change "Google.ProtocolBuffers" to "Google.Protobuf" in other messages
* Remove a lot of code which wasn't needed any more.Jon Skeet2015-06-2622-1154/+59
|
* Fix or delete old projects.Jon Skeet2015-06-2619-46509/+14
| | | | | | | | ProtoDump isn't currently useful, but will be when ToString emits JSON: fixed. ProtoBench: deleted; we should reinstate when there's a common proto3 benchmark. ProtoMunge: delete; not useful enough to merit fixing up. Removed the [TestFixture] from ByteStringTest as Travis uses a recent enough version of NUnit.
* Tests for FieldCodec, along with a fix.Jon Skeet2015-06-263-1/+151
|
* Generated code changes for previous commit.Jon Skeet2015-06-267-661/+7091
|
* Tweaks and more tests for mapsJon Skeet2015-06-266-26/+178
| | | | | | | | | | | | | | | - Change the default message hash code to 1 to be consistent with other code - Change the empty list/map hash code to 0 as "empty map" is equivalent to "no map" - Removed map fields from unittest_proto3.proto - Created map_unittest_proto3.proto which is like map_unittest.proto but proto3-only - Fixed factory methods in FieldCodec highlighted by using all field types :) - Added tests for map serialization: - Extra fields within entries - Entries with value then key - Non-contiguous entries for the same map - Multiple entries for the same key Changes to generated code coming in next commit
* Make map test keys even more different to avoid odd hash collisionsJon Skeet2015-06-251-8/+8
|