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. | |
48 class LIBPROTOC_EXPORT ObjectiveCGenerator : public CodeGenerator { | 44 class LIBPROTOC_EXPORT ObjectiveCGenerator : public CodeGenerator { |
49 public: | 45 public: |
50 ObjectiveCGenerator(); | 46 ObjectiveCGenerator(); |
51 ~ObjectiveCGenerator(); | 47 ~ObjectiveCGenerator(); |
52 | 48 |
53 // implements CodeGenerator ---------------------------------------- | 49 // implements CodeGenerator ---------------------------------------- |
54 bool HasGenerateAll() const; | 50 bool Generate(const FileDescriptor* file, const string& parameter, |
55 bool Generate(const FileDescriptor* file, | 51 OutputDirectory* output_directory, string* error) const; |
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; | |
63 | 52 |
64 private: | 53 private: |
65 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ObjectiveCGenerator); | 54 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ObjectiveCGenerator); |
66 }; | 55 }; |
67 | 56 |
68 } // namespace objectivec | 57 } // namespace objectivec |
69 } // namespace compiler | 58 } // namespace compiler |
70 } // namespace protobuf | 59 } // namespace protobuf |
71 } // namespace google | 60 } // namespace google |
72 #endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_GENERATOR_H__ | 61 #endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_GENERATOR_H__ |
OLD | NEW |