Commit Graph

2473 Commits

Author SHA1 Message Date
Jon Skeet
9629797331 Well-known type operations for Timestamp and Duration (but not JSON formatting).
While I've provided operators, I haven't yet provided the method equivalents. It's not clear to me that
they're actually a good idea, while we're really targeting C# developers who definitely *can* use the user-defined operators.
2015-07-31 08:14:11 +01:00
Jon Skeet
5bdb1fb311 Merge pull request #665 from jskeet/types_field
Handle field names of "descriptor" and "types".
2015-07-31 08:13:47 +01:00
Jon Skeet
f994cfe808 Handle field names of "descriptor" and "types". 2015-07-31 07:00:25 +01:00
Jan Tattermusch
b193503aa7 Merge pull request #664 from jtattermusch/expose_umbrella_class_name2
Expose GetUmbrellaClassName in csharp_names.h
2015-07-30 16:40:23 -07:00
Jan Tattermusch
43a2dee708 refactor umbrella class helpers 2015-07-30 14:54:09 -07:00
Jan Tattermusch
12febd0a76 Merge pull request #632 from google/csharp-experimental
Merge C# proto3 from csharp-experimental to master
2015-07-30 14:51:11 -07:00
Jan Tattermusch
bde01d5326 Merge pull request #660 from jskeet/throw-on-null
Throw on null for string/bytes single fields
2015-07-30 11:49:27 -07:00
Jon Skeet
d18cc08456 Generated code for previous commit. 2015-07-30 13:50:02 +01:00
Jon Skeet
3980cf9df1 Prohibit null values for string/bytes fields in generated code. 2015-07-30 13:36:46 +01:00
Jon Skeet
68380f0f66 Rename ThrowHelper to Preconditions and make it public - we'll want to use it from the generated code soon.
Additionally, change it to return the value passed, and make it generic with a class constraint.
A separate method doesn't have the class constraint, for more unusual scenarios.
2015-07-30 13:36:45 +01:00
Jon Skeet
7909b2edeb Merge pull request #659 from jskeet/fix-frozen
Remove a few hangers-on from frozenness.
2015-07-30 13:35:55 +01:00
Jon Skeet
dea15a7ca4 Generated code from previous commit. 2015-07-30 13:16:00 +01:00
Jon Skeet
f03271665f More freezing tidy-up; generated code in next commit. 2015-07-30 13:15:45 +01:00
Jon Skeet
3b2fe97b6f Minor bits of left-over frozenness. 2015-07-30 13:07:50 +01:00
Jon Skeet
7a0effb9e9 Merge pull request #654 from jtattermusch/csharp_hide_freeze
Remove the C# Freeze API
2015-07-30 09:47:38 +01:00
Jon Skeet
9cfea1d6f6 Merge pull request #655 from jtattermusch/csharp_expose_more_info_about_service
Expose IsClientStreaming and IsServerStreaming in MethodDescriptor
2015-07-30 06:46:53 +01:00
Jan Tattermusch
7ec023acf4 regenerate code 2015-07-29 20:26:20 -07:00
Jan Tattermusch
3783d9a8ad remove the freeze API 2015-07-29 20:26:20 -07:00
Jan Tattermusch
fa29148137 add IsClientStreaming and IsServerStreaming to MethodDescriptor 2015-07-29 18:48:54 -07:00
Paul Yang
c6dffbcb4f Merge pull request #652 from TeBoring/objectivec
Move the definition of GOOGLE_FALLTHROUGH_INTENDED to port.h
2015-07-29 15:20:47 -07:00
teboring
5da3fb0666 Move the definition of GOOGLE_FALLTHROUGH_INTENDED to port.h 2015-07-29 14:34:52 -07:00
Feng Xiao
add3e8df57 Merge pull request #651 from litinglin/master
On x64 MSVC platform, macro PROTOBUF_LITTLE_ENDIAN won't be set
2015-07-29 13:47:09 -07:00
LitingLin
67d51ac4f8 Windows is always little-endian. 2015-07-30 02:35:39 +08:00
LitingLin
224010c775 A bug about PROTOBUF_LITTLE_ENDIAN remain undefined on MSVC x64 2015-07-30 01:51:11 +08:00
Jan Tattermusch
74810c6ae3 Merge pull request #638 from jskeet/portable
First attempt at using profile 259 for Google.Protobuf.
2015-07-29 09:32:55 -07:00
Jon Skeet
d82ebe48e1 Update the readme file to indicate supported platforms 2015-07-28 10:23:11 +01:00
Jon Skeet
9ccc83990d Humbug - previous commit didn't include project file changes :( 2015-07-28 09:01:13 +01:00
Jon Skeet
0802d56fcd Tweaks to Profile259 support
- Fix nupec paths
- Remove an obsolete part of the JSON build
- Add documentation and tests to reflection extension methods, and improve implementations
2015-07-28 08:16:50 +01:00
Paul Yang
f642c5cfdd Merge pull request #635 from TeBoring/objectivec
Update minimal ios and osx version for deployment.
2015-07-27 11:43:11 -07:00
Feng Xiao
69d660b39c Merge pull request #642 from nico/unused
Remove two unused functions.
2015-07-27 11:39:27 -07:00
Bo Yang
d58e95bc10 Update minimal ios and osx version for deployment. 2015-07-27 10:54:44 -07:00
Jon Skeet
0dbd5ec80d First attempt at using profile 259 for Google.Protobuf.
This requires .NET 4.5, and there are a few compatibility changes required around reflection.
Creating a PR from this to see how our CI systems handle it. Will want to add more documentation,
validation and probably tests before merging.

This is in aid of issue #590.
2015-07-27 07:47:50 +01:00
Nico Weber
58b2decb7b Remove two unused functions. 2015-07-25 19:37:52 -07:00
Jon Skeet
edff88886b Merge pull request #641 from jtattermusch/csharp_descriptor_database
Expose original binary data for file descriptor
2015-07-25 07:13:08 +01:00
Jan Tattermusch
3b8c83eff1 expose original binary data for filedescriptor 2015-07-24 20:27:35 -07:00
Jon Skeet
bea87743e0 Merge pull request #634 from jskeet/reflection2
Reflection part 2 - for discussion
2015-07-23 06:50:23 +01:00
Jon Skeet
c1c6b2d0d5 Implemented Jan's suggestion of FieldCollection, replacing FieldAccessorCollection.
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?)
2015-07-22 20:13:38 +01:00
Jon Skeet
5e0cfc9a47 Added newlines 2015-07-22 20:13:37 +01:00
Jon Skeet
20bf6a563a First pass at making field access simpler.
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 :)
2015-07-22 20:13:37 +01:00
Jan Tattermusch
7b5c396799 Merge pull request #625 from jskeet/reflection-refactor
Reflection refactor
2015-07-22 10:36:06 -07:00
Jon Skeet
43d64b4f54 Fix typo in Makefile.am 2015-07-22 14:32:27 +01:00
Jon Skeet
e2368c9022 Fix attribute mistake and regenerate code. 2015-07-22 13:47:16 +01:00
Jon Skeet
17fd398e1a Fix file lists for C# 2015-07-22 11:40:52 +01:00
Jon Skeet
47bf49b9fa Generated code for previous commit. 2015-07-22 11:39:38 +01:00
Jon Skeet
4668c3dc39 Remove the usage of attributes for field/method discovery.
Instead, introduce GeneratedCodeInfo which passes in what we need, and adjust the codegen to take account of this.
2015-07-22 11:38:22 +01:00
Paul Yang
1647e63c57 Merge pull request #602 from TeBoring/objectivec
Add packTo and unpackFrom in google.protobuf.Any.
2015-07-21 20:50:20 -07:00
TeBoring
7366efd81e Add packFrom, unpackTo and is in google.protobuf.Any.
The previous two methods make it easy to transform between any and normal message.
unPackeTo will throw error if the type url in any doesn't match the type of the message to be transformed to.
is checks any's type url matches the give GPBMessage type.
2015-07-21 15:45:02 -07:00
Jon Skeet
8d115298c7 Fix comment typo 2015-07-21 12:59:42 +01:00
Jon Skeet
96cffaa8e3 Generated code changes following previous commit. 2015-07-21 12:59:41 +01:00
Jon Skeet
53c399a1d6 Revamp to reflection.
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.
2015-07-21 12:59:40 +01:00