| Index: third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_message_field.h
|
| diff --git a/third_party/protobuf/src/google/protobuf/compiler/java/java_extension.h b/third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_message_field.h
|
| similarity index 60%
|
| copy from third_party/protobuf/src/google/protobuf/compiler/java/java_extension.h
|
| copy to third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_message_field.h
|
| index 009ed9ffacaf207d4fb6322dca43697499b32991..708ea5668f9c15b6a545cf9e6e73c333dc42cbc4 100644
|
| --- a/third_party/protobuf/src/google/protobuf/compiler/java/java_extension.h
|
| +++ b/third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_message_field.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,50 +28,47 @@
|
| // (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_JAVA_EXTENSION_H__
|
| -#define GOOGLE_PROTOBUF_COMPILER_JAVA_EXTENSION_H__
|
| +#ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_MESSAGE_FIELD_H__
|
| +#define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_MESSAGE_FIELD_H__
|
|
|
| +#include <map>
|
| #include <string>
|
| -
|
| -#include <google/protobuf/stubs/common.h>
|
| +#include <google/protobuf/compiler/objectivec/objectivec_field.h>
|
|
|
| namespace google {
|
| namespace protobuf {
|
| - class FieldDescriptor; // descriptor.h
|
| - namespace io {
|
| - class Printer; // printer.h
|
| - }
|
| -}
|
| -
|
| -namespace protobuf {
|
| namespace compiler {
|
| -namespace java {
|
| +namespace objectivec {
|
| +
|
| +class MessageFieldGenerator : public ObjCObjFieldGenerator {
|
| + friend FieldGenerator* FieldGenerator::Make(const FieldDescriptor* field);
|
| +
|
| + protected:
|
| + explicit MessageFieldGenerator(const FieldDescriptor* descriptor);
|
| + virtual ~MessageFieldGenerator();
|
| + virtual bool WantsHasProperty(void) const;
|
|
|
| -// Generates code for an extension, which may be within the scope of some
|
| -// message or may be at file scope. This is much simpler than FieldGenerator
|
| -// since extensions are just simple identifiers with interesting types.
|
| -class ExtensionGenerator {
|
| public:
|
| - explicit ExtensionGenerator(const FieldDescriptor* descriptor);
|
| - ~ExtensionGenerator();
|
| + virtual void DetermineForwardDeclarations(set<string>* fwd_decls) const;
|
|
|
| - void Generate(io::Printer* printer);
|
| - void GenerateNonNestedInitializationCode(io::Printer* printer);
|
| - void GenerateRegistrationCode(io::Printer* printer);
|
| + private:
|
| + GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageFieldGenerator);
|
| +};
|
| +
|
| +class RepeatedMessageFieldGenerator : public RepeatedFieldGenerator {
|
| + friend FieldGenerator* FieldGenerator::Make(const FieldDescriptor* field);
|
| +
|
| + protected:
|
| + explicit RepeatedMessageFieldGenerator(const FieldDescriptor* descriptor);
|
| + virtual ~RepeatedMessageFieldGenerator();
|
|
|
| private:
|
| - const FieldDescriptor* descriptor_;
|
| - string scope_;
|
| - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ExtensionGenerator);
|
| + GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedMessageFieldGenerator);
|
| };
|
|
|
| -} // namespace java
|
| +} // namespace objectivec
|
| } // namespace compiler
|
| } // namespace protobuf
|
| -
|
| } // namespace google
|
| -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_H__
|
| +
|
| +#endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_MESSAGE_FIELD_H__
|
|
|