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
7ee85c4e
Commit
7ee85c4e
authored
May 28, 2009
by
Jon Skeet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added field constant generation
parent
d33bff04
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
70 additions
and
2 deletions
+70
-2
AddressBookProtos.cs
src/AddressBook/AddressBookProtos.cs
+7
-0
ExtensionGenerator.cs
src/ProtoGen/ExtensionGenerator.cs
+1
-0
MessageGenerator.cs
src/ProtoGen/MessageGenerator.cs
+2
-1
SourceGeneratorBase.cs
src/ProtoGen/SourceGeneratorBase.cs
+4
-0
GeneratedMessageTest.cs
src/ProtocolBuffers.Test/GeneratedMessageTest.cs
+27
-0
UnitTestCustomOptionsProtoFile.cs
...Buffers.Test/TestProtos/UnitTestCustomOptionsProtoFile.cs
+0
-0
UnitTestEmbedOptimizeForProtoFile.cs
...fers.Test/TestProtos/UnitTestEmbedOptimizeForProtoFile.cs
+2
-0
UnitTestImportProtoFile.cs
...rotocolBuffers.Test/TestProtos/UnitTestImportProtoFile.cs
+1
-0
UnitTestMessageSetProtoFile.cs
...colBuffers.Test/TestProtos/UnitTestMessageSetProtoFile.cs
+8
-0
UnitTestOptimizeForProtoFile.cs
...olBuffers.Test/TestProtos/UnitTestOptimizeForProtoFile.cs
+6
-0
UnitTestProtoFile.cs
src/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs
+0
-0
CSharpOptions.cs
src/ProtocolBuffers/DescriptorProtos/CSharpOptions.cs
+8
-0
DescriptorProtoFile.cs
src/ProtocolBuffers/DescriptorProtos/DescriptorProtoFile.cs
+0
-0
todo.txt
todo.txt
+4
-1
No files found.
src/AddressBook/AddressBookProtos.cs
View file @
7ee85c4e
...
@@ -100,6 +100,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
...
@@ -100,6 +100,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
get
{
return
global
::
Google
.
ProtocolBuffers
.
Examples
.
AddressBook
.
AddressBookProtos
.
internal__static_tutorial_Person_PhoneNumber__FieldAccessorTable
;
}
get
{
return
global
::
Google
.
ProtocolBuffers
.
Examples
.
AddressBook
.
AddressBookProtos
.
internal__static_tutorial_Person_PhoneNumber__FieldAccessorTable
;
}
}
}
public
const
int
NumberFieldNumber
=
1
;
private
bool
hasNumber
;
private
bool
hasNumber
;
private
string
number_
=
""
;
private
string
number_
=
""
;
public
bool
HasNumber
{
public
bool
HasNumber
{
...
@@ -109,6 +110,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
...
@@ -109,6 +110,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
get
{
return
number_
;
}
get
{
return
number_
;
}
}
}
public
const
int
TypeFieldNumber
=
2
;
private
bool
hasType
;
private
bool
hasType
;
private
global
::
Google
.
ProtocolBuffers
.
Examples
.
AddressBook
.
Person
.
Types
.
PhoneType
type_
=
global
::
Google
.
ProtocolBuffers
.
Examples
.
AddressBook
.
Person
.
Types
.
PhoneType
.
HOME
;
private
global
::
Google
.
ProtocolBuffers
.
Examples
.
AddressBook
.
Person
.
Types
.
PhoneType
type_
=
global
::
Google
.
ProtocolBuffers
.
Examples
.
AddressBook
.
Person
.
Types
.
PhoneType
.
HOME
;
public
bool
HasType
{
public
bool
HasType
{
...
@@ -332,6 +334,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
...
@@ -332,6 +334,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
}
}
#
endregion
#
endregion
public
const
int
NameFieldNumber
=
1
;
private
bool
hasName
;
private
bool
hasName
;
private
string
name_
=
""
;
private
string
name_
=
""
;
public
bool
HasName
{
public
bool
HasName
{
...
@@ -341,6 +344,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
...
@@ -341,6 +344,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
get
{
return
name_
;
}
get
{
return
name_
;
}
}
}
public
const
int
IdFieldNumber
=
2
;
private
bool
hasId
;
private
bool
hasId
;
private
int
id_
=
0
;
private
int
id_
=
0
;
public
bool
HasId
{
public
bool
HasId
{
...
@@ -350,6 +354,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
...
@@ -350,6 +354,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
get
{
return
id_
;
}
get
{
return
id_
;
}
}
}
public
const
int
EmailFieldNumber
=
3
;
private
bool
hasEmail
;
private
bool
hasEmail
;
private
string
email_
=
""
;
private
string
email_
=
""
;
public
bool
HasEmail
{
public
bool
HasEmail
{
...
@@ -359,6 +364,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
...
@@ -359,6 +364,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
get
{
return
email_
;
}
get
{
return
email_
;
}
}
}
public
const
int
PhoneFieldNumber
=
4
;
private
pbc
::
PopsicleList
<
global
::
Google
.
ProtocolBuffers
.
Examples
.
AddressBook
.
Person
.
Types
.
PhoneNumber
>
phone_
=
new
pbc
::
PopsicleList
<
global
::
Google
.
ProtocolBuffers
.
Examples
.
AddressBook
.
Person
.
Types
.
PhoneNumber
>();
private
pbc
::
PopsicleList
<
global
::
Google
.
ProtocolBuffers
.
Examples
.
AddressBook
.
Person
.
Types
.
PhoneNumber
>
phone_
=
new
pbc
::
PopsicleList
<
global
::
Google
.
ProtocolBuffers
.
Examples
.
AddressBook
.
Person
.
Types
.
PhoneNumber
>();
public
scg
::
IList
<
global
::
Google
.
ProtocolBuffers
.
Examples
.
AddressBook
.
Person
.
Types
.
PhoneNumber
>
PhoneList
{
public
scg
::
IList
<
global
::
Google
.
ProtocolBuffers
.
Examples
.
AddressBook
.
Person
.
Types
.
PhoneNumber
>
PhoneList
{
get
{
return
phone_
;
}
get
{
return
phone_
;
}
...
@@ -685,6 +691,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
...
@@ -685,6 +691,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
get
{
return
global
::
Google
.
ProtocolBuffers
.
Examples
.
AddressBook
.
AddressBookProtos
.
internal__static_tutorial_AddressBook__FieldAccessorTable
;
}
get
{
return
global
::
Google
.
ProtocolBuffers
.
Examples
.
AddressBook
.
AddressBookProtos
.
internal__static_tutorial_AddressBook__FieldAccessorTable
;
}
}
}
public
const
int
PersonFieldNumber
=
1
;
private
pbc
::
PopsicleList
<
global
::
Google
.
ProtocolBuffers
.
Examples
.
AddressBook
.
Person
>
person_
=
new
pbc
::
PopsicleList
<
global
::
Google
.
ProtocolBuffers
.
Examples
.
AddressBook
.
Person
>();
private
pbc
::
PopsicleList
<
global
::
Google
.
ProtocolBuffers
.
Examples
.
AddressBook
.
Person
>
person_
=
new
pbc
::
PopsicleList
<
global
::
Google
.
ProtocolBuffers
.
Examples
.
AddressBook
.
Person
>();
public
scg
::
IList
<
global
::
Google
.
ProtocolBuffers
.
Examples
.
AddressBook
.
Person
>
PersonList
{
public
scg
::
IList
<
global
::
Google
.
ProtocolBuffers
.
Examples
.
AddressBook
.
Person
>
PersonList
{
get
{
return
person_
;
}
get
{
return
person_
;
}
...
...
src/ProtoGen/ExtensionGenerator.cs
View file @
7ee85c4e
...
@@ -24,6 +24,7 @@ namespace Google.ProtocolBuffers.ProtoGen {
...
@@ -24,6 +24,7 @@ namespace Google.ProtocolBuffers.ProtoGen {
break
;
break
;
}
}
writer
.
WriteLine
(
"public const int {0} = {1};"
,
GetFieldConstantName
(
Descriptor
),
Descriptor
.
FieldNumber
);
if
(
Descriptor
.
IsRepeated
)
{
if
(
Descriptor
.
IsRepeated
)
{
writer
.
WriteLine
(
"{0} static readonly"
,
ClassAccessLevel
);
writer
.
WriteLine
(
"{0} static readonly"
,
ClassAccessLevel
);
writer
.
WriteLine
(
" pb::GeneratedExtensionBase<scg::IList<{0}>> {1} ="
,
type
,
name
);
writer
.
WriteLine
(
" pb::GeneratedExtensionBase<scg::IList<{0}>> {1} ="
,
type
,
name
);
...
...
src/ProtoGen/MessageGenerator.cs
View file @
7ee85c4e
...
@@ -107,6 +107,7 @@ namespace Google.ProtocolBuffers.ProtoGen {
...
@@ -107,6 +107,7 @@ namespace Google.ProtocolBuffers.ProtoGen {
foreach
(
FieldDescriptor
fieldDescriptor
in
Descriptor
.
Fields
)
{
foreach
(
FieldDescriptor
fieldDescriptor
in
Descriptor
.
Fields
)
{
// Rats: we lose the debug comment here :(
// Rats: we lose the debug comment here :(
writer
.
WriteLine
(
"public const int {0} = {1};"
,
GetFieldConstantName
(
fieldDescriptor
),
fieldDescriptor
.
FieldNumber
);
SourceGenerators
.
CreateFieldGenerator
(
fieldDescriptor
).
GenerateMembers
(
writer
);
SourceGenerators
.
CreateFieldGenerator
(
fieldDescriptor
).
GenerateMembers
(
writer
);
writer
.
WriteLine
();
writer
.
WriteLine
();
}
}
...
@@ -186,7 +187,7 @@ namespace Google.ProtocolBuffers.ProtoGen {
...
@@ -186,7 +187,7 @@ namespace Google.ProtocolBuffers.ProtoGen {
writer
.
WriteLine
();
writer
.
WriteLine
();
}
}
private
void
GenerateSerializeOneField
(
TextGenerator
writer
,
FieldDescriptor
fieldDescriptor
)
{
private
static
void
GenerateSerializeOneField
(
TextGenerator
writer
,
FieldDescriptor
fieldDescriptor
)
{
SourceGenerators
.
CreateFieldGenerator
(
fieldDescriptor
).
GenerateSerializationCode
(
writer
);
SourceGenerators
.
CreateFieldGenerator
(
fieldDescriptor
).
GenerateSerializationCode
(
writer
);
}
}
...
...
src/ProtoGen/SourceGeneratorBase.cs
View file @
7ee85c4e
...
@@ -30,6 +30,10 @@ namespace Google.ProtocolBuffers.ProtoGen {
...
@@ -30,6 +30,10 @@ namespace Google.ProtocolBuffers.ProtoGen {
}
}
}
}
internal
static
string
GetFieldConstantName
(
FieldDescriptor
field
)
{
return
NameHelpers
.
UnderscoresToPascalCase
(
GetFieldName
(
field
))
+
"FieldNumber"
;
}
private
static
string
ToCSharpName
(
string
name
,
FileDescriptor
file
)
{
private
static
string
ToCSharpName
(
string
name
,
FileDescriptor
file
)
{
string
result
=
file
.
CSharpOptions
.
Namespace
;
string
result
=
file
.
CSharpOptions
.
Namespace
;
if
(
file
.
CSharpOptions
.
NestClasses
)
{
if
(
file
.
CSharpOptions
.
NestClasses
)
{
...
...
src/ProtocolBuffers.Test/GeneratedMessageTest.cs
View file @
7ee85c4e
...
@@ -397,5 +397,32 @@ namespace Google.ProtocolBuffers {
...
@@ -397,5 +397,32 @@ namespace Google.ProtocolBuffers {
TestAllTypes
message
=
builder
.
Build
();
TestAllTypes
message
=
builder
.
Build
();
TestUtil
.
AssertAllFieldsSet
(
message
.
ToBuilder
().
Build
());
TestUtil
.
AssertAllFieldsSet
(
message
.
ToBuilder
().
Build
());
}
}
[
Test
]
public
void
FieldConstantValues
()
{
Assert
.
AreEqual
(
TestAllTypes
.
Types
.
NestedMessage
.
BbFieldNumber
,
1
);
Assert
.
AreEqual
(
TestAllTypes
.
OptionalInt32FieldNumber
,
1
);
Assert
.
AreEqual
(
TestAllTypes
.
OptionalGroupFieldNumber
,
16
);
Assert
.
AreEqual
(
TestAllTypes
.
OptionalNestedMessageFieldNumber
,
18
);
Assert
.
AreEqual
(
TestAllTypes
.
OptionalNestedEnumFieldNumber
,
21
);
Assert
.
AreEqual
(
TestAllTypes
.
RepeatedInt32FieldNumber
,
31
);
Assert
.
AreEqual
(
TestAllTypes
.
RepeatedGroupFieldNumber
,
46
);
Assert
.
AreEqual
(
TestAllTypes
.
RepeatedNestedMessageFieldNumber
,
48
);
Assert
.
AreEqual
(
TestAllTypes
.
RepeatedNestedEnumFieldNumber
,
51
);
}
[
Test
]
public
void
ExtensionConstantValues
()
{
Assert
.
AreEqual
(
TestRequired
.
SingleFieldNumber
,
1000
);
Assert
.
AreEqual
(
TestRequired
.
MultiFieldNumber
,
1001
);
Assert
.
AreEqual
(
UnitTestProtoFile
.
OptionalInt32ExtensionFieldNumber
,
1
);
Assert
.
AreEqual
(
UnitTestProtoFile
.
OptionalGroupExtensionFieldNumber
,
16
);
Assert
.
AreEqual
(
UnitTestProtoFile
.
OptionalNestedMessageExtensionFieldNumber
,
18
);
Assert
.
AreEqual
(
UnitTestProtoFile
.
OptionalNestedEnumExtensionFieldNumber
,
21
);
Assert
.
AreEqual
(
UnitTestProtoFile
.
RepeatedInt32ExtensionFieldNumber
,
31
);
Assert
.
AreEqual
(
UnitTestProtoFile
.
RepeatedGroupExtensionFieldNumber
,
46
);
Assert
.
AreEqual
(
UnitTestProtoFile
.
RepeatedNestedMessageExtensionFieldNumber
,
48
);
Assert
.
AreEqual
(
UnitTestProtoFile
.
RepeatedNestedEnumExtensionFieldNumber
,
51
);
}
}
}
}
}
src/ProtocolBuffers.Test/TestProtos/UnitTestCustomOptionsProtoFile.cs
View file @
7ee85c4e
This diff is collapsed.
Click to expand it.
src/ProtocolBuffers.Test/TestProtos/UnitTestEmbedOptimizeForProtoFile.cs
View file @
7ee85c4e
...
@@ -60,6 +60,7 @@ namespace Google.ProtocolBuffers.TestProtos {
...
@@ -60,6 +60,7 @@ namespace Google.ProtocolBuffers.TestProtos {
get
{
return
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
UnitTestEmbedOptimizeForProtoFile
.
internal__static_protobuf_unittest_TestEmbedOptimizedForSize__FieldAccessorTable
;
}
get
{
return
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
UnitTestEmbedOptimizeForProtoFile
.
internal__static_protobuf_unittest_TestEmbedOptimizedForSize__FieldAccessorTable
;
}
}
}
public
const
int
OptionalMessageFieldNumber
=
1
;
private
bool
hasOptionalMessage
;
private
bool
hasOptionalMessage
;
private
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
TestOptimizedForSize
optionalMessage_
=
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
TestOptimizedForSize
.
DefaultInstance
;
private
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
TestOptimizedForSize
optionalMessage_
=
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
TestOptimizedForSize
.
DefaultInstance
;
public
bool
HasOptionalMessage
{
public
bool
HasOptionalMessage
{
...
@@ -69,6 +70,7 @@ namespace Google.ProtocolBuffers.TestProtos {
...
@@ -69,6 +70,7 @@ namespace Google.ProtocolBuffers.TestProtos {
get
{
return
optionalMessage_
;
}
get
{
return
optionalMessage_
;
}
}
}
public
const
int
RepeatedMessageFieldNumber
=
2
;
private
pbc
::
PopsicleList
<
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
TestOptimizedForSize
>
repeatedMessage_
=
new
pbc
::
PopsicleList
<
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
TestOptimizedForSize
>();
private
pbc
::
PopsicleList
<
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
TestOptimizedForSize
>
repeatedMessage_
=
new
pbc
::
PopsicleList
<
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
TestOptimizedForSize
>();
public
scg
::
IList
<
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
TestOptimizedForSize
>
RepeatedMessageList
{
public
scg
::
IList
<
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
TestOptimizedForSize
>
RepeatedMessageList
{
get
{
return
repeatedMessage_
;
}
get
{
return
repeatedMessage_
;
}
...
...
src/ProtocolBuffers.Test/TestProtos/UnitTestImportProtoFile.cs
View file @
7ee85c4e
...
@@ -66,6 +66,7 @@ namespace Google.ProtocolBuffers.TestProtos {
...
@@ -66,6 +66,7 @@ namespace Google.ProtocolBuffers.TestProtos {
get
{
return
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
UnitTestImportProtoFile
.
internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable
;
}
get
{
return
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
UnitTestImportProtoFile
.
internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable
;
}
}
}
public
const
int
DFieldNumber
=
1
;
private
bool
hasD
;
private
bool
hasD
;
private
int
d_
=
0
;
private
int
d_
=
0
;
public
bool
HasD
{
public
bool
HasD
{
...
...
src/ProtocolBuffers.Test/TestProtos/UnitTestMessageSetProtoFile.cs
View file @
7ee85c4e
...
@@ -257,6 +257,7 @@ namespace Google.ProtocolBuffers.TestProtos {
...
@@ -257,6 +257,7 @@ namespace Google.ProtocolBuffers.TestProtos {
get
{
return
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
UnitTestMessageSetProtoFile
.
internal__static_protobuf_unittest_TestMessageSetContainer__FieldAccessorTable
;
}
get
{
return
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
UnitTestMessageSetProtoFile
.
internal__static_protobuf_unittest_TestMessageSetContainer__FieldAccessorTable
;
}
}
}
public
const
int
MessageSetFieldNumber
=
1
;
private
bool
hasMessageSet
;
private
bool
hasMessageSet
;
private
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
TestMessageSet
messageSet_
=
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
TestMessageSet
.
DefaultInstance
;
private
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
TestMessageSet
messageSet_
=
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
TestMessageSet
.
DefaultInstance
;
public
bool
HasMessageSet
{
public
bool
HasMessageSet
{
...
@@ -481,8 +482,10 @@ namespace Google.ProtocolBuffers.TestProtos {
...
@@ -481,8 +482,10 @@ namespace Google.ProtocolBuffers.TestProtos {
get
{
return
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
UnitTestMessageSetProtoFile
.
internal__static_protobuf_unittest_TestMessageSetExtension1__FieldAccessorTable
;
}
get
{
return
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
UnitTestMessageSetProtoFile
.
internal__static_protobuf_unittest_TestMessageSetExtension1__FieldAccessorTable
;
}
}
}
public
const
int
MessageSetExtensionFieldNumber
=
1545008
;
public
static
readonly
pb
::
GeneratedExtensionBase
<
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
TestMessageSetExtension1
>
MessageSetExtension
=
public
static
readonly
pb
::
GeneratedExtensionBase
<
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
TestMessageSetExtension1
>
MessageSetExtension
=
pb
::
GeneratedSingleExtension
<
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
TestMessageSetExtension1
>.
CreateInstance
(
Descriptor
.
Extensions
[
0
]);
pb
::
GeneratedSingleExtension
<
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
TestMessageSetExtension1
>.
CreateInstance
(
Descriptor
.
Extensions
[
0
]);
public
const
int
IFieldNumber
=
15
;
private
bool
hasI
;
private
bool
hasI
;
private
int
i_
=
0
;
private
int
i_
=
0
;
public
bool
HasI
{
public
bool
HasI
{
...
@@ -684,8 +687,10 @@ namespace Google.ProtocolBuffers.TestProtos {
...
@@ -684,8 +687,10 @@ namespace Google.ProtocolBuffers.TestProtos {
get
{
return
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
UnitTestMessageSetProtoFile
.
internal__static_protobuf_unittest_TestMessageSetExtension2__FieldAccessorTable
;
}
get
{
return
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
UnitTestMessageSetProtoFile
.
internal__static_protobuf_unittest_TestMessageSetExtension2__FieldAccessorTable
;
}
}
}
public
const
int
MessageSetExtensionFieldNumber
=
1547769
;
public
static
readonly
pb
::
GeneratedExtensionBase
<
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
TestMessageSetExtension2
>
MessageSetExtension
=
public
static
readonly
pb
::
GeneratedExtensionBase
<
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
TestMessageSetExtension2
>
MessageSetExtension
=
pb
::
GeneratedSingleExtension
<
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
TestMessageSetExtension2
>.
CreateInstance
(
Descriptor
.
Extensions
[
0
]);
pb
::
GeneratedSingleExtension
<
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
TestMessageSetExtension2
>.
CreateInstance
(
Descriptor
.
Extensions
[
0
]);
public
const
int
StrFieldNumber
=
25
;
private
bool
hasStr
;
private
bool
hasStr
;
private
string
str_
=
""
;
private
string
str_
=
""
;
public
bool
HasStr
{
public
bool
HasStr
{
...
@@ -912,6 +917,7 @@ namespace Google.ProtocolBuffers.TestProtos {
...
@@ -912,6 +917,7 @@ namespace Google.ProtocolBuffers.TestProtos {
get
{
return
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
UnitTestMessageSetProtoFile
.
internal__static_protobuf_unittest_RawMessageSet_Item__FieldAccessorTable
;
}
get
{
return
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
UnitTestMessageSetProtoFile
.
internal__static_protobuf_unittest_RawMessageSet_Item__FieldAccessorTable
;
}
}
}
public
const
int
TypeIdFieldNumber
=
2
;
private
bool
hasTypeId
;
private
bool
hasTypeId
;
private
int
typeId_
=
0
;
private
int
typeId_
=
0
;
public
bool
HasTypeId
{
public
bool
HasTypeId
{
...
@@ -921,6 +927,7 @@ namespace Google.ProtocolBuffers.TestProtos {
...
@@ -921,6 +927,7 @@ namespace Google.ProtocolBuffers.TestProtos {
get
{
return
typeId_
;
}
get
{
return
typeId_
;
}
}
}
public
const
int
MessageFieldNumber
=
3
;
private
bool
hasMessage
;
private
bool
hasMessage
;
private
pb
::
ByteString
message_
=
pb
::
ByteString
.
Empty
;
private
pb
::
ByteString
message_
=
pb
::
ByteString
.
Empty
;
public
bool
HasMessage
{
public
bool
HasMessage
{
...
@@ -1137,6 +1144,7 @@ namespace Google.ProtocolBuffers.TestProtos {
...
@@ -1137,6 +1144,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
#
endregion
#
endregion
public
const
int
ItemFieldNumber
=
1
;
private
pbc
::
PopsicleList
<
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
RawMessageSet
.
Types
.
Item
>
item_
=
new
pbc
::
PopsicleList
<
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
RawMessageSet
.
Types
.
Item
>();
private
pbc
::
PopsicleList
<
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
RawMessageSet
.
Types
.
Item
>
item_
=
new
pbc
::
PopsicleList
<
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
RawMessageSet
.
Types
.
Item
>();
public
scg
::
IList
<
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
RawMessageSet
.
Types
.
Item
>
ItemList
{
public
scg
::
IList
<
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
RawMessageSet
.
Types
.
Item
>
ItemList
{
get
{
return
item_
;
}
get
{
return
item_
;
}
...
...
src/ProtocolBuffers.Test/TestProtos/UnitTestOptimizeForProtoFile.cs
View file @
7ee85c4e
...
@@ -75,10 +75,13 @@ namespace Google.ProtocolBuffers.TestProtos {
...
@@ -75,10 +75,13 @@ namespace Google.ProtocolBuffers.TestProtos {
get
{
return
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
UnitTestOptimizeForProtoFile
.
internal__static_protobuf_unittest_TestOptimizedForSize__FieldAccessorTable
;
}
get
{
return
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
UnitTestOptimizeForProtoFile
.
internal__static_protobuf_unittest_TestOptimizedForSize__FieldAccessorTable
;
}
}
}
public
const
int
TestExtensionFieldNumber
=
1234
;
public
static
readonly
pb
::
GeneratedExtensionBase
<
int
>
TestExtension
=
public
static
readonly
pb
::
GeneratedExtensionBase
<
int
>
TestExtension
=
pb
::
GeneratedSingleExtension
<
int
>.
CreateInstance
(
Descriptor
.
Extensions
[
0
]);
pb
::
GeneratedSingleExtension
<
int
>.
CreateInstance
(
Descriptor
.
Extensions
[
0
]);
public
const
int
TestExtension2FieldNumber
=
1235
;
public
static
readonly
pb
::
GeneratedExtensionBase
<
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
TestRequiredOptimizedForSize
>
TestExtension2
=
public
static
readonly
pb
::
GeneratedExtensionBase
<
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
TestRequiredOptimizedForSize
>
TestExtension2
=
pb
::
GeneratedSingleExtension
<
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
TestRequiredOptimizedForSize
>.
CreateInstance
(
Descriptor
.
Extensions
[
1
]);
pb
::
GeneratedSingleExtension
<
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
TestRequiredOptimizedForSize
>.
CreateInstance
(
Descriptor
.
Extensions
[
1
]);
public
const
int
IFieldNumber
=
1
;
private
bool
hasI
;
private
bool
hasI
;
private
int
i_
=
0
;
private
int
i_
=
0
;
public
bool
HasI
{
public
bool
HasI
{
...
@@ -88,6 +91,7 @@ namespace Google.ProtocolBuffers.TestProtos {
...
@@ -88,6 +91,7 @@ namespace Google.ProtocolBuffers.TestProtos {
get
{
return
i_
;
}
get
{
return
i_
;
}
}
}
public
const
int
MsgFieldNumber
=
19
;
private
bool
hasMsg
;
private
bool
hasMsg
;
private
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
ForeignMessage
msg_
=
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
ForeignMessage
.
DefaultInstance
;
private
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
ForeignMessage
msg_
=
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
ForeignMessage
.
DefaultInstance
;
public
bool
HasMsg
{
public
bool
HasMsg
{
...
@@ -242,6 +246,7 @@ namespace Google.ProtocolBuffers.TestProtos {
...
@@ -242,6 +246,7 @@ namespace Google.ProtocolBuffers.TestProtos {
get
{
return
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
UnitTestOptimizeForProtoFile
.
internal__static_protobuf_unittest_TestRequiredOptimizedForSize__FieldAccessorTable
;
}
get
{
return
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
UnitTestOptimizeForProtoFile
.
internal__static_protobuf_unittest_TestRequiredOptimizedForSize__FieldAccessorTable
;
}
}
}
public
const
int
XFieldNumber
=
1
;
private
bool
hasX
;
private
bool
hasX
;
private
int
x_
=
0
;
private
int
x_
=
0
;
public
bool
HasX
{
public
bool
HasX
{
...
@@ -360,6 +365,7 @@ namespace Google.ProtocolBuffers.TestProtos {
...
@@ -360,6 +365,7 @@ namespace Google.ProtocolBuffers.TestProtos {
get
{
return
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
UnitTestOptimizeForProtoFile
.
internal__static_protobuf_unittest_TestOptionalOptimizedForSize__FieldAccessorTable
;
}
get
{
return
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
UnitTestOptimizeForProtoFile
.
internal__static_protobuf_unittest_TestOptionalOptimizedForSize__FieldAccessorTable
;
}
}
}
public
const
int
OFieldNumber
=
1
;
private
bool
hasO
;
private
bool
hasO
;
private
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
TestRequiredOptimizedForSize
o_
=
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
TestRequiredOptimizedForSize
.
DefaultInstance
;
private
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
TestRequiredOptimizedForSize
o_
=
global
::
Google
.
ProtocolBuffers
.
TestProtos
.
TestRequiredOptimizedForSize
.
DefaultInstance
;
public
bool
HasO
{
public
bool
HasO
{
...
...
src/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs
View file @
7ee85c4e
This diff is collapsed.
Click to expand it.
src/ProtocolBuffers/DescriptorProtos/CSharpOptions.cs
View file @
7ee85c4e
...
@@ -31,8 +31,10 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
...
@@ -31,8 +31,10 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
#
endregion
#
endregion
#
region
Extensions
#
region
Extensions
public
const
int
CsharpFileOptionsFieldNumber
=
1000
;
public
static
readonly
pb
::
GeneratedExtensionBase
<
global
::
Google
.
ProtocolBuffers
.
DescriptorProtos
.
CSharpFileOptions
>
CSharpFileOptions
=
public
static
readonly
pb
::
GeneratedExtensionBase
<
global
::
Google
.
ProtocolBuffers
.
DescriptorProtos
.
CSharpFileOptions
>
CSharpFileOptions
=
pb
::
GeneratedSingleExtension
<
global
::
Google
.
ProtocolBuffers
.
DescriptorProtos
.
CSharpFileOptions
>.
CreateInstance
(
Descriptor
.
Extensions
[
0
]);
pb
::
GeneratedSingleExtension
<
global
::
Google
.
ProtocolBuffers
.
DescriptorProtos
.
CSharpFileOptions
>.
CreateInstance
(
Descriptor
.
Extensions
[
0
]);
public
const
int
CsharpFieldOptionsFieldNumber
=
1000
;
public
static
readonly
pb
::
GeneratedExtensionBase
<
global
::
Google
.
ProtocolBuffers
.
DescriptorProtos
.
CSharpFieldOptions
>
CSharpFieldOptions
=
public
static
readonly
pb
::
GeneratedExtensionBase
<
global
::
Google
.
ProtocolBuffers
.
DescriptorProtos
.
CSharpFieldOptions
>
CSharpFieldOptions
=
pb
::
GeneratedSingleExtension
<
global
::
Google
.
ProtocolBuffers
.
DescriptorProtos
.
CSharpFieldOptions
>.
CreateInstance
(
Descriptor
.
Extensions
[
1
]);
pb
::
GeneratedSingleExtension
<
global
::
Google
.
ProtocolBuffers
.
DescriptorProtos
.
CSharpFieldOptions
>.
CreateInstance
(
Descriptor
.
Extensions
[
1
]);
#
endregion
#
endregion
...
@@ -73,6 +75,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
...
@@ -73,6 +75,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
get
{
return
global
::
Google
.
ProtocolBuffers
.
DescriptorProtos
.
CSharpOptions
.
internal__static_google_protobuf_CSharpFileOptions__FieldAccessorTable
;
}
get
{
return
global
::
Google
.
ProtocolBuffers
.
DescriptorProtos
.
CSharpOptions
.
internal__static_google_protobuf_CSharpFileOptions__FieldAccessorTable
;
}
}
}
public
const
int
NamespaceFieldNumber
=
1
;
private
bool
hasNamespace
;
private
bool
hasNamespace
;
private
string
namespace_
=
""
;
private
string
namespace_
=
""
;
public
bool
HasNamespace
{
public
bool
HasNamespace
{
...
@@ -82,6 +85,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
...
@@ -82,6 +85,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
get
{
return
namespace_
;
}
get
{
return
namespace_
;
}
}
}
public
const
int
UmbrellaClassnameFieldNumber
=
2
;
private
bool
hasUmbrellaClassname
;
private
bool
hasUmbrellaClassname
;
private
string
umbrellaClassname_
=
""
;
private
string
umbrellaClassname_
=
""
;
public
bool
HasUmbrellaClassname
{
public
bool
HasUmbrellaClassname
{
...
@@ -91,6 +95,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
...
@@ -91,6 +95,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
get
{
return
umbrellaClassname_
;
}
get
{
return
umbrellaClassname_
;
}
}
}
public
const
int
PublicClassesFieldNumber
=
3
;
private
bool
hasPublicClasses
;
private
bool
hasPublicClasses
;
private
bool
publicClasses_
=
false
;
private
bool
publicClasses_
=
false
;
public
bool
HasPublicClasses
{
public
bool
HasPublicClasses
{
...
@@ -100,6 +105,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
...
@@ -100,6 +105,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
get
{
return
publicClasses_
;
}
get
{
return
publicClasses_
;
}
}
}
public
const
int
MultipleFilesFieldNumber
=
4
;
private
bool
hasMultipleFiles
;
private
bool
hasMultipleFiles
;
private
bool
multipleFiles_
=
false
;
private
bool
multipleFiles_
=
false
;
public
bool
HasMultipleFiles
{
public
bool
HasMultipleFiles
{
...
@@ -109,6 +115,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
...
@@ -109,6 +115,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
get
{
return
multipleFiles_
;
}
get
{
return
multipleFiles_
;
}
}
}
public
const
int
NestClassesFieldNumber
=
5
;
private
bool
hasNestClasses
;
private
bool
hasNestClasses
;
private
bool
nestClasses_
=
false
;
private
bool
nestClasses_
=
false
;
public
bool
HasNestClasses
{
public
bool
HasNestClasses
{
...
@@ -301,6 +308,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
...
@@ -301,6 +308,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
get
{
return
global
::
Google
.
ProtocolBuffers
.
DescriptorProtos
.
CSharpOptions
.
internal__static_google_protobuf_CSharpFieldOptions__FieldAccessorTable
;
}
get
{
return
global
::
Google
.
ProtocolBuffers
.
DescriptorProtos
.
CSharpOptions
.
internal__static_google_protobuf_CSharpFieldOptions__FieldAccessorTable
;
}
}
}
public
const
int
PropertyNameFieldNumber
=
1
;
private
bool
hasPropertyName
;
private
bool
hasPropertyName
;
private
string
propertyName_
=
""
;
private
string
propertyName_
=
""
;
public
bool
HasPropertyName
{
public
bool
HasPropertyName
{
...
...
src/ProtocolBuffers/DescriptorProtos/DescriptorProtoFile.cs
View file @
7ee85c4e
This diff is collapsed.
Click to expand it.
todo.txt
View file @
7ee85c4e
...
@@ -9,6 +9,9 @@ Current task list (not in order)
...
@@ -9,6 +9,9 @@ Current task list (not in order)
- Avoid using reflection for messages which don't need it (is this
- Avoid using reflection for messages which don't need it (is this
possible?)
possible?)
- Add RegisterAllExtensions
- Add RegisterAllExtensions
- Add ToBuilder changes from Google's r92
- Add ToBuilder changes from Google's r92
(done? Need to check)
- Silverlight changes (as per email to Jon)
- Silverlight changes (as per email to Jon)
- Extension registration/initialization code?
From latest Java code:
r120: (Lots)
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