Commit Graph

2484 Commits

Author SHA1 Message Date
Jon Skeet
801b169bce Addressed issues raised in code review. Will merge when green. 2015-08-03 09:26:05 +01:00
Jon Skeet
16e272e0c4 Format JSON for Duration and Timestamp.
This is taking an approach of putting all the logic in JsonFormatter. That's helpful in terms of concealing the details of whether or not to wrap the value in quotes, but it does lack flexibility. I don't *think* we want to allow user-defined formatting of messages, so that much shouldn't be a problem.
2015-08-03 09:26:04 +01:00
Jan Tattermusch
80f89b4ecf Merge pull request #669 from jskeet/simpify-json-tests
Simpify json tests
2015-08-01 13:34:14 -07:00
Jan Tattermusch
82aa6bbdfc Merge pull request #668 from jskeet/json_ordering
Fix C# JSON field ordering
2015-08-01 13:30:07 -07:00
Paul Yang
bfbf35da9e Merge pull request #643 from yukawa/fix_win_unicode_build
Fix build failure on Windows when Unicode build is enabled.
2015-07-31 11:36:51 -07:00
Jan Tattermusch
abd7083b0c Merge pull request #667 from jskeet/fix-field-orderings
Fix trivial bug in field orderings.
2015-07-31 11:29:07 -07:00
Jon Skeet
6cf5f660e5 Simplify the JSON tests for readability
Use ' instead of " in the expected JSON, then replace it before asserting.
2015-07-31 10:46:24 +01:00
Jon Skeet
4fed0b515f Fix JSON formatting to always emit fields in field order, including oneofs 2015-07-31 10:34:20 +01:00
Jon Skeet
fd02e45b2a Fix trivial bug in field orderings.
(Shows the benefit of unit testing even code "too simple to fail"...)
2015-07-31 10:34:04 +01:00
Jon Skeet
c20f67fdb4 Merge pull request #666 from jskeet/wkt-times
Well-known type operations for Timestamp and Duration
2015-07-31 10:12:52 +01:00
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
Yohei Yukawa
8c27eea686 Fix build failure on Windows when Unicode build is enabled.
This is a follow up CL for e9abc404df,
which breaks build when UNICODE macro is defined.

protoc has explicitly called MBCS version of APIs / funcsions
rather than UTF-16 (wchar_t) version of them regardless of
UNICODE macro definition (and it indeed works as expected).
Hence it makes sense to call GetModuleFileNameA explicitly.
2015-07-30 18:10:17 -07: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