Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(340)

Unified Diff: src/google/protobuf/compiler/cpp/cpp_field.cc

Issue 4077052: Implement generated visitor classes in C++. Base URL: http://protobuf.googlecode.com/svn/trunk/
Patch Set: Created 13 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/google/protobuf/compiler/cpp/cpp_field.cc
===================================================================
--- src/google/protobuf/compiler/cpp/cpp_field.cc (revision 374)
+++ src/google/protobuf/compiler/cpp/cpp_field.cc (working copy)
@@ -54,6 +54,7 @@
void SetCommonFieldVariables(const FieldDescriptor* descriptor,
map<string, string>* variables) {
(*variables)["name"] = FieldName(descriptor);
+ (*variables)["camelcase"] = FieldCamelcaseName(descriptor);
(*variables)["index"] = SimpleItoa(descriptor->index());
(*variables)["number"] = SimpleItoa(descriptor->number());
(*variables)["classname"] = ClassName(FieldScope(descriptor), false);
@@ -80,6 +81,18 @@
}
+void FieldGenerator::
+GenerateReaderCodeWithPacking(io::Printer* printer) const {
+ // Reaching here indicates a bug. Cases are:
+ // - This FieldGenerator should support packing, but this method should be
+ // overridden.
+ // - This FieldGenerator doesn't support packing, and this method should
+ // never have been called.
+ GOOGLE_LOG(FATAL) << "GenerateReaderCodeWithPacking() "
+ << "called on field generator that does not support packing.";
+
+}
+
FieldGeneratorMap::FieldGeneratorMap(const Descriptor* descriptor)
: descriptor_(descriptor),
field_generators_(

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b