| Index: third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_file.h
|
| diff --git a/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_file.h b/third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_file.h
|
| similarity index 57%
|
| copy from third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_file.h
|
| copy to third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_file.h
|
| index 2deefaa86b521f38981674983317e15534652e52..1bb4f0ea41298ab6d5a2caf4e62155842c7e7421 100644
|
| --- a/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_file.h
|
| +++ b/third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_file.h
|
| @@ -1,6 +1,6 @@
|
| // Protocol Buffers - Google's data interchange format
|
| // Copyright 2008 Google Inc. All rights reserved.
|
| -// http://code.google.com/p/protobuf/
|
| +// 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
|
| @@ -28,72 +28,70 @@
|
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| -// Author: kenton@google.com (Kenton Varda)
|
| -// Based on original Protocol Buffers design by
|
| -// Sanjay Ghemawat, Jeff Dean, and others.
|
| -
|
| -#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_FILE_H__
|
| -#define GOOGLE_PROTOBUF_COMPILER_CPP_FILE_H__
|
| +#ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_FILE_H__
|
| +#define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_FILE_H__
|
|
|
| #include <string>
|
| +#include <set>
|
| #include <vector>
|
| +#include <google/protobuf/compiler/objectivec/objectivec_helpers.h>
|
| #include <google/protobuf/stubs/common.h>
|
| -#include <google/protobuf/compiler/cpp/cpp_field.h>
|
| -#include <google/protobuf/compiler/cpp/cpp_options.h>
|
|
|
| namespace google {
|
| namespace protobuf {
|
| - class FileDescriptor; // descriptor.h
|
| - namespace io {
|
| - class Printer; // printer.h
|
| - }
|
| +class FileDescriptor; // descriptor.h
|
| +namespace io {
|
| +class Printer; // printer.h
|
| +}
|
| }
|
|
|
| namespace protobuf {
|
| namespace compiler {
|
| -namespace cpp {
|
| +namespace objectivec {
|
|
|
| -class EnumGenerator; // enum.h
|
| -class MessageGenerator; // message.h
|
| -class ServiceGenerator; // service.h
|
| -class ExtensionGenerator; // extension.h
|
| +class EnumGenerator;
|
| +class ExtensionGenerator;
|
| +class MessageGenerator;
|
|
|
| class FileGenerator {
|
| public:
|
| - // See generator.cc for the meaning of dllexport_decl.
|
| - explicit FileGenerator(const FileDescriptor* file,
|
| - const Options& options);
|
| + explicit FileGenerator(const FileDescriptor* file);
|
| ~FileGenerator();
|
|
|
| - void GenerateHeader(io::Printer* printer);
|
| void GenerateSource(io::Printer* printer);
|
| + void GenerateHeader(io::Printer* printer);
|
|
|
| - private:
|
| - // Generate the BuildDescriptors() procedure, which builds all descriptors
|
| - // for types defined in the file.
|
| - void GenerateBuildDescriptors(io::Printer* printer);
|
| + const string& RootClassName() const { return root_class_name_; }
|
| + const string Path() const;
|
|
|
| - void GenerateNamespaceOpeners(io::Printer* printer);
|
| - void GenerateNamespaceClosers(io::Printer* printer);
|
| + bool IsPublicDependency() const { return is_public_dep_; }
|
|
|
| + protected:
|
| + void SetIsPublicDependency(bool is_public_dep) {
|
| + is_public_dep_ = is_public_dep;
|
| + }
|
| +
|
| + private:
|
| const FileDescriptor* file_;
|
| + string root_class_name_;
|
|
|
| - scoped_array<scoped_ptr<MessageGenerator> > message_generators_;
|
| - scoped_array<scoped_ptr<EnumGenerator> > enum_generators_;
|
| - scoped_array<scoped_ptr<ServiceGenerator> > service_generators_;
|
| - scoped_array<scoped_ptr<ExtensionGenerator> > extension_generators_;
|
| + // Access this field through the DependencyGenerators accessor call below.
|
| + // Do not reference it directly.
|
| + vector<FileGenerator*> dependency_generators_;
|
|
|
| - // E.g. if the package is foo.bar, package_parts_ is {"foo", "bar"}.
|
| - vector<string> package_parts_;
|
| + vector<EnumGenerator*> enum_generators_;
|
| + vector<MessageGenerator*> message_generators_;
|
| + vector<ExtensionGenerator*> extension_generators_;
|
| + bool is_public_dep_;
|
|
|
| - const Options options_;
|
| + const vector<FileGenerator*>& DependencyGenerators();
|
|
|
| GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FileGenerator);
|
| };
|
|
|
| -} // namespace cpp
|
| +} // namespace objectivec
|
| } // namespace compiler
|
| } // namespace protobuf
|
| -
|
| } // namespace google
|
| -#endif // GOOGLE_PROTOBUF_COMPILER_CPP_FILE_H__
|
| +
|
| +#endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_FILE_H__
|
|
|