OLD | NEW |
1 // Protocol Buffers - Google's data interchange format | 1 // Protocol Buffers - Google's data interchange format |
2 // Copyright 2008 Google Inc. All rights reserved. | 2 // Copyright 2008 Google Inc. All rights reserved. |
3 // https://developers.google.com/protocol-buffers/ | 3 // https://developers.google.com/protocol-buffers/ |
4 // | 4 // |
5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
7 // met: | 7 // met: |
8 // | 8 // |
9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 class FileGenerator { | 56 class FileGenerator { |
57 public: | 57 public: |
58 FileGenerator(const FileDescriptor* file, const Options& options); | 58 FileGenerator(const FileDescriptor* file, const Options& options); |
59 ~FileGenerator(); | 59 ~FileGenerator(); |
60 | 60 |
61 void GenerateSource(io::Printer* printer); | 61 void GenerateSource(io::Printer* printer); |
62 void GenerateHeader(io::Printer* printer); | 62 void GenerateHeader(io::Printer* printer); |
63 | 63 |
64 const string& RootClassName() const { return root_class_name_; } | 64 const string& RootClassName() const { return root_class_name_; } |
| 65 const string Path() const; |
| 66 |
| 67 bool IsPublicDependency() const { return is_public_dep_; } |
| 68 |
| 69 protected: |
| 70 void SetIsPublicDependency(bool is_public_dep) { |
| 71 is_public_dep_ = is_public_dep; |
| 72 } |
65 | 73 |
66 private: | 74 private: |
67 const FileDescriptor* file_; | 75 const FileDescriptor* file_; |
68 string root_class_name_; | 76 string root_class_name_; |
69 | 77 |
| 78 // Access this field through the DependencyGenerators accessor call below. |
| 79 // Do not reference it directly. |
| 80 vector<FileGenerator*> dependency_generators_; |
| 81 |
70 vector<EnumGenerator*> enum_generators_; | 82 vector<EnumGenerator*> enum_generators_; |
71 vector<MessageGenerator*> message_generators_; | 83 vector<MessageGenerator*> message_generators_; |
72 vector<ExtensionGenerator*> extension_generators_; | 84 vector<ExtensionGenerator*> extension_generators_; |
| 85 bool is_public_dep_; |
73 | 86 |
74 const Options options_; | 87 const Options options_; |
75 | 88 |
76 void PrintFileRuntimePreamble( | 89 const vector<FileGenerator*>& DependencyGenerators(); |
77 io::Printer* printer, const string& header_to_import) const; | |
78 | 90 |
79 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FileGenerator); | 91 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FileGenerator); |
80 }; | 92 }; |
81 | 93 |
82 } // namespace objectivec | 94 } // namespace objectivec |
83 } // namespace compiler | 95 } // namespace compiler |
84 } // namespace protobuf | 96 } // namespace protobuf |
85 } // namespace google | 97 } // namespace google |
86 | 98 |
87 #endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_FILE_H__ | 99 #endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_FILE_H__ |
OLD | NEW |