From cfa2d8aa87cc0b22b5092a5fb3bf7e394f85cbf1 Mon Sep 17 00:00:00 2001 From: "kenton@google.com" Date: Sat, 18 Apr 2009 00:02:12 +0000 Subject: Generate field number constants. Patch from Michael Poole. --- CHANGES.txt | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 5020b781..e54e1fd2 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -8,6 +8,15 @@ this blob, the individual values are encoded the same way they would be normally except without a tag before each value (thus, they are tightly "packed"). + * For each field, the generated code contains an integer constant assigned + to the field number. For example, the .proto file: + message Foo { optional int bar_baz = 123; } + would generate the following constants, all with the integer value 123: + C++: Foo::kBarBazFieldNumber + Java: Foo.BAR_BAZ_FIELD_NUMBER + Python: Foo.BAR_BAZ_FIELD_NUMBER + Constants are also generated for extensions, with the same naming scheme. + These constants may be used as switch cases. protoc * --error_format=msvs option causes errors to be printed in Visual Studio -- cgit v1.2.3