aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/compiler/objectivec/objectivec_file.cc
diff options
context:
space:
mode:
authorGravatar Thomas Van Lenten <thomasvl@google.com>2015-11-30 14:38:04 -0500
committerGravatar Thomas Van Lenten <thomasvl@google.com>2016-02-18 13:55:59 -0500
commit2480acb6d974a2cfc1da5b1ea8cc14f2415e6dfe (patch)
tree3e95be3eae1e7d0ff8dce89951b167843127fb94 /src/google/protobuf/compiler/objectivec/objectivec_file.cc
parent9ab11c6561abd5fe997a999f21799d160b0d14cf (diff)
Support ObjC Generic Collections
- Extend GPB*ObjectDictionary to support generic syntax. - Update the generator to output generics so the enclosed type is exposed for compiler checks. - Use generics in a the public interfaces. - Update the generated sources that are checked in.
Diffstat (limited to 'src/google/protobuf/compiler/objectivec/objectivec_file.cc')
-rw-r--r--src/google/protobuf/compiler/objectivec/objectivec_file.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/google/protobuf/compiler/objectivec/objectivec_file.cc b/src/google/protobuf/compiler/objectivec/objectivec_file.cc
index 228c66f0..cdf9ebbc 100644
--- a/src/google/protobuf/compiler/objectivec/objectivec_file.cc
+++ b/src/google/protobuf/compiler/objectivec/objectivec_file.cc
@@ -50,17 +50,18 @@ const int32 GOOGLE_PROTOBUF_OBJC_GEN_VERSION = 30000;
namespace compiler {
namespace objectivec {
-FileGenerator::FileGenerator(const FileDescriptor *file)
+FileGenerator::FileGenerator(const FileDescriptor *file, const Options& options)
: file_(file),
root_class_name_(FileClassName(file)),
- is_public_dep_(false) {
+ is_public_dep_(false),
+ options_(options) {
for (int i = 0; i < file_->enum_type_count(); i++) {
EnumGenerator *generator = new EnumGenerator(file_->enum_type(i));
enum_generators_.push_back(generator);
}
for (int i = 0; i < file_->message_type_count(); i++) {
MessageGenerator *generator =
- new MessageGenerator(root_class_name_, file_->message_type(i));
+ new MessageGenerator(root_class_name_, file_->message_type(i), options_);
message_generators_.push_back(generator);
}
for (int i = 0; i < file_->extension_count(); i++) {
@@ -352,7 +353,8 @@ const vector<FileGenerator *> &FileGenerator::DependencyGenerators() {
public_import_names.insert(file_->public_dependency(i)->name());
}
for (int i = 0; i < file_->dependency_count(); i++) {
- FileGenerator *generator = new FileGenerator(file_->dependency(i));
+ FileGenerator *generator =
+ new FileGenerator(file_->dependency(i), options_);
const string& name = file_->dependency(i)->name();
bool public_import = (public_import_names.count(name) != 0);
generator->SetIsPublicDependency(public_import);