Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
41824d93
Commit
41824d93
authored
Nov 22, 2015
by
Jon Skeet
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #990 from jskeet/naming
Tidying up reflection further
parents
d6202a9b
a2667aaf
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
95 additions
and
68 deletions
+95
-68
Addressbook.cs
csharp/src/AddressBook/Addressbook.cs
+1
-1
Conformance.cs
csharp/src/Google.Protobuf.Conformance/Conformance.cs
+1
-1
DescriptorsTest.cs
...rp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs
+6
-12
MapUnittestProto3.cs
.../src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs
+1
-1
UnittestImportProto3.cs
...c/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs
+1
-1
UnittestImportPublicProto3.cs
...le.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs
+1
-1
UnittestIssues.cs
csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs
+1
-1
UnittestProto3.cs
csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs
+1
-1
UnittestWellKnownTypes.cs
...Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs
+1
-1
JsonFormatter.cs
csharp/src/Google.Protobuf/JsonFormatter.cs
+1
-2
JsonParser.cs
csharp/src/Google.Protobuf/JsonParser.cs
+1
-2
Descriptor.cs
csharp/src/Google.Protobuf/Reflection/Descriptor.cs
+1
-1
EnumDescriptor.cs
csharp/src/Google.Protobuf/Reflection/EnumDescriptor.cs
+5
-5
FieldDescriptor.cs
csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs
+21
-12
FileDescriptor.cs
csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs
+0
-0
GeneratedCodeInfo.cs
csharp/src/Google.Protobuf/Reflection/GeneratedCodeInfo.cs
+36
-5
MessageDescriptor.cs
csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs
+0
-0
OneofDescriptor.cs
csharp/src/Google.Protobuf/Reflection/OneofDescriptor.cs
+5
-10
Any.cs
csharp/src/Google.Protobuf/WellKnownTypes/Any.cs
+1
-1
Api.cs
csharp/src/Google.Protobuf/WellKnownTypes/Api.cs
+1
-1
Duration.cs
csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs
+1
-1
Empty.cs
csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs
+1
-1
FieldMask.cs
csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs
+1
-1
SourceContext.cs
csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs
+1
-1
Struct.cs
csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs
+1
-1
Timestamp.cs
csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs
+1
-1
Type.cs
csharp/src/Google.Protobuf/WellKnownTypes/Type.cs
+1
-1
Wrappers.cs
csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs
+1
-1
csharp_reflection_class.cc
...oogle/protobuf/compiler/csharp/csharp_reflection_class.cc
+1
-1
No files found.
csharp/src/AddressBook/Addressbook.cs
View file @
41824d93
...
...
@@ -32,7 +32,7 @@ namespace Google.Protobuf.Examples.AddressBook {
"GAEgAygLMhAudHV0b3JpYWwuUGVyc29uQlAKFGNvbS5leGFtcGxlLnR1dG9y"
,
"aWFsQhFBZGRyZXNzQm9va1Byb3Rvc6oCJEdvb2dsZS5Qcm90b2J1Zi5FeGFt"
,
"cGxlcy5BZGRyZXNzQm9va2IGcHJvdG8z"
));
descriptor
=
pbr
::
FileDescriptor
.
InternalBuildGeneratedFileFrom
(
descriptorData
,
descriptor
=
pbr
::
FileDescriptor
.
FromGeneratedCode
(
descriptorData
,
new
pbr
::
FileDescriptor
[]
{
},
new
pbr
::
GeneratedCodeInfo
(
null
,
new
pbr
::
GeneratedCodeInfo
[]
{
new
pbr
::
GeneratedCodeInfo
(
typeof
(
global
::
Google
.
Protobuf
.
Examples
.
AddressBook
.
Person
),
global
::
Google
.
Protobuf
.
Examples
.
AddressBook
.
Person
.
Parser
,
new
[]{
"Name"
,
"Id"
,
"Email"
,
"Phones"
},
null
,
new
[]{
typeof
(
global
::
Google
.
Protobuf
.
Examples
.
AddressBook
.
Person
.
Types
.
PhoneType
)
},
new
pbr
::
GeneratedCodeInfo
[]
{
new
pbr
::
GeneratedCodeInfo
(
typeof
(
global
::
Google
.
Protobuf
.
Examples
.
AddressBook
.
Person
.
Types
.
PhoneNumber
),
global
::
Google
.
Protobuf
.
Examples
.
AddressBook
.
Person
.
Types
.
PhoneNumber
.
Parser
,
new
[]{
"Number"
,
"Type"
},
null
,
null
,
null
)}),
...
...
csharp/src/Google.Protobuf.Conformance/Conformance.cs
View file @
41824d93
...
...
@@ -134,7 +134,7 @@ namespace Conformance {
"QlVGEAESCAoESlNPThACKkAKC0ZvcmVpZ25FbnVtEg8KC0ZPUkVJR05fRk9P"
,
"EAASDwoLRk9SRUlHTl9CQVIQARIPCgtGT1JFSUdOX0JBWhACQiEKH2NvbS5n"
,
"b29nbGUucHJvdG9idWYuY29uZm9ybWFuY2ViBnByb3RvMw=="
));
descriptor
=
pbr
::
FileDescriptor
.
InternalBuildGeneratedFileFrom
(
descriptorData
,
descriptor
=
pbr
::
FileDescriptor
.
FromGeneratedCode
(
descriptorData
,
new
pbr
::
FileDescriptor
[]
{
},
new
pbr
::
GeneratedCodeInfo
(
new
[]
{
typeof
(
global
::
Conformance
.
WireFormat
),
typeof
(
global
::
Conformance
.
ForeignEnum
),
},
new
pbr
::
GeneratedCodeInfo
[]
{
new
pbr
::
GeneratedCodeInfo
(
typeof
(
global
::
Conformance
.
ConformanceRequest
),
global
::
Conformance
.
ConformanceRequest
.
Parser
,
new
[]{
"ProtobufPayload"
,
"JsonPayload"
,
"RequestedOutputFormat"
},
new
[]{
"Payload"
},
null
,
null
),
...
...
csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs
View file @
41824d93
...
...
@@ -63,7 +63,7 @@ namespace Google.Protobuf.Reflection
Assert
.
AreEqual
(
UnittestImportProto3Reflection
.
Descriptor
,
file
.
Dependencies
[
0
]);
MessageDescriptor
messageType
=
TestAllTypes
.
Descriptor
;
Assert
.
AreSame
(
typeof
(
TestAllTypes
),
messageType
.
Generated
Type
);
Assert
.
AreSame
(
typeof
(
TestAllTypes
),
messageType
.
Clr
Type
);
Assert
.
AreSame
(
TestAllTypes
.
Parser
,
messageType
.
Parser
);
Assert
.
AreEqual
(
messageType
,
file
.
MessageTypes
[
0
]);
Assert
.
AreEqual
(
messageType
,
file
.
FindTypeByName
<
MessageDescriptor
>(
"TestAllTypes"
));
...
...
@@ -227,18 +227,12 @@ namespace Google.Protobuf.Reflection
}
[
Test
]
public
void
ConstructionWithoutGeneratedCodeInfo
()
public
void
MapEntryMessageDescriptor
()
{
var
data
=
UnittestIssuesReflection
.
Descriptor
.
Proto
.
ToByteArray
();
var
newDescriptor
=
Google
.
Protobuf
.
Reflection
.
FileDescriptor
.
InternalBuildGeneratedFileFrom
(
data
,
new
Reflection
.
FileDescriptor
[]
{
},
null
);
// We should still be able to get at a field...
var
messageDescriptor
=
newDescriptor
.
FindTypeByName
<
MessageDescriptor
>(
"ItemField"
);
var
fieldDescriptor
=
messageDescriptor
.
FindFieldByName
(
"item"
);
// But there shouldn't be an accessor (or a generated type for the message, or parser)
Assert
.
IsNull
(
fieldDescriptor
.
Accessor
);
Assert
.
IsNull
(
messageDescriptor
.
GeneratedType
);
Assert
.
IsNull
(
messageDescriptor
.
Parser
);
var
descriptor
=
MapWellKnownTypes
.
Descriptor
.
NestedTypes
[
0
];
Assert
.
IsNull
(
descriptor
.
Parser
);
Assert
.
IsNull
(
descriptor
.
ClrType
);
Assert
.
IsNull
(
descriptor
.
Fields
[
1
].
Accessor
);
}
// From TestFieldOrdering:
...
...
csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs
View file @
41824d93
...
...
@@ -147,7 +147,7 @@ namespace Google.Protobuf.TestProtos {
"dmFsdWUYAiABKAU6AjgBKj8KB01hcEVudW0SEAoMTUFQX0VOVU1fRk9PEAAS"
,
"EAoMTUFQX0VOVU1fQkFSEAESEAoMTUFQX0VOVU1fQkFaEAJCIPgBAaoCGkdv"
,
"b2dsZS5Qcm90b2J1Zi5UZXN0UHJvdG9zYgZwcm90bzM="
));
descriptor
=
pbr
::
FileDescriptor
.
InternalBuildGeneratedFileFrom
(
descriptorData
,
descriptor
=
pbr
::
FileDescriptor
.
FromGeneratedCode
(
descriptorData
,
new
pbr
::
FileDescriptor
[]
{
global
::
Google
.
Protobuf
.
TestProtos
.
UnittestProto3Reflection
.
Descriptor
,
},
new
pbr
::
GeneratedCodeInfo
(
new
[]
{
typeof
(
global
::
Google
.
Protobuf
.
TestProtos
.
MapEnum
),
},
new
pbr
::
GeneratedCodeInfo
[]
{
new
pbr
::
GeneratedCodeInfo
(
typeof
(
global
::
Google
.
Protobuf
.
TestProtos
.
TestMap
),
global
::
Google
.
Protobuf
.
TestProtos
.
TestMap
.
Parser
,
new
[]{
"MapInt32Int32"
,
"MapInt64Int64"
,
"MapUint32Uint32"
,
"MapUint64Uint64"
,
"MapSint32Sint32"
,
"MapSint64Sint64"
,
"MapFixed32Fixed32"
,
"MapFixed64Fixed64"
,
"MapSfixed32Sfixed32"
,
"MapSfixed64Sfixed64"
,
"MapInt32Float"
,
"MapInt32Double"
,
"MapBoolBool"
,
"MapStringString"
,
"MapInt32Bytes"
,
"MapInt32Enum"
,
"MapInt32ForeignMessage"
},
null
,
null
,
new
pbr
::
GeneratedCodeInfo
[]
{
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
}),
...
...
csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs
View file @
41824d93
...
...
@@ -31,7 +31,7 @@ namespace Google.Protobuf.TestProtos {
"UhAIEg4KCklNUE9SVF9CQVoQCUI8Chhjb20uZ29vZ2xlLnByb3RvYnVmLnRl"
,
"c3RIAfgBAaoCGkdvb2dsZS5Qcm90b2J1Zi5UZXN0UHJvdG9zUABiBnByb3Rv"
,
"Mw=="
));
descriptor
=
pbr
::
FileDescriptor
.
InternalBuildGeneratedFileFrom
(
descriptorData
,
descriptor
=
pbr
::
FileDescriptor
.
FromGeneratedCode
(
descriptorData
,
new
pbr
::
FileDescriptor
[]
{
global
::
Google
.
Protobuf
.
TestProtos
.
UnittestImportPublicProto3Reflection
.
Descriptor
,
},
new
pbr
::
GeneratedCodeInfo
(
new
[]
{
typeof
(
global
::
Google
.
Protobuf
.
TestProtos
.
ImportEnum
),
},
new
pbr
::
GeneratedCodeInfo
[]
{
new
pbr
::
GeneratedCodeInfo
(
typeof
(
global
::
Google
.
Protobuf
.
TestProtos
.
ImportMessage
),
global
::
Google
.
Protobuf
.
TestProtos
.
ImportMessage
.
Parser
,
new
[]{
"D"
},
null
,
null
,
null
)
...
...
csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs
View file @
41824d93
...
...
@@ -27,7 +27,7 @@ namespace Google.Protobuf.TestProtos {
"bzMucHJvdG8SGHByb3RvYnVmX3VuaXR0ZXN0X2ltcG9ydCIgChNQdWJsaWNJ"
,
"bXBvcnRNZXNzYWdlEgkKAWUYASABKAVCNwoYY29tLmdvb2dsZS5wcm90b2J1"
,
"Zi50ZXN0qgIaR29vZ2xlLlByb3RvYnVmLlRlc3RQcm90b3NiBnByb3RvMw=="
));
descriptor
=
pbr
::
FileDescriptor
.
InternalBuildGeneratedFileFrom
(
descriptorData
,
descriptor
=
pbr
::
FileDescriptor
.
FromGeneratedCode
(
descriptorData
,
new
pbr
::
FileDescriptor
[]
{
},
new
pbr
::
GeneratedCodeInfo
(
null
,
new
pbr
::
GeneratedCodeInfo
[]
{
new
pbr
::
GeneratedCodeInfo
(
typeof
(
global
::
Google
.
Protobuf
.
TestProtos
.
PublicImportMessage
),
global
::
Google
.
Protobuf
.
TestProtos
.
PublicImportMessage
.
Parser
,
new
[]{
"E"
},
null
,
null
,
null
)
...
...
csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs
View file @
41824d93
...
...
@@ -46,7 +46,7 @@ namespace UnitTest.Issues.TestProtos {
"aXZlQmVsb3cQ+///////////ARIVCghNaW51c09uZRD///////////8BKi4K"
,
"DkRlcHJlY2F0ZWRFbnVtEhMKD0RFUFJFQ0FURURfWkVSTxAAEgcKA29uZRAB"
,
"Qh9IAaoCGlVuaXRUZXN0Lklzc3Vlcy5UZXN0UHJvdG9zYgZwcm90bzM="
));
descriptor
=
pbr
::
FileDescriptor
.
InternalBuildGeneratedFileFrom
(
descriptorData
,
descriptor
=
pbr
::
FileDescriptor
.
FromGeneratedCode
(
descriptorData
,
new
pbr
::
FileDescriptor
[]
{
},
new
pbr
::
GeneratedCodeInfo
(
new
[]
{
typeof
(
global
::
UnitTest
.
Issues
.
TestProtos
.
NegativeEnum
),
typeof
(
global
::
UnitTest
.
Issues
.
TestProtos
.
DeprecatedEnum
),
},
new
pbr
::
GeneratedCodeInfo
[]
{
new
pbr
::
GeneratedCodeInfo
(
typeof
(
global
::
UnitTest
.
Issues
.
TestProtos
.
Issue307
),
global
::
UnitTest
.
Issues
.
TestProtos
.
Issue307
.
Parser
,
null
,
null
,
null
,
new
pbr
::
GeneratedCodeInfo
[]
{
new
pbr
::
GeneratedCodeInfo
(
typeof
(
global
::
UnitTest
.
Issues
.
TestProtos
.
Issue307
.
Types
.
NestedOnce
),
global
::
UnitTest
.
Issues
.
TestProtos
.
Issue307
.
Types
.
NestedOnce
.
Parser
,
null
,
null
,
null
,
new
pbr
::
GeneratedCodeInfo
[]
{
new
pbr
::
GeneratedCodeInfo
(
typeof
(
global
::
UnitTest
.
Issues
.
TestProtos
.
Issue307
.
Types
.
NestedOnce
.
Types
.
NestedTwice
),
global
::
UnitTest
.
Issues
.
TestProtos
.
Issue307
.
Types
.
NestedOnce
.
Types
.
NestedTwice
.
Parser
,
null
,
null
,
null
,
null
)})}),
...
...
csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs
View file @
41824d93
...
...
@@ -150,7 +150,7 @@ namespace Google.Protobuf.TestProtos {
"HS5wcm90b2J1Zl91bml0dGVzdC5CYXJSZXF1ZXN0Gh4ucHJvdG9idWZfdW5p"
,
"dHRlc3QuQmFyUmVzcG9uc2VCOkINVW5pdHRlc3RQcm90b0gBgAEBiAEBkAEB"
,
"+AEBqgIaR29vZ2xlLlByb3RvYnVmLlRlc3RQcm90b3NiBnByb3RvMw=="
));
descriptor
=
pbr
::
FileDescriptor
.
InternalBuildGeneratedFileFrom
(
descriptorData
,
descriptor
=
pbr
::
FileDescriptor
.
FromGeneratedCode
(
descriptorData
,
new
pbr
::
FileDescriptor
[]
{
global
::
Google
.
Protobuf
.
TestProtos
.
UnittestImportProto3Reflection
.
Descriptor
,
},
new
pbr
::
GeneratedCodeInfo
(
new
[]
{
typeof
(
global
::
Google
.
Protobuf
.
TestProtos
.
ForeignEnum
),
typeof
(
global
::
Google
.
Protobuf
.
TestProtos
.
TestEnumWithDupValue
),
typeof
(
global
::
Google
.
Protobuf
.
TestProtos
.
TestSparseEnum
),
},
new
pbr
::
GeneratedCodeInfo
[]
{
new
pbr
::
GeneratedCodeInfo
(
typeof
(
global
::
Google
.
Protobuf
.
TestProtos
.
TestAllTypes
),
global
::
Google
.
Protobuf
.
TestProtos
.
TestAllTypes
.
Parser
,
new
[]{
"SingleInt32"
,
"SingleInt64"
,
"SingleUint32"
,
"SingleUint64"
,
"SingleSint32"
,
"SingleSint64"
,
"SingleFixed32"
,
"SingleFixed64"
,
"SingleSfixed32"
,
"SingleSfixed64"
,
"SingleFloat"
,
"SingleDouble"
,
"SingleBool"
,
"SingleString"
,
"SingleBytes"
,
"SingleNestedMessage"
,
"SingleForeignMessage"
,
"SingleImportMessage"
,
"SingleNestedEnum"
,
"SingleForeignEnum"
,
"SingleImportEnum"
,
"SinglePublicImportMessage"
,
"RepeatedInt32"
,
"RepeatedInt64"
,
"RepeatedUint32"
,
"RepeatedUint64"
,
"RepeatedSint32"
,
"RepeatedSint64"
,
"RepeatedFixed32"
,
"RepeatedFixed64"
,
"RepeatedSfixed32"
,
"RepeatedSfixed64"
,
"RepeatedFloat"
,
"RepeatedDouble"
,
"RepeatedBool"
,
"RepeatedString"
,
"RepeatedBytes"
,
"RepeatedNestedMessage"
,
"RepeatedForeignMessage"
,
"RepeatedImportMessage"
,
"RepeatedNestedEnum"
,
"RepeatedForeignEnum"
,
"RepeatedImportEnum"
,
"RepeatedPublicImportMessage"
,
"OneofUint32"
,
"OneofNestedMessage"
,
"OneofString"
,
"OneofBytes"
},
new
[]{
"OneofField"
},
new
[]{
typeof
(
global
::
Google
.
Protobuf
.
TestProtos
.
TestAllTypes
.
Types
.
NestedEnum
)
},
new
pbr
::
GeneratedCodeInfo
[]
{
new
pbr
::
GeneratedCodeInfo
(
typeof
(
global
::
Google
.
Protobuf
.
TestProtos
.
TestAllTypes
.
Types
.
NestedMessage
),
global
::
Google
.
Protobuf
.
TestProtos
.
TestAllTypes
.
Types
.
NestedMessage
.
Parser
,
new
[]{
"Bb"
},
null
,
null
,
null
)}),
...
...
csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs
View file @
41824d93
...
...
@@ -159,7 +159,7 @@ namespace Google.Protobuf.TestProtos {
"AiABKAsyGy5nb29nbGUucHJvdG9idWYuQnl0ZXNWYWx1ZToCOAFCOQoYY29t"
,
"Lmdvb2dsZS5wcm90b2J1Zi50ZXN0UAGqAhpHb29nbGUuUHJvdG9idWYuVGVz"
,
"dFByb3Rvc2IGcHJvdG8z"
));
descriptor
=
pbr
::
FileDescriptor
.
InternalBuildGeneratedFileFrom
(
descriptorData
,
descriptor
=
pbr
::
FileDescriptor
.
FromGeneratedCode
(
descriptorData
,
new
pbr
::
FileDescriptor
[]
{
global
::
Google
.
Protobuf
.
WellKnownTypes
.
AnyReflection
.
Descriptor
,
global
::
Google
.
Protobuf
.
WellKnownTypes
.
ApiReflection
.
Descriptor
,
global
::
Google
.
Protobuf
.
WellKnownTypes
.
DurationReflection
.
Descriptor
,
global
::
Google
.
Protobuf
.
WellKnownTypes
.
EmptyReflection
.
Descriptor
,
global
::
Google
.
Protobuf
.
WellKnownTypes
.
FieldMaskReflection
.
Descriptor
,
global
::
Google
.
Protobuf
.
WellKnownTypes
.
SourceContextReflection
.
Descriptor
,
global
::
Google
.
Protobuf
.
WellKnownTypes
.
StructReflection
.
Descriptor
,
global
::
Google
.
Protobuf
.
WellKnownTypes
.
TimestampReflection
.
Descriptor
,
global
::
Google
.
Protobuf
.
WellKnownTypes
.
TypeReflection
.
Descriptor
,
global
::
Google
.
Protobuf
.
WellKnownTypes
.
WrappersReflection
.
Descriptor
,
},
new
pbr
::
GeneratedCodeInfo
(
null
,
new
pbr
::
GeneratedCodeInfo
[]
{
new
pbr
::
GeneratedCodeInfo
(
typeof
(
global
::
Google
.
Protobuf
.
TestProtos
.
TestWellKnownTypes
),
global
::
Google
.
Protobuf
.
TestProtos
.
TestWellKnownTypes
.
Parser
,
new
[]{
"AnyField"
,
"ApiField"
,
"DurationField"
,
"EmptyField"
,
"FieldMaskField"
,
"SourceContextField"
,
"StructField"
,
"TimestampField"
,
"TypeField"
,
"DoubleField"
,
"FloatField"
,
"Int64Field"
,
"Uint64Field"
,
"Int32Field"
,
"Uint32Field"
,
"BoolField"
,
"StringField"
,
"BytesField"
},
null
,
null
,
null
),
...
...
csharp/src/Google.Protobuf/JsonFormatter.cs
View file @
41824d93
...
...
@@ -388,8 +388,7 @@ namespace Google.Protobuf
// If it's the message form, we can extract the value first, which *will* be the (possibly boxed) native value,
// and then proceed, writing it as if we were definitely in a field. (We never need to wrap it in an extra string...
// WriteValue will do the right thing.)
// TODO: Detect this differently when we have dynamic messages.
if
(
descriptor
.
File
==
Int32Value
.
Descriptor
.
File
)
if
(
descriptor
.
IsWrapperType
)
{
if
(
value
is
IMessage
)
{
...
...
csharp/src/Google.Protobuf/JsonParser.cs
View file @
41824d93
...
...
@@ -291,8 +291,7 @@ namespace Google.Protobuf
{
// Parse wrapper types as their constituent types.
// TODO: What does this mean for null?
// TODO: Detect this differently when we have dynamic messages, and put it in one place...
if
(
field
.
MessageType
.
IsWellKnownType
&&
field
.
MessageType
.
File
==
Int32Value
.
Descriptor
.
File
)
if
(
field
.
MessageType
.
IsWrapperType
)
{
field
=
field
.
MessageType
.
Fields
[
WrappersReflection
.
WrapperValueFieldNumber
];
fieldType
=
field
.
FieldType
;
...
...
csharp/src/Google.Protobuf/Reflection/Descriptor.cs
View file @
41824d93
...
...
@@ -135,7 +135,7 @@ namespace Google.Protobuf.Reflection {
"X2NvbW1lbnRzGAYgAygJQlgKE2NvbS5nb29nbGUucHJvdG9idWZCEERlc2Ny"
,
"aXB0b3JQcm90b3NIAVoKZGVzY3JpcHRvcqICA0dQQqoCGkdvb2dsZS5Qcm90"
,
"b2J1Zi5SZWZsZWN0aW9u"
));
descriptor
=
pbr
::
FileDescriptor
.
InternalBuildGeneratedFileFrom
(
descriptorData
,
descriptor
=
pbr
::
FileDescriptor
.
FromGeneratedCode
(
descriptorData
,
new
pbr
::
FileDescriptor
[]
{
},
new
pbr
::
GeneratedCodeInfo
(
null
,
new
pbr
::
GeneratedCodeInfo
[]
{
new
pbr
::
GeneratedCodeInfo
(
typeof
(
global
::
Google
.
Protobuf
.
Reflection
.
FileDescriptorSet
),
global
::
Google
.
Protobuf
.
Reflection
.
FileDescriptorSet
.
Parser
,
new
[]{
"File"
},
null
,
null
,
null
),
...
...
csharp/src/Google.Protobuf/Reflection/EnumDescriptor.cs
View file @
41824d93
...
...
@@ -43,13 +43,13 @@ namespace Google.Protobuf.Reflection
private
readonly
EnumDescriptorProto
proto
;
private
readonly
MessageDescriptor
containingType
;
private
readonly
IList
<
EnumValueDescriptor
>
values
;
private
readonly
Type
generated
Type
;
private
readonly
Type
clr
Type
;
internal
EnumDescriptor
(
EnumDescriptorProto
proto
,
FileDescriptor
file
,
MessageDescriptor
parent
,
int
index
,
Type
generated
Type
)
internal
EnumDescriptor
(
EnumDescriptorProto
proto
,
FileDescriptor
file
,
MessageDescriptor
parent
,
int
index
,
Type
clr
Type
)
:
base
(
file
,
file
.
ComputeFullName
(
parent
,
proto
.
Name
),
index
)
{
this
.
proto
=
proto
;
this
.
generatedType
=
generated
Type
;
this
.
clrType
=
clr
Type
;
containingType
=
parent
;
if
(
proto
.
Value
.
Count
==
0
)
...
...
@@ -73,9 +73,9 @@ namespace Google.Protobuf.Reflection
public
override
string
Name
{
get
{
return
proto
.
Name
;
}
}
/// <summary>
/// The
generated type for this enum, or <c>null</c> if the descriptor does not represent a generated
type.
/// The
CLR type for this enum. For generated code, this will be a CLR enum
type.
/// </summary>
public
Type
GeneratedType
{
get
{
return
generated
Type
;
}
}
public
Type
ClrType
{
get
{
return
clr
Type
;
}
}
/// <value>
/// If this is a nested type, get the outer descriptor, otherwise null.
...
...
csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs
View file @
41824d93
...
...
@@ -62,8 +62,7 @@ namespace Google.Protobuf.Reflection
if
(
FieldNumber
<=
0
)
{
throw
new
DescriptorValidationException
(
this
,
"Field numbers must be positive integers."
);
throw
new
DescriptorValidationException
(
this
,
"Field numbers must be positive integers."
);
}
containingType
=
parent
;
// OneofIndex "defaults" to -1 due to a hack in FieldDescriptor.OnConstruction.
...
...
@@ -72,7 +71,7 @@ namespace Google.Protobuf.Reflection
if
(
proto
.
OneofIndex
<
0
||
proto
.
OneofIndex
>=
parent
.
Proto
.
OneofDecl
.
Count
)
{
throw
new
DescriptorValidationException
(
this
,
"FieldDescriptorProto.oneof_index is out of range for type "
+
parent
.
Name
);
$"FieldDescriptorProto.oneof_index is out of range for type
{
parent
.
Name
}
"
);
}
containingOneof
=
parent
.
Oneofs
[
proto
.
OneofIndex
];
}
...
...
@@ -94,13 +93,22 @@ namespace Google.Protobuf.Reflection
internal
FieldDescriptorProto
Proto
{
get
{
return
proto
;
}
}
/// <summary>
/// Returns the accessor for this field, or <c>null</c> if this descriptor does
/// not support reflective access.
/// Returns the accessor for this field.
/// </summary>
/// <remarks>
/// <para>
/// While a <see cref="FieldDescriptor"/> describes the field, it does not provide
/// any way of obtaining or changing the value of the field within a specific message;
/// that is the responsibility of the accessor.
/// </para>
/// <para>
/// The value returned by this property will be non-null for all regular fields. However,
/// if a message containing a map field is introspected, the list of nested messages will include
/// an auto-generated nested key/value pair message for the field. This is not represented in any
/// generated type, and the value of the map field itself is represented by a dictionary in the
/// reflection API. There are never instances of those "hidden" messages, so no accessor is provided
/// and this property will return null.
/// </para>
/// </remarks>
public
IFieldAccessor
Accessor
{
get
{
return
accessor
;
}
}
...
...
@@ -281,7 +289,7 @@ namespace Google.Protobuf.Reflection
}
else
{
throw
new
DescriptorValidationException
(
this
,
"\""
+
Proto
.
TypeName
+
"
\" is not a type."
);
throw
new
DescriptorValidationException
(
this
,
$"\"
{
Proto
.
TypeName
}
\" is not a type."
);
}
}
...
...
@@ -289,8 +297,7 @@ namespace Google.Protobuf.Reflection
{
if
(!(
typeDescriptor
is
MessageDescriptor
))
{
throw
new
DescriptorValidationException
(
this
,
"\""
+
Proto
.
TypeName
+
"\" is not a message type."
);
throw
new
DescriptorValidationException
(
this
,
$"\"
{
Proto
.
TypeName
}
\" is not a message type."
);
}
messageType
=
(
MessageDescriptor
)
typeDescriptor
;
...
...
@@ -303,7 +310,7 @@ namespace Google.Protobuf.Reflection
{
if
(!(
typeDescriptor
is
EnumDescriptor
))
{
throw
new
DescriptorValidationException
(
this
,
"\""
+
Proto
.
TypeName
+
"
\" is not an enum type."
);
throw
new
DescriptorValidationException
(
this
,
$"\"
{
Proto
.
TypeName
}
\" is not an enum type."
);
}
enumType
=
(
EnumDescriptor
)
typeDescriptor
;
}
...
...
@@ -333,14 +340,16 @@ namespace Google.Protobuf.Reflection
private
IFieldAccessor
CreateAccessor
(
string
propertyName
)
{
if
(
containingType
.
GeneratedType
==
null
||
propertyName
==
null
)
// If we're given no property name, that's because we really don't want an accessor.
// (At the moment, that means it's a map entry message...)
if
(
propertyName
==
null
)
{
return
null
;
}
var
property
=
containingType
.
Generated
Type
.
GetProperty
(
propertyName
);
var
property
=
containingType
.
Clr
Type
.
GetProperty
(
propertyName
);
if
(
property
==
null
)
{
throw
new
DescriptorValidationException
(
this
,
"Property "
+
propertyName
+
" not found in "
+
containingType
.
GeneratedType
);
throw
new
DescriptorValidationException
(
this
,
$"Property
{
propertyName
}
not found in
{
containingType
.
ClrType
}
"
);
}
return
IsMap
?
new
MapFieldAccessor
(
property
,
this
)
:
IsRepeated
?
new
RepeatedFieldAccessor
(
property
,
this
)
...
...
csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs
View file @
41824d93
This diff is collapsed.
Click to expand it.
csharp/src/Google.Protobuf/Reflection/GeneratedCodeInfo.cs
View file @
41824d93
#region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2015 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
using
System
;
namespace
Google.Protobuf.Reflection
...
...
@@ -20,31 +51,31 @@ namespace Google.Protobuf.Reflection
/// <summary>
/// Irrelevant for file descriptors; the parser for message descriptors.
/// </summary>
public
MessageParser
Parser
{
get
;
private
set
;
}
public
MessageParser
Parser
{
get
;
}
/// <summary>
/// Irrelevant for file descriptors; the CLR property names (in message descriptor field order)
/// for fields in the message for message descriptors.
/// </summary>
public
string
[]
PropertyNames
{
get
;
private
set
;
}
public
string
[]
PropertyNames
{
get
;
}
/// <summary>
/// Irrelevant for file descriptors; the CLR property "base" names (in message descriptor oneof order)
/// for oneofs in the message for message descriptors. It is expected that for a oneof name of "Foo",
/// there will be a "FooCase" property and a "ClearFoo" method.
/// </summary>
public
string
[]
OneofNames
{
get
;
private
set
;
}
public
string
[]
OneofNames
{
get
;
}
/// <summary>
/// The reflection information for types within this file/message descriptor. Elements may be null
/// if there is no corresponding generated type, e.g. for map entry types.
/// </summary>
public
GeneratedCodeInfo
[]
NestedTypes
{
get
;
private
set
;
}
public
GeneratedCodeInfo
[]
NestedTypes
{
get
;
}
/// <summary>
/// The CLR types for enums within this file/message descriptor.
/// </summary>
public
Type
[]
NestedEnums
{
get
;
private
set
;
}
public
Type
[]
NestedEnums
{
get
;
}
/// <summary>
/// Creates a GeneratedCodeInfo for a message descriptor, with nested types, nested enums, the CLR type, property names and oneof names.
...
...
csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs
View file @
41824d93
This diff is collapsed.
Click to expand it.
csharp/src/Google.Protobuf/Reflection/OneofDescriptor.cs
View file @
41824d93
...
...
@@ -86,8 +86,7 @@ namespace Google.Protobuf.Reflection
/// in a particular message.
/// </summary>
/// <value>
/// The accessor used for reflective access, or <c>null</c> if reflection is not
/// supported by this descriptor.
/// The accessor used for reflective access.
/// </value>
public
OneofAccessor
Accessor
{
get
{
return
accessor
;
}
}
...
...
@@ -106,19 +105,15 @@ namespace Google.Protobuf.Reflection
private
OneofAccessor
CreateAccessor
(
string
clrName
)
{
if
(
containingType
.
GeneratedType
==
null
||
clrName
==
null
)
{
return
null
;
}
var
caseProperty
=
containingType
.
GeneratedType
.
GetProperty
(
clrName
+
"Case"
);
var
caseProperty
=
containingType
.
ClrType
.
GetProperty
(
clrName
+
"Case"
);
if
(
caseProperty
==
null
)
{
throw
new
DescriptorValidationException
(
this
,
"Property "
+
clrName
+
"Case not found in "
+
containingType
.
GeneratedType
);
throw
new
DescriptorValidationException
(
this
,
$"Property
{
clrName
}
Case not found in
{
containingType
.
ClrType
}
"
);
}
var
clearMethod
=
containingType
.
Generated
Type
.
GetMethod
(
"Clear"
+
clrName
);
var
clearMethod
=
containingType
.
Clr
Type
.
GetMethod
(
"Clear"
+
clrName
);
if
(
clearMethod
==
null
)
{
throw
new
DescriptorValidationException
(
this
,
"Method Clear"
+
clrName
+
" not found in "
+
containingType
.
GeneratedType
);
throw
new
DescriptorValidationException
(
this
,
$"Method Clear
{
clrName
}
not found in
{
containingType
.
ClrType
}
"
);
}
return
new
OneofAccessor
(
caseProperty
,
clearMethod
,
this
);
...
...
csharp/src/Google.Protobuf/WellKnownTypes/Any.cs
View file @
41824d93
...
...
@@ -27,7 +27,7 @@ namespace Google.Protobuf.WellKnownTypes {
"JgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQksKE2Nv"
,
"bS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAGgAQGiAgNHUEKqAh5Hb29n"
,
"bGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw=="
));
descriptor
=
pbr
::
FileDescriptor
.
InternalBuildGeneratedFileFrom
(
descriptorData
,
descriptor
=
pbr
::
FileDescriptor
.
FromGeneratedCode
(
descriptorData
,
new
pbr
::
FileDescriptor
[]
{
},
new
pbr
::
GeneratedCodeInfo
(
null
,
new
pbr
::
GeneratedCodeInfo
[]
{
new
pbr
::
GeneratedCodeInfo
(
typeof
(
global
::
Google
.
Protobuf
.
WellKnownTypes
.
Any
),
global
::
Google
.
Protobuf
.
WellKnownTypes
.
Any
.
Parser
,
new
[]{
"TypeUrl"
,
"Value"
},
null
,
null
,
null
)
...
...
csharp/src/Google.Protobuf/WellKnownTypes/Api.cs
View file @
41824d93
...
...
@@ -39,7 +39,7 @@ namespace Google.Protobuf.WellKnownTypes {
"eCIjCgVNaXhpbhIMCgRuYW1lGAEgASgJEgwKBHJvb3QYAiABKAlCSwoTY29t"
,
"Lmdvb2dsZS5wcm90b2J1ZkIIQXBpUHJvdG9QAaABAaICA0dQQqoCHkdvb2ds"
,
"ZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IGcHJvdG8z"
));
descriptor
=
pbr
::
FileDescriptor
.
InternalBuildGeneratedFileFrom
(
descriptorData
,
descriptor
=
pbr
::
FileDescriptor
.
FromGeneratedCode
(
descriptorData
,
new
pbr
::
FileDescriptor
[]
{
global
::
Google
.
Protobuf
.
WellKnownTypes
.
SourceContextReflection
.
Descriptor
,
global
::
Google
.
Protobuf
.
WellKnownTypes
.
TypeReflection
.
Descriptor
,
},
new
pbr
::
GeneratedCodeInfo
(
null
,
new
pbr
::
GeneratedCodeInfo
[]
{
new
pbr
::
GeneratedCodeInfo
(
typeof
(
global
::
Google
.
Protobuf
.
WellKnownTypes
.
Api
),
global
::
Google
.
Protobuf
.
WellKnownTypes
.
Api
.
Parser
,
new
[]{
"Name"
,
"Methods"
,
"Options"
,
"Version"
,
"SourceContext"
,
"Mixins"
,
"Syntax"
},
null
,
null
,
null
),
...
...
csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs
View file @
41824d93
...
...
@@ -28,7 +28,7 @@ namespace Google.Protobuf.WellKnownTypes {
"ASgFQlAKE2NvbS5nb29nbGUucHJvdG9idWZCDUR1cmF0aW9uUHJvdG9QAaAB"
,
"AaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IGcHJv"
,
"dG8z"
));
descriptor
=
pbr
::
FileDescriptor
.
InternalBuildGeneratedFileFrom
(
descriptorData
,
descriptor
=
pbr
::
FileDescriptor
.
FromGeneratedCode
(
descriptorData
,
new
pbr
::
FileDescriptor
[]
{
},
new
pbr
::
GeneratedCodeInfo
(
null
,
new
pbr
::
GeneratedCodeInfo
[]
{
new
pbr
::
GeneratedCodeInfo
(
typeof
(
global
::
Google
.
Protobuf
.
WellKnownTypes
.
Duration
),
global
::
Google
.
Protobuf
.
WellKnownTypes
.
Duration
.
Parser
,
new
[]{
"Seconds"
,
"Nanos"
},
null
,
null
,
null
)
...
...
csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs
View file @
41824d93
...
...
@@ -27,7 +27,7 @@ namespace Google.Protobuf.WellKnownTypes {
"ZiIHCgVFbXB0eUJNChNjb20uZ29vZ2xlLnByb3RvYnVmQgpFbXB0eVByb3Rv"
,
"UAGgAQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNi"
,
"BnByb3RvMw=="
));
descriptor
=
pbr
::
FileDescriptor
.
InternalBuildGeneratedFileFrom
(
descriptorData
,
descriptor
=
pbr
::
FileDescriptor
.
FromGeneratedCode
(
descriptorData
,
new
pbr
::
FileDescriptor
[]
{
},
new
pbr
::
GeneratedCodeInfo
(
null
,
new
pbr
::
GeneratedCodeInfo
[]
{
new
pbr
::
GeneratedCodeInfo
(
typeof
(
global
::
Google
.
Protobuf
.
WellKnownTypes
.
Empty
),
global
::
Google
.
Protobuf
.
WellKnownTypes
.
Empty
.
Parser
,
null
,
null
,
null
,
null
)
...
...
csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs
View file @
41824d93
...
...
@@ -27,7 +27,7 @@ namespace Google.Protobuf.WellKnownTypes {
"b3RvYnVmIhoKCUZpZWxkTWFzaxINCgVwYXRocxgBIAMoCUJRChNjb20uZ29v"
,
"Z2xlLnByb3RvYnVmQg5GaWVsZE1hc2tQcm90b1ABoAEBogIDR1BCqgIeR29v"
,
"Z2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM="
));
descriptor
=
pbr
::
FileDescriptor
.
InternalBuildGeneratedFileFrom
(
descriptorData
,
descriptor
=
pbr
::
FileDescriptor
.
FromGeneratedCode
(
descriptorData
,
new
pbr
::
FileDescriptor
[]
{
},
new
pbr
::
GeneratedCodeInfo
(
null
,
new
pbr
::
GeneratedCodeInfo
[]
{
new
pbr
::
GeneratedCodeInfo
(
typeof
(
global
::
Google
.
Protobuf
.
WellKnownTypes
.
FieldMask
),
global
::
Google
.
Protobuf
.
WellKnownTypes
.
FieldMask
.
Parser
,
new
[]{
"Paths"
},
null
,
null
,
null
)
...
...
csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs
View file @
41824d93
...
...
@@ -28,7 +28,7 @@ namespace Google.Protobuf.WellKnownTypes {
"CUJVChNjb20uZ29vZ2xlLnByb3RvYnVmQhJTb3VyY2VDb250ZXh0UHJvdG9Q"
,
"AaABAaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IG"
,
"cHJvdG8z"
));
descriptor
=
pbr
::
FileDescriptor
.
InternalBuildGeneratedFileFrom
(
descriptorData
,
descriptor
=
pbr
::
FileDescriptor
.
FromGeneratedCode
(
descriptorData
,
new
pbr
::
FileDescriptor
[]
{
},
new
pbr
::
GeneratedCodeInfo
(
null
,
new
pbr
::
GeneratedCodeInfo
[]
{
new
pbr
::
GeneratedCodeInfo
(
typeof
(
global
::
Google
.
Protobuf
.
WellKnownTypes
.
SourceContext
),
global
::
Google
.
Protobuf
.
WellKnownTypes
.
SourceContext
.
Parser
,
new
[]{
"FileName"
},
null
,
null
,
null
)
...
...
csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs
View file @
41824d93
...
...
@@ -37,7 +37,7 @@ namespace Google.Protobuf.WellKnownTypes {
"QUxVRRAAQk4KE2NvbS5nb29nbGUucHJvdG9idWZCC1N0cnVjdFByb3RvUAGg"
,
"AQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnBy"
,
"b3RvMw=="
));
descriptor
=
pbr
::
FileDescriptor
.
InternalBuildGeneratedFileFrom
(
descriptorData
,
descriptor
=
pbr
::
FileDescriptor
.
FromGeneratedCode
(
descriptorData
,
new
pbr
::
FileDescriptor
[]
{
},
new
pbr
::
GeneratedCodeInfo
(
new
[]
{
typeof
(
global
::
Google
.
Protobuf
.
WellKnownTypes
.
NullValue
),
},
new
pbr
::
GeneratedCodeInfo
[]
{
new
pbr
::
GeneratedCodeInfo
(
typeof
(
global
::
Google
.
Protobuf
.
WellKnownTypes
.
Struct
),
global
::
Google
.
Protobuf
.
WellKnownTypes
.
Struct
.
Parser
,
new
[]{
"Fields"
},
null
,
null
,
new
pbr
::
GeneratedCodeInfo
[]
{
null
,
}),
...
...
csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs
View file @
41824d93
...
...
@@ -28,7 +28,7 @@ namespace Google.Protobuf.WellKnownTypes {
"AiABKAVCUQoTY29tLmdvb2dsZS5wcm90b2J1ZkIOVGltZXN0YW1wUHJvdG9Q"
,
"AaABAaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IG"
,
"cHJvdG8z"
));
descriptor
=
pbr
::
FileDescriptor
.
InternalBuildGeneratedFileFrom
(
descriptorData
,
descriptor
=
pbr
::
FileDescriptor
.
FromGeneratedCode
(
descriptorData
,
new
pbr
::
FileDescriptor
[]
{
},
new
pbr
::
GeneratedCodeInfo
(
null
,
new
pbr
::
GeneratedCodeInfo
[]
{
new
pbr
::
GeneratedCodeInfo
(
typeof
(
global
::
Google
.
Protobuf
.
WellKnownTypes
.
Timestamp
),
global
::
Google
.
Protobuf
.
WellKnownTypes
.
Timestamp
.
Parser
,
new
[]{
"Seconds"
,
"Nanos"
},
null
,
null
,
null
)
...
...
csharp/src/Google.Protobuf/WellKnownTypes/Type.cs
View file @
41824d93
...
...
@@ -57,7 +57,7 @@ namespace Google.Protobuf.WellKnownTypes {
"dGF4EhEKDVNZTlRBWF9QUk9UTzIQABIRCg1TWU5UQVhfUFJPVE8zEAFCTAoT"
,
"Y29tLmdvb2dsZS5wcm90b2J1ZkIJVHlwZVByb3RvUAGgAQGiAgNHUEKqAh5H"
,
"b29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw=="
));
descriptor
=
pbr
::
FileDescriptor
.
InternalBuildGeneratedFileFrom
(
descriptorData
,
descriptor
=
pbr
::
FileDescriptor
.
FromGeneratedCode
(
descriptorData
,
new
pbr
::
FileDescriptor
[]
{
global
::
Google
.
Protobuf
.
WellKnownTypes
.
AnyReflection
.
Descriptor
,
global
::
Google
.
Protobuf
.
WellKnownTypes
.
SourceContextReflection
.
Descriptor
,
},
new
pbr
::
GeneratedCodeInfo
(
new
[]
{
typeof
(
global
::
Google
.
Protobuf
.
WellKnownTypes
.
Syntax
),
},
new
pbr
::
GeneratedCodeInfo
[]
{
new
pbr
::
GeneratedCodeInfo
(
typeof
(
global
::
Google
.
Protobuf
.
WellKnownTypes
.
Type
),
global
::
Google
.
Protobuf
.
WellKnownTypes
.
Type
.
Parser
,
new
[]{
"Name"
,
"Fields"
,
"Oneofs"
,
"Options"
,
"SourceContext"
,
"Syntax"
},
null
,
null
,
null
),
...
...
csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs
View file @
41824d93
...
...
@@ -32,7 +32,7 @@ namespace Google.Protobuf.WellKnownTypes {
"DQoFdmFsdWUYASABKAkiGwoKQnl0ZXNWYWx1ZRINCgV2YWx1ZRgBIAEoDEJQ"
,
"ChNjb20uZ29vZ2xlLnByb3RvYnVmQg1XcmFwcGVyc1Byb3RvUAGgAQGiAgNH"
,
"UEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw=="
));
descriptor
=
pbr
::
FileDescriptor
.
InternalBuildGeneratedFileFrom
(
descriptorData
,
descriptor
=
pbr
::
FileDescriptor
.
FromGeneratedCode
(
descriptorData
,
new
pbr
::
FileDescriptor
[]
{
},
new
pbr
::
GeneratedCodeInfo
(
null
,
new
pbr
::
GeneratedCodeInfo
[]
{
new
pbr
::
GeneratedCodeInfo
(
typeof
(
global
::
Google
.
Protobuf
.
WellKnownTypes
.
DoubleValue
),
global
::
Google
.
Protobuf
.
WellKnownTypes
.
DoubleValue
.
Parser
,
new
[]{
"Value"
},
null
,
null
,
null
),
...
...
src/google/protobuf/compiler/csharp/csharp_reflection_class.cc
View file @
41824d93
...
...
@@ -166,7 +166,7 @@ void ReflectionClassGenerator::WriteDescriptor(io::Printer* printer) {
// -----------------------------------------------------------------
// Invoke InternalBuildGeneratedFileFrom() to build the file.
printer
->
Print
(
"descriptor = pbr::FileDescriptor.
InternalBuildGeneratedFileFrom
(descriptorData,
\n
"
);
"descriptor = pbr::FileDescriptor.
FromGeneratedCode
(descriptorData,
\n
"
);
printer
->
Print
(
" new pbr::FileDescriptor[] { "
);
for
(
int
i
=
0
;
i
<
file_
->
dependency_count
();
i
++
)
{
// descriptor.proto is special: we don't allow access to the generated code, but there's
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment