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 23 matching lines...) Expand all Loading... |
34 #define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_GENERATOR_H__ | 34 #define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_GENERATOR_H__ |
35 | 35 |
36 #include <string> | 36 #include <string> |
37 #include <google/protobuf/compiler/code_generator.h> | 37 #include <google/protobuf/compiler/code_generator.h> |
38 | 38 |
39 namespace google { | 39 namespace google { |
40 namespace protobuf { | 40 namespace protobuf { |
41 namespace compiler { | 41 namespace compiler { |
42 namespace objectivec { | 42 namespace objectivec { |
43 | 43 |
| 44 // CodeGenerator implementation which generates a ObjectiveC source file and |
| 45 // header. If you create your own protocol compiler binary and you want it to |
| 46 // support ObjectiveC output, you can do so by registering an instance of this |
| 47 // CodeGenerator with the CommandLineInterface in your main() function. |
44 class LIBPROTOC_EXPORT ObjectiveCGenerator : public CodeGenerator { | 48 class LIBPROTOC_EXPORT ObjectiveCGenerator : public CodeGenerator { |
45 public: | 49 public: |
46 ObjectiveCGenerator(); | 50 ObjectiveCGenerator(); |
47 ~ObjectiveCGenerator(); | 51 ~ObjectiveCGenerator(); |
48 | 52 |
49 // implements CodeGenerator ---------------------------------------- | 53 // implements CodeGenerator ---------------------------------------- |
50 bool Generate(const FileDescriptor* file, const string& parameter, | 54 bool HasGenerateAll() const; |
51 OutputDirectory* output_directory, string* error) const; | 55 bool Generate(const FileDescriptor* file, |
| 56 const string& parameter, |
| 57 GeneratorContext* context, |
| 58 string* error) const; |
| 59 bool GenerateAll(const vector<const FileDescriptor*>& files, |
| 60 const string& parameter, |
| 61 GeneratorContext* context, |
| 62 string* error) const; |
52 | 63 |
53 private: | 64 private: |
54 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ObjectiveCGenerator); | 65 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ObjectiveCGenerator); |
55 }; | 66 }; |
56 | 67 |
57 } // namespace objectivec | 68 } // namespace objectivec |
58 } // namespace compiler | 69 } // namespace compiler |
59 } // namespace protobuf | 70 } // namespace protobuf |
60 } // namespace google | 71 } // namespace google |
61 #endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_GENERATOR_H__ | 72 #endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_GENERATOR_H__ |
OLD | NEW |