protobuf 2.8.0.beta9 → 2.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (204) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +0 -1
  3. data/{UPGRADING.md → CHANGES.md} +20 -12
  4. data/LICENSE.txt +14 -0
  5. data/README.md +60 -74
  6. data/bin/protoc-gen-ruby +26 -0
  7. data/bin/rprotoc +4 -58
  8. data/lib/protobuf.rb +15 -13
  9. data/lib/protobuf/code_generator.rb +41 -0
  10. data/lib/protobuf/descriptors/google/protobuf/compiler/plugin.pb.rb +51 -0
  11. data/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb +248 -0
  12. data/lib/protobuf/field/base_field.rb +0 -1
  13. data/lib/protobuf/field/bytes_field.rb +1 -1
  14. data/lib/protobuf/field/message_field.rb +2 -4
  15. data/lib/protobuf/field/varint_field.rb +4 -7
  16. data/lib/protobuf/generators/base.rb +71 -0
  17. data/lib/protobuf/generators/enum_generator.rb +31 -0
  18. data/lib/protobuf/generators/extension_generator.rb +28 -0
  19. data/lib/protobuf/generators/field_generator.rb +132 -0
  20. data/lib/protobuf/generators/file_generator.rb +140 -0
  21. data/lib/protobuf/generators/group_generator.rb +113 -0
  22. data/lib/protobuf/generators/message_generator.rb +99 -0
  23. data/lib/protobuf/generators/printable.rb +161 -0
  24. data/lib/protobuf/generators/service_generator.rb +27 -0
  25. data/lib/protobuf/lifecycle.rb +7 -3
  26. data/lib/protobuf/message.rb +51 -34
  27. data/lib/protobuf/rpc/connectors/common.rb +4 -6
  28. data/lib/protobuf/rpc/server.rb +1 -1
  29. data/lib/protobuf/rpc/servers/zmq/server.rb +2 -2
  30. data/lib/protobuf/rpc/servers/zmq/worker.rb +2 -2
  31. data/lib/protobuf/rpc/service.rb +3 -3
  32. data/lib/protobuf/rpc/service_directory.rb +24 -12
  33. data/lib/protobuf/version.rb +1 -1
  34. data/proto/google/protobuf/compiler/plugin.proto +147 -0
  35. data/proto/google/protobuf/descriptor.proto +620 -0
  36. data/protobuf.gemspec +12 -21
  37. data/spec/bin/protoc-gen-ruby_spec.rb +18 -0
  38. data/spec/data/data.bin +3 -0
  39. data/{test/data/unk.png → spec/data/types.bin} +0 -0
  40. data/spec/encoding/all_types_spec.rb +91 -0
  41. data/spec/encoding/extreme_values_spec.rb +0 -0
  42. data/spec/lib/protobuf/code_generator_spec.rb +60 -0
  43. data/spec/lib/protobuf/generators/base_spec.rb +87 -0
  44. data/spec/lib/protobuf/generators/enum_generator_spec.rb +45 -0
  45. data/spec/lib/protobuf/generators/extension_generator_spec.rb +43 -0
  46. data/spec/lib/protobuf/generators/field_generator_spec.rb +99 -0
  47. data/spec/lib/protobuf/generators/file_generator_spec.rb +29 -0
  48. data/spec/lib/protobuf/generators/message_generator_spec.rb +0 -0
  49. data/spec/lib/protobuf/generators/service_generator_spec.rb +43 -0
  50. data/spec/lib/protobuf/lifecycle_spec.rb +31 -1
  51. data/spec/lib/protobuf/logger_spec.rb +5 -0
  52. data/spec/lib/protobuf/message_spec.rb +22 -8
  53. data/spec/lib/protobuf/rpc/connectors/common_spec.rb +1 -1
  54. data/spec/lib/protobuf/rpc/service_directory_spec.rb +45 -7
  55. data/spec/lib/protobuf/rpc/service_spec.rb +3 -3
  56. data/spec/spec_helper.rb +15 -16
  57. data/spec/support/test/all_types.data.bin +0 -0
  58. data/spec/support/test/all_types.data.txt +119 -0
  59. data/spec/support/test/defaults.pb.rb +25 -0
  60. data/spec/support/test/defaults.proto +9 -0
  61. data/spec/support/test/enum.pb.rb +10 -8
  62. data/spec/support/test/extended.pb.rb +5 -3
  63. data/spec/support/test/extreme_values.data.bin +0 -0
  64. data/spec/support/test/google_unittest.pb.rb +543 -0
  65. data/spec/support/test/google_unittest.proto +713 -0
  66. data/spec/support/test/google_unittest_import.pb.rb +37 -0
  67. data/{ext/protobuf-2.4.1/src/google/protobuf/io/package_info.h → spec/support/test/google_unittest_import.proto} +27 -17
  68. data/spec/support/test/google_unittest_import_public.pb.rb +8 -0
  69. data/{ext/protobuf-2.4.1/src/google/protobuf/io/coded_stream_inl.h → spec/support/test/google_unittest_import_public.proto} +5 -31
  70. data/spec/support/test/multi_field_extensions.pb.rb +29 -7
  71. data/spec/support/test/multi_field_extensions.proto +12 -2
  72. data/spec/support/test/resource.pb.rb +20 -16
  73. metadata +149 -236
  74. data/examples/addressbook.pb.rb +0 -55
  75. data/examples/addressbook.proto +0 -24
  76. data/examples/reading_a_message.rb +0 -32
  77. data/examples/writing_a_message.rb +0 -46
  78. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/code_generator.h +0 -142
  79. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/command_line_interface.h +0 -318
  80. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/cpp/cpp_enum.h +0 -99
  81. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/cpp/cpp_enum_field.h +0 -103
  82. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/cpp/cpp_extension.h +0 -85
  83. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/cpp/cpp_field.h +0 -167
  84. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/cpp/cpp_file.h +0 -98
  85. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/cpp/cpp_generator.h +0 -72
  86. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/cpp/cpp_helpers.h +0 -159
  87. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/cpp/cpp_message.h +0 -170
  88. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/cpp/cpp_message_field.h +0 -102
  89. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/cpp/cpp_primitive_field.h +0 -103
  90. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/cpp/cpp_service.h +0 -118
  91. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/cpp/cpp_string_field.h +0 -104
  92. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.h +0 -2721
  93. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/importer.h +0 -303
  94. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/java/java_enum.h +0 -84
  95. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/java/java_enum_field.h +0 -121
  96. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/java/java_extension.h +0 -77
  97. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/java/java_field.h +0 -108
  98. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/java/java_file.h +0 -101
  99. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/java/java_generator.h +0 -72
  100. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/java/java_helpers.h +0 -213
  101. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/java/java_message.h +0 -109
  102. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/java/java_message_field.h +0 -134
  103. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/java/java_primitive_field.h +0 -121
  104. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/java/java_service.h +0 -113
  105. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/java/java_string_field.h +0 -120
  106. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/mock_code_generator.h +0 -113
  107. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/package_info.h +0 -64
  108. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/parser.h +0 -434
  109. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/plugin.h +0 -73
  110. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/plugin.pb.h +0 -790
  111. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/python/python_generator.h +0 -156
  112. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/subprocess.h +0 -108
  113. data/ext/protobuf-2.4.1/src/google/protobuf/compiler/zip_writer.h +0 -93
  114. data/ext/protobuf-2.4.1/src/google/protobuf/descriptor.h +0 -1367
  115. data/ext/protobuf-2.4.1/src/google/protobuf/descriptor.pb.h +0 -5223
  116. data/ext/protobuf-2.4.1/src/google/protobuf/descriptor_database.h +0 -366
  117. data/ext/protobuf-2.4.1/src/google/protobuf/dynamic_message.h +0 -136
  118. data/ext/protobuf-2.4.1/src/google/protobuf/extension_set.h +0 -904
  119. data/ext/protobuf-2.4.1/src/google/protobuf/generated_message_reflection.h +0 -424
  120. data/ext/protobuf-2.4.1/src/google/protobuf/generated_message_util.h +0 -82
  121. data/ext/protobuf-2.4.1/src/google/protobuf/io/coded_stream.h +0 -1102
  122. data/ext/protobuf-2.4.1/src/google/protobuf/io/gzip_stream.h +0 -207
  123. data/ext/protobuf-2.4.1/src/google/protobuf/io/printer.h +0 -136
  124. data/ext/protobuf-2.4.1/src/google/protobuf/io/tokenizer.h +0 -313
  125. data/ext/protobuf-2.4.1/src/google/protobuf/io/zero_copy_stream.h +0 -238
  126. data/ext/protobuf-2.4.1/src/google/protobuf/io/zero_copy_stream_impl.h +0 -357
  127. data/ext/protobuf-2.4.1/src/google/protobuf/io/zero_copy_stream_impl_lite.h +0 -340
  128. data/ext/protobuf-2.4.1/src/google/protobuf/message.h +0 -692
  129. data/ext/protobuf-2.4.1/src/google/protobuf/message_lite.h +0 -239
  130. data/ext/protobuf-2.4.1/src/google/protobuf/package_info.h +0 -64
  131. data/ext/protobuf-2.4.1/src/google/protobuf/reflection_ops.h +0 -80
  132. data/ext/protobuf-2.4.1/src/google/protobuf/repeated_field.h +0 -1295
  133. data/ext/protobuf-2.4.1/src/google/protobuf/service.h +0 -291
  134. data/ext/protobuf-2.4.1/src/google/protobuf/stubs/common.h +0 -1211
  135. data/ext/protobuf-2.4.1/src/google/protobuf/stubs/hash.h +0 -220
  136. data/ext/protobuf-2.4.1/src/google/protobuf/stubs/map-util.h +0 -119
  137. data/ext/protobuf-2.4.1/src/google/protobuf/stubs/once.h +0 -123
  138. data/ext/protobuf-2.4.1/src/google/protobuf/stubs/stl_util-inl.h +0 -121
  139. data/ext/protobuf-2.4.1/src/google/protobuf/stubs/strutil.h +0 -457
  140. data/ext/protobuf-2.4.1/src/google/protobuf/stubs/substitute.h +0 -170
  141. data/ext/protobuf-2.4.1/src/google/protobuf/test_util.h +0 -174
  142. data/ext/protobuf-2.4.1/src/google/protobuf/test_util_lite.h +0 -101
  143. data/ext/protobuf-2.4.1/src/google/protobuf/testing/file.h +0 -83
  144. data/ext/protobuf-2.4.1/src/google/protobuf/testing/googletest.h +0 -98
  145. data/ext/protobuf-2.4.1/src/google/protobuf/text_format.h +0 -285
  146. data/ext/protobuf-2.4.1/src/google/protobuf/unittest.pb.h +0 -11915
  147. data/ext/protobuf-2.4.1/src/google/protobuf/unittest_custom_options.pb.h +0 -2895
  148. data/ext/protobuf-2.4.1/src/google/protobuf/unittest_embed_optimize_for.pb.h +0 -211
  149. data/ext/protobuf-2.4.1/src/google/protobuf/unittest_empty.pb.h +0 -56
  150. data/ext/protobuf-2.4.1/src/google/protobuf/unittest_import.pb.h +0 -188
  151. data/ext/protobuf-2.4.1/src/google/protobuf/unittest_import_lite.pb.h +0 -151
  152. data/ext/protobuf-2.4.1/src/google/protobuf/unittest_lite.pb.h +0 -4752
  153. data/ext/protobuf-2.4.1/src/google/protobuf/unittest_lite_imports_nonlite.pb.h +0 -150
  154. data/ext/protobuf-2.4.1/src/google/protobuf/unittest_mset.pb.h +0 -816
  155. data/ext/protobuf-2.4.1/src/google/protobuf/unittest_no_generic_services.pb.h +0 -197
  156. data/ext/protobuf-2.4.1/src/google/protobuf/unittest_optimize_for.pb.h +0 -403
  157. data/ext/protobuf-2.4.1/src/google/protobuf/unknown_field_set.h +0 -268
  158. data/ext/protobuf-2.4.1/src/google/protobuf/wire_format.h +0 -304
  159. data/ext/protobuf-2.4.1/src/google/protobuf/wire_format_lite.h +0 -620
  160. data/ext/protobuf-2.4.1/src/google/protobuf/wire_format_lite_inl.h +0 -774
  161. data/ext/ruby_generator/Makefile +0 -10
  162. data/ext/ruby_generator/RubyGenerator.cpp +0 -544
  163. data/ext/ruby_generator/RubyGenerator.h +0 -206
  164. data/ext/ruby_generator/extconf.rb +0 -35
  165. data/test/data/data_source.py +0 -14
  166. data/test/data/types_source.py +0 -22
  167. data/test/proto/addressbook.pb.rb +0 -66
  168. data/test/proto/addressbook.proto +0 -33
  169. data/test/proto/addressbook_base.pb.rb +0 -58
  170. data/test/proto/addressbook_base.proto +0 -26
  171. data/test/proto/addressbook_ext.pb.rb +0 -20
  172. data/test/proto/addressbook_ext.proto +0 -6
  173. data/test/proto/collision.pb.rb +0 -17
  174. data/test/proto/collision.proto +0 -5
  175. data/test/proto/ext_collision.pb.rb +0 -24
  176. data/test/proto/ext_collision.proto +0 -8
  177. data/test/proto/ext_range.pb.rb +0 -22
  178. data/test/proto/ext_range.proto +0 -7
  179. data/test/proto/float_default.proto +0 -10
  180. data/test/proto/lowercase.pb.rb +0 -30
  181. data/test/proto/lowercase.proto +0 -9
  182. data/test/proto/merge.pb.rb +0 -39
  183. data/test/proto/merge.proto +0 -15
  184. data/test/proto/nested.pb.rb +0 -30
  185. data/test/proto/nested.proto +0 -9
  186. data/test/proto/optional_field.pb.rb +0 -35
  187. data/test/proto/optional_field.proto +0 -12
  188. data/test/proto/packed.pb.rb +0 -22
  189. data/test/proto/packed.proto +0 -6
  190. data/test/proto/rpc.proto +0 -6
  191. data/test/proto/types.pb.rb +0 -84
  192. data/test/proto/types.proto +0 -37
  193. data/test/test_addressbook.rb +0 -56
  194. data/test/test_enum_value.rb +0 -41
  195. data/test/test_extension.rb +0 -36
  196. data/test/test_lowercase.rb +0 -11
  197. data/test/test_message.rb +0 -128
  198. data/test/test_optional_field.rb +0 -103
  199. data/test/test_packed_field.rb +0 -40
  200. data/test/test_parse.rb +0 -15
  201. data/test/test_repeated_types.rb +0 -132
  202. data/test/test_serialize.rb +0 -61
  203. data/test/test_standard_message.rb +0 -96
  204. data/test/test_types.rb +0 -226
@@ -1,73 +0,0 @@
1
- // Protocol Buffers - Google's data interchange format
2
- // Copyright 2008 Google Inc. All rights reserved.
3
- // http://code.google.com/p/protobuf/
4
- //
5
- // Redistribution and use in source and binary forms, with or without
6
- // modification, are permitted provided that the following conditions are
7
- // met:
8
- //
9
- // * Redistributions of source code must retain the above copyright
10
- // notice, this list of conditions and the following disclaimer.
11
- // * Redistributions in binary form must reproduce the above
12
- // copyright notice, this list of conditions and the following disclaimer
13
- // in the documentation and/or other materials provided with the
14
- // distribution.
15
- // * Neither the name of Google Inc. nor the names of its
16
- // contributors may be used to endorse or promote products derived from
17
- // this software without specific prior written permission.
18
- //
19
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
-
31
- // Author: kenton@google.com (Kenton Varda)
32
- //
33
- // Front-end for protoc code generator plugins written in C++.
34
- //
35
- // To implement a protoc plugin in C++, simply write an implementation of
36
- // CodeGenerator, then create a main() function like:
37
- // int main(int argc, char* argv[]) {
38
- // MyCodeGenerator generator;
39
- // return google::protobuf::compiler::PluginMain(argc, argv, &generator);
40
- // }
41
- // You must link your plugin against libprotobuf and libprotoc.
42
- //
43
- // To get protoc to use the plugin, do one of the following:
44
- // * Place the plugin binary somewhere in the PATH and give it the name
45
- // "protoc-gen-NAME" (replacing "NAME" with the name of your plugin). If you
46
- // then invoke protoc with the parameter --NAME_out=OUT_DIR (again, replace
47
- // "NAME" with your plugin's name), protoc will invoke your plugin to generate
48
- // the output, which will be placed in OUT_DIR.
49
- // * Place the plugin binary anywhere, with any name, and pass the --plugin
50
- // parameter to protoc to direct it to your plugin like so:
51
- // protoc --plugin=protoc-gen-NAME=path/to/mybinary --NAME_out=OUT_DIR
52
- // On Windows, make sure to include the .exe suffix:
53
- // protoc --plugin=protoc-gen-NAME=path/to/mybinary.exe --NAME_out=OUT_DIR
54
-
55
- #ifndef GOOGLE_PROTOBUF_COMPILER_PLUGIN_H__
56
- #define GOOGLE_PROTOBUF_COMPILER_PLUGIN_H__
57
-
58
- #include <google/protobuf/stubs/common.h>
59
-
60
- namespace google {
61
- namespace protobuf {
62
- namespace compiler {
63
-
64
- class CodeGenerator; // code_generator.h
65
-
66
- // Implements main() for a protoc plugin exposing the given code generator.
67
- int PluginMain(int argc, char* argv[], const CodeGenerator* generator);
68
-
69
- } // namespace compiler
70
- } // namespace protobuf
71
-
72
- } // namespace google
73
- #endif // GOOGLE_PROTOBUF_COMPILER_PLUGIN_H__
@@ -1,790 +0,0 @@
1
- // Generated by the protocol buffer compiler. DO NOT EDIT!
2
- // source: google/protobuf/compiler/plugin.proto
3
-
4
- #ifndef PROTOBUF_google_2fprotobuf_2fcompiler_2fplugin_2eproto__INCLUDED
5
- #define PROTOBUF_google_2fprotobuf_2fcompiler_2fplugin_2eproto__INCLUDED
6
-
7
- #include <string>
8
-
9
- #include <google/protobuf/stubs/common.h>
10
-
11
- #if GOOGLE_PROTOBUF_VERSION < 2004000
12
- #error This file was generated by a newer version of protoc which is
13
- #error incompatible with your Protocol Buffer headers. Please update
14
- #error your headers.
15
- #endif
16
- #if 2004001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
17
- #error This file was generated by an older version of protoc which is
18
- #error incompatible with your Protocol Buffer headers. Please
19
- #error regenerate this file with a newer version of protoc.
20
- #endif
21
-
22
- #include <google/protobuf/generated_message_util.h>
23
- #include <google/protobuf/repeated_field.h>
24
- #include <google/protobuf/extension_set.h>
25
- #include <google/protobuf/generated_message_reflection.h>
26
- #include "google/protobuf/descriptor.pb.h"
27
- // @@protoc_insertion_point(includes)
28
-
29
- namespace google {
30
- namespace protobuf {
31
- namespace compiler {
32
-
33
- // Internal implementation detail -- do not call these.
34
- void LIBPROTOC_EXPORT protobuf_AddDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto();
35
- void protobuf_AssignDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto();
36
- void protobuf_ShutdownFile_google_2fprotobuf_2fcompiler_2fplugin_2eproto();
37
-
38
- class CodeGeneratorRequest;
39
- class CodeGeneratorResponse;
40
- class CodeGeneratorResponse_File;
41
-
42
- // ===================================================================
43
-
44
- class LIBPROTOC_EXPORT CodeGeneratorRequest : public ::google::protobuf::Message {
45
- public:
46
- CodeGeneratorRequest();
47
- virtual ~CodeGeneratorRequest();
48
-
49
- CodeGeneratorRequest(const CodeGeneratorRequest& from);
50
-
51
- inline CodeGeneratorRequest& operator=(const CodeGeneratorRequest& from) {
52
- CopyFrom(from);
53
- return *this;
54
- }
55
-
56
- inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
57
- return _unknown_fields_;
58
- }
59
-
60
- inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
61
- return &_unknown_fields_;
62
- }
63
-
64
- static const ::google::protobuf::Descriptor* descriptor();
65
- static const CodeGeneratorRequest& default_instance();
66
-
67
- void Swap(CodeGeneratorRequest* other);
68
-
69
- // implements Message ----------------------------------------------
70
-
71
- CodeGeneratorRequest* New() const;
72
- void CopyFrom(const ::google::protobuf::Message& from);
73
- void MergeFrom(const ::google::protobuf::Message& from);
74
- void CopyFrom(const CodeGeneratorRequest& from);
75
- void MergeFrom(const CodeGeneratorRequest& from);
76
- void Clear();
77
- bool IsInitialized() const;
78
-
79
- int ByteSize() const;
80
- bool MergePartialFromCodedStream(
81
- ::google::protobuf::io::CodedInputStream* input);
82
- void SerializeWithCachedSizes(
83
- ::google::protobuf::io::CodedOutputStream* output) const;
84
- ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
85
- int GetCachedSize() const { return _cached_size_; }
86
- private:
87
- void SharedCtor();
88
- void SharedDtor();
89
- void SetCachedSize(int size) const;
90
- public:
91
-
92
- ::google::protobuf::Metadata GetMetadata() const;
93
-
94
- // nested types ----------------------------------------------------
95
-
96
- // accessors -------------------------------------------------------
97
-
98
- // repeated string file_to_generate = 1;
99
- inline int file_to_generate_size() const;
100
- inline void clear_file_to_generate();
101
- static const int kFileToGenerateFieldNumber = 1;
102
- inline const ::std::string& file_to_generate(int index) const;
103
- inline ::std::string* mutable_file_to_generate(int index);
104
- inline void set_file_to_generate(int index, const ::std::string& value);
105
- inline void set_file_to_generate(int index, const char* value);
106
- inline void set_file_to_generate(int index, const char* value, size_t size);
107
- inline ::std::string* add_file_to_generate();
108
- inline void add_file_to_generate(const ::std::string& value);
109
- inline void add_file_to_generate(const char* value);
110
- inline void add_file_to_generate(const char* value, size_t size);
111
- inline const ::google::protobuf::RepeatedPtrField< ::std::string>& file_to_generate() const;
112
- inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_file_to_generate();
113
-
114
- // optional string parameter = 2;
115
- inline bool has_parameter() const;
116
- inline void clear_parameter();
117
- static const int kParameterFieldNumber = 2;
118
- inline const ::std::string& parameter() const;
119
- inline void set_parameter(const ::std::string& value);
120
- inline void set_parameter(const char* value);
121
- inline void set_parameter(const char* value, size_t size);
122
- inline ::std::string* mutable_parameter();
123
- inline ::std::string* release_parameter();
124
-
125
- // repeated .google.protobuf.FileDescriptorProto proto_file = 15;
126
- inline int proto_file_size() const;
127
- inline void clear_proto_file();
128
- static const int kProtoFileFieldNumber = 15;
129
- inline const ::google::protobuf::FileDescriptorProto& proto_file(int index) const;
130
- inline ::google::protobuf::FileDescriptorProto* mutable_proto_file(int index);
131
- inline ::google::protobuf::FileDescriptorProto* add_proto_file();
132
- inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >&
133
- proto_file() const;
134
- inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >*
135
- mutable_proto_file();
136
-
137
- // @@protoc_insertion_point(class_scope:google.protobuf.compiler.CodeGeneratorRequest)
138
- private:
139
- inline void set_has_parameter();
140
- inline void clear_has_parameter();
141
-
142
- ::google::protobuf::UnknownFieldSet _unknown_fields_;
143
-
144
- ::google::protobuf::RepeatedPtrField< ::std::string> file_to_generate_;
145
- ::std::string* parameter_;
146
- ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto > proto_file_;
147
-
148
- mutable int _cached_size_;
149
- ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32];
150
-
151
- friend void LIBPROTOC_EXPORT protobuf_AddDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto();
152
- friend void protobuf_AssignDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto();
153
- friend void protobuf_ShutdownFile_google_2fprotobuf_2fcompiler_2fplugin_2eproto();
154
-
155
- void InitAsDefaultInstance();
156
- static CodeGeneratorRequest* default_instance_;
157
- };
158
- // -------------------------------------------------------------------
159
-
160
- class LIBPROTOC_EXPORT CodeGeneratorResponse_File : public ::google::protobuf::Message {
161
- public:
162
- CodeGeneratorResponse_File();
163
- virtual ~CodeGeneratorResponse_File();
164
-
165
- CodeGeneratorResponse_File(const CodeGeneratorResponse_File& from);
166
-
167
- inline CodeGeneratorResponse_File& operator=(const CodeGeneratorResponse_File& from) {
168
- CopyFrom(from);
169
- return *this;
170
- }
171
-
172
- inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
173
- return _unknown_fields_;
174
- }
175
-
176
- inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
177
- return &_unknown_fields_;
178
- }
179
-
180
- static const ::google::protobuf::Descriptor* descriptor();
181
- static const CodeGeneratorResponse_File& default_instance();
182
-
183
- void Swap(CodeGeneratorResponse_File* other);
184
-
185
- // implements Message ----------------------------------------------
186
-
187
- CodeGeneratorResponse_File* New() const;
188
- void CopyFrom(const ::google::protobuf::Message& from);
189
- void MergeFrom(const ::google::protobuf::Message& from);
190
- void CopyFrom(const CodeGeneratorResponse_File& from);
191
- void MergeFrom(const CodeGeneratorResponse_File& from);
192
- void Clear();
193
- bool IsInitialized() const;
194
-
195
- int ByteSize() const;
196
- bool MergePartialFromCodedStream(
197
- ::google::protobuf::io::CodedInputStream* input);
198
- void SerializeWithCachedSizes(
199
- ::google::protobuf::io::CodedOutputStream* output) const;
200
- ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
201
- int GetCachedSize() const { return _cached_size_; }
202
- private:
203
- void SharedCtor();
204
- void SharedDtor();
205
- void SetCachedSize(int size) const;
206
- public:
207
-
208
- ::google::protobuf::Metadata GetMetadata() const;
209
-
210
- // nested types ----------------------------------------------------
211
-
212
- // accessors -------------------------------------------------------
213
-
214
- // optional string name = 1;
215
- inline bool has_name() const;
216
- inline void clear_name();
217
- static const int kNameFieldNumber = 1;
218
- inline const ::std::string& name() const;
219
- inline void set_name(const ::std::string& value);
220
- inline void set_name(const char* value);
221
- inline void set_name(const char* value, size_t size);
222
- inline ::std::string* mutable_name();
223
- inline ::std::string* release_name();
224
-
225
- // optional string insertion_point = 2;
226
- inline bool has_insertion_point() const;
227
- inline void clear_insertion_point();
228
- static const int kInsertionPointFieldNumber = 2;
229
- inline const ::std::string& insertion_point() const;
230
- inline void set_insertion_point(const ::std::string& value);
231
- inline void set_insertion_point(const char* value);
232
- inline void set_insertion_point(const char* value, size_t size);
233
- inline ::std::string* mutable_insertion_point();
234
- inline ::std::string* release_insertion_point();
235
-
236
- // optional string content = 15;
237
- inline bool has_content() const;
238
- inline void clear_content();
239
- static const int kContentFieldNumber = 15;
240
- inline const ::std::string& content() const;
241
- inline void set_content(const ::std::string& value);
242
- inline void set_content(const char* value);
243
- inline void set_content(const char* value, size_t size);
244
- inline ::std::string* mutable_content();
245
- inline ::std::string* release_content();
246
-
247
- // @@protoc_insertion_point(class_scope:google.protobuf.compiler.CodeGeneratorResponse.File)
248
- private:
249
- inline void set_has_name();
250
- inline void clear_has_name();
251
- inline void set_has_insertion_point();
252
- inline void clear_has_insertion_point();
253
- inline void set_has_content();
254
- inline void clear_has_content();
255
-
256
- ::google::protobuf::UnknownFieldSet _unknown_fields_;
257
-
258
- ::std::string* name_;
259
- ::std::string* insertion_point_;
260
- ::std::string* content_;
261
-
262
- mutable int _cached_size_;
263
- ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32];
264
-
265
- friend void LIBPROTOC_EXPORT protobuf_AddDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto();
266
- friend void protobuf_AssignDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto();
267
- friend void protobuf_ShutdownFile_google_2fprotobuf_2fcompiler_2fplugin_2eproto();
268
-
269
- void InitAsDefaultInstance();
270
- static CodeGeneratorResponse_File* default_instance_;
271
- };
272
- // -------------------------------------------------------------------
273
-
274
- class LIBPROTOC_EXPORT CodeGeneratorResponse : public ::google::protobuf::Message {
275
- public:
276
- CodeGeneratorResponse();
277
- virtual ~CodeGeneratorResponse();
278
-
279
- CodeGeneratorResponse(const CodeGeneratorResponse& from);
280
-
281
- inline CodeGeneratorResponse& operator=(const CodeGeneratorResponse& from) {
282
- CopyFrom(from);
283
- return *this;
284
- }
285
-
286
- inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
287
- return _unknown_fields_;
288
- }
289
-
290
- inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
291
- return &_unknown_fields_;
292
- }
293
-
294
- static const ::google::protobuf::Descriptor* descriptor();
295
- static const CodeGeneratorResponse& default_instance();
296
-
297
- void Swap(CodeGeneratorResponse* other);
298
-
299
- // implements Message ----------------------------------------------
300
-
301
- CodeGeneratorResponse* New() const;
302
- void CopyFrom(const ::google::protobuf::Message& from);
303
- void MergeFrom(const ::google::protobuf::Message& from);
304
- void CopyFrom(const CodeGeneratorResponse& from);
305
- void MergeFrom(const CodeGeneratorResponse& from);
306
- void Clear();
307
- bool IsInitialized() const;
308
-
309
- int ByteSize() const;
310
- bool MergePartialFromCodedStream(
311
- ::google::protobuf::io::CodedInputStream* input);
312
- void SerializeWithCachedSizes(
313
- ::google::protobuf::io::CodedOutputStream* output) const;
314
- ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
315
- int GetCachedSize() const { return _cached_size_; }
316
- private:
317
- void SharedCtor();
318
- void SharedDtor();
319
- void SetCachedSize(int size) const;
320
- public:
321
-
322
- ::google::protobuf::Metadata GetMetadata() const;
323
-
324
- // nested types ----------------------------------------------------
325
-
326
- typedef CodeGeneratorResponse_File File;
327
-
328
- // accessors -------------------------------------------------------
329
-
330
- // optional string error = 1;
331
- inline bool has_error() const;
332
- inline void clear_error();
333
- static const int kErrorFieldNumber = 1;
334
- inline const ::std::string& error() const;
335
- inline void set_error(const ::std::string& value);
336
- inline void set_error(const char* value);
337
- inline void set_error(const char* value, size_t size);
338
- inline ::std::string* mutable_error();
339
- inline ::std::string* release_error();
340
-
341
- // repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
342
- inline int file_size() const;
343
- inline void clear_file();
344
- static const int kFileFieldNumber = 15;
345
- inline const ::google::protobuf::compiler::CodeGeneratorResponse_File& file(int index) const;
346
- inline ::google::protobuf::compiler::CodeGeneratorResponse_File* mutable_file(int index);
347
- inline ::google::protobuf::compiler::CodeGeneratorResponse_File* add_file();
348
- inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::compiler::CodeGeneratorResponse_File >&
349
- file() const;
350
- inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::compiler::CodeGeneratorResponse_File >*
351
- mutable_file();
352
-
353
- // @@protoc_insertion_point(class_scope:google.protobuf.compiler.CodeGeneratorResponse)
354
- private:
355
- inline void set_has_error();
356
- inline void clear_has_error();
357
-
358
- ::google::protobuf::UnknownFieldSet _unknown_fields_;
359
-
360
- ::std::string* error_;
361
- ::google::protobuf::RepeatedPtrField< ::google::protobuf::compiler::CodeGeneratorResponse_File > file_;
362
-
363
- mutable int _cached_size_;
364
- ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32];
365
-
366
- friend void LIBPROTOC_EXPORT protobuf_AddDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto();
367
- friend void protobuf_AssignDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto();
368
- friend void protobuf_ShutdownFile_google_2fprotobuf_2fcompiler_2fplugin_2eproto();
369
-
370
- void InitAsDefaultInstance();
371
- static CodeGeneratorResponse* default_instance_;
372
- };
373
- // ===================================================================
374
-
375
-
376
- // ===================================================================
377
-
378
- // CodeGeneratorRequest
379
-
380
- // repeated string file_to_generate = 1;
381
- inline int CodeGeneratorRequest::file_to_generate_size() const {
382
- return file_to_generate_.size();
383
- }
384
- inline void CodeGeneratorRequest::clear_file_to_generate() {
385
- file_to_generate_.Clear();
386
- }
387
- inline const ::std::string& CodeGeneratorRequest::file_to_generate(int index) const {
388
- return file_to_generate_.Get(index);
389
- }
390
- inline ::std::string* CodeGeneratorRequest::mutable_file_to_generate(int index) {
391
- return file_to_generate_.Mutable(index);
392
- }
393
- inline void CodeGeneratorRequest::set_file_to_generate(int index, const ::std::string& value) {
394
- file_to_generate_.Mutable(index)->assign(value);
395
- }
396
- inline void CodeGeneratorRequest::set_file_to_generate(int index, const char* value) {
397
- file_to_generate_.Mutable(index)->assign(value);
398
- }
399
- inline void CodeGeneratorRequest::set_file_to_generate(int index, const char* value, size_t size) {
400
- file_to_generate_.Mutable(index)->assign(
401
- reinterpret_cast<const char*>(value), size);
402
- }
403
- inline ::std::string* CodeGeneratorRequest::add_file_to_generate() {
404
- return file_to_generate_.Add();
405
- }
406
- inline void CodeGeneratorRequest::add_file_to_generate(const ::std::string& value) {
407
- file_to_generate_.Add()->assign(value);
408
- }
409
- inline void CodeGeneratorRequest::add_file_to_generate(const char* value) {
410
- file_to_generate_.Add()->assign(value);
411
- }
412
- inline void CodeGeneratorRequest::add_file_to_generate(const char* value, size_t size) {
413
- file_to_generate_.Add()->assign(reinterpret_cast<const char*>(value), size);
414
- }
415
- inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
416
- CodeGeneratorRequest::file_to_generate() const {
417
- return file_to_generate_;
418
- }
419
- inline ::google::protobuf::RepeatedPtrField< ::std::string>*
420
- CodeGeneratorRequest::mutable_file_to_generate() {
421
- return &file_to_generate_;
422
- }
423
-
424
- // optional string parameter = 2;
425
- inline bool CodeGeneratorRequest::has_parameter() const {
426
- return (_has_bits_[0] & 0x00000002u) != 0;
427
- }
428
- inline void CodeGeneratorRequest::set_has_parameter() {
429
- _has_bits_[0] |= 0x00000002u;
430
- }
431
- inline void CodeGeneratorRequest::clear_has_parameter() {
432
- _has_bits_[0] &= ~0x00000002u;
433
- }
434
- inline void CodeGeneratorRequest::clear_parameter() {
435
- if (parameter_ != &::google::protobuf::internal::kEmptyString) {
436
- parameter_->clear();
437
- }
438
- clear_has_parameter();
439
- }
440
- inline const ::std::string& CodeGeneratorRequest::parameter() const {
441
- return *parameter_;
442
- }
443
- inline void CodeGeneratorRequest::set_parameter(const ::std::string& value) {
444
- set_has_parameter();
445
- if (parameter_ == &::google::protobuf::internal::kEmptyString) {
446
- parameter_ = new ::std::string;
447
- }
448
- parameter_->assign(value);
449
- }
450
- inline void CodeGeneratorRequest::set_parameter(const char* value) {
451
- set_has_parameter();
452
- if (parameter_ == &::google::protobuf::internal::kEmptyString) {
453
- parameter_ = new ::std::string;
454
- }
455
- parameter_->assign(value);
456
- }
457
- inline void CodeGeneratorRequest::set_parameter(const char* value, size_t size) {
458
- set_has_parameter();
459
- if (parameter_ == &::google::protobuf::internal::kEmptyString) {
460
- parameter_ = new ::std::string;
461
- }
462
- parameter_->assign(reinterpret_cast<const char*>(value), size);
463
- }
464
- inline ::std::string* CodeGeneratorRequest::mutable_parameter() {
465
- set_has_parameter();
466
- if (parameter_ == &::google::protobuf::internal::kEmptyString) {
467
- parameter_ = new ::std::string;
468
- }
469
- return parameter_;
470
- }
471
- inline ::std::string* CodeGeneratorRequest::release_parameter() {
472
- clear_has_parameter();
473
- if (parameter_ == &::google::protobuf::internal::kEmptyString) {
474
- return NULL;
475
- } else {
476
- ::std::string* temp = parameter_;
477
- parameter_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
478
- return temp;
479
- }
480
- }
481
-
482
- // repeated .google.protobuf.FileDescriptorProto proto_file = 15;
483
- inline int CodeGeneratorRequest::proto_file_size() const {
484
- return proto_file_.size();
485
- }
486
- inline void CodeGeneratorRequest::clear_proto_file() {
487
- proto_file_.Clear();
488
- }
489
- inline const ::google::protobuf::FileDescriptorProto& CodeGeneratorRequest::proto_file(int index) const {
490
- return proto_file_.Get(index);
491
- }
492
- inline ::google::protobuf::FileDescriptorProto* CodeGeneratorRequest::mutable_proto_file(int index) {
493
- return proto_file_.Mutable(index);
494
- }
495
- inline ::google::protobuf::FileDescriptorProto* CodeGeneratorRequest::add_proto_file() {
496
- return proto_file_.Add();
497
- }
498
- inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >&
499
- CodeGeneratorRequest::proto_file() const {
500
- return proto_file_;
501
- }
502
- inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >*
503
- CodeGeneratorRequest::mutable_proto_file() {
504
- return &proto_file_;
505
- }
506
-
507
- // -------------------------------------------------------------------
508
-
509
- // CodeGeneratorResponse_File
510
-
511
- // optional string name = 1;
512
- inline bool CodeGeneratorResponse_File::has_name() const {
513
- return (_has_bits_[0] & 0x00000001u) != 0;
514
- }
515
- inline void CodeGeneratorResponse_File::set_has_name() {
516
- _has_bits_[0] |= 0x00000001u;
517
- }
518
- inline void CodeGeneratorResponse_File::clear_has_name() {
519
- _has_bits_[0] &= ~0x00000001u;
520
- }
521
- inline void CodeGeneratorResponse_File::clear_name() {
522
- if (name_ != &::google::protobuf::internal::kEmptyString) {
523
- name_->clear();
524
- }
525
- clear_has_name();
526
- }
527
- inline const ::std::string& CodeGeneratorResponse_File::name() const {
528
- return *name_;
529
- }
530
- inline void CodeGeneratorResponse_File::set_name(const ::std::string& value) {
531
- set_has_name();
532
- if (name_ == &::google::protobuf::internal::kEmptyString) {
533
- name_ = new ::std::string;
534
- }
535
- name_->assign(value);
536
- }
537
- inline void CodeGeneratorResponse_File::set_name(const char* value) {
538
- set_has_name();
539
- if (name_ == &::google::protobuf::internal::kEmptyString) {
540
- name_ = new ::std::string;
541
- }
542
- name_->assign(value);
543
- }
544
- inline void CodeGeneratorResponse_File::set_name(const char* value, size_t size) {
545
- set_has_name();
546
- if (name_ == &::google::protobuf::internal::kEmptyString) {
547
- name_ = new ::std::string;
548
- }
549
- name_->assign(reinterpret_cast<const char*>(value), size);
550
- }
551
- inline ::std::string* CodeGeneratorResponse_File::mutable_name() {
552
- set_has_name();
553
- if (name_ == &::google::protobuf::internal::kEmptyString) {
554
- name_ = new ::std::string;
555
- }
556
- return name_;
557
- }
558
- inline ::std::string* CodeGeneratorResponse_File::release_name() {
559
- clear_has_name();
560
- if (name_ == &::google::protobuf::internal::kEmptyString) {
561
- return NULL;
562
- } else {
563
- ::std::string* temp = name_;
564
- name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
565
- return temp;
566
- }
567
- }
568
-
569
- // optional string insertion_point = 2;
570
- inline bool CodeGeneratorResponse_File::has_insertion_point() const {
571
- return (_has_bits_[0] & 0x00000002u) != 0;
572
- }
573
- inline void CodeGeneratorResponse_File::set_has_insertion_point() {
574
- _has_bits_[0] |= 0x00000002u;
575
- }
576
- inline void CodeGeneratorResponse_File::clear_has_insertion_point() {
577
- _has_bits_[0] &= ~0x00000002u;
578
- }
579
- inline void CodeGeneratorResponse_File::clear_insertion_point() {
580
- if (insertion_point_ != &::google::protobuf::internal::kEmptyString) {
581
- insertion_point_->clear();
582
- }
583
- clear_has_insertion_point();
584
- }
585
- inline const ::std::string& CodeGeneratorResponse_File::insertion_point() const {
586
- return *insertion_point_;
587
- }
588
- inline void CodeGeneratorResponse_File::set_insertion_point(const ::std::string& value) {
589
- set_has_insertion_point();
590
- if (insertion_point_ == &::google::protobuf::internal::kEmptyString) {
591
- insertion_point_ = new ::std::string;
592
- }
593
- insertion_point_->assign(value);
594
- }
595
- inline void CodeGeneratorResponse_File::set_insertion_point(const char* value) {
596
- set_has_insertion_point();
597
- if (insertion_point_ == &::google::protobuf::internal::kEmptyString) {
598
- insertion_point_ = new ::std::string;
599
- }
600
- insertion_point_->assign(value);
601
- }
602
- inline void CodeGeneratorResponse_File::set_insertion_point(const char* value, size_t size) {
603
- set_has_insertion_point();
604
- if (insertion_point_ == &::google::protobuf::internal::kEmptyString) {
605
- insertion_point_ = new ::std::string;
606
- }
607
- insertion_point_->assign(reinterpret_cast<const char*>(value), size);
608
- }
609
- inline ::std::string* CodeGeneratorResponse_File::mutable_insertion_point() {
610
- set_has_insertion_point();
611
- if (insertion_point_ == &::google::protobuf::internal::kEmptyString) {
612
- insertion_point_ = new ::std::string;
613
- }
614
- return insertion_point_;
615
- }
616
- inline ::std::string* CodeGeneratorResponse_File::release_insertion_point() {
617
- clear_has_insertion_point();
618
- if (insertion_point_ == &::google::protobuf::internal::kEmptyString) {
619
- return NULL;
620
- } else {
621
- ::std::string* temp = insertion_point_;
622
- insertion_point_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
623
- return temp;
624
- }
625
- }
626
-
627
- // optional string content = 15;
628
- inline bool CodeGeneratorResponse_File::has_content() const {
629
- return (_has_bits_[0] & 0x00000004u) != 0;
630
- }
631
- inline void CodeGeneratorResponse_File::set_has_content() {
632
- _has_bits_[0] |= 0x00000004u;
633
- }
634
- inline void CodeGeneratorResponse_File::clear_has_content() {
635
- _has_bits_[0] &= ~0x00000004u;
636
- }
637
- inline void CodeGeneratorResponse_File::clear_content() {
638
- if (content_ != &::google::protobuf::internal::kEmptyString) {
639
- content_->clear();
640
- }
641
- clear_has_content();
642
- }
643
- inline const ::std::string& CodeGeneratorResponse_File::content() const {
644
- return *content_;
645
- }
646
- inline void CodeGeneratorResponse_File::set_content(const ::std::string& value) {
647
- set_has_content();
648
- if (content_ == &::google::protobuf::internal::kEmptyString) {
649
- content_ = new ::std::string;
650
- }
651
- content_->assign(value);
652
- }
653
- inline void CodeGeneratorResponse_File::set_content(const char* value) {
654
- set_has_content();
655
- if (content_ == &::google::protobuf::internal::kEmptyString) {
656
- content_ = new ::std::string;
657
- }
658
- content_->assign(value);
659
- }
660
- inline void CodeGeneratorResponse_File::set_content(const char* value, size_t size) {
661
- set_has_content();
662
- if (content_ == &::google::protobuf::internal::kEmptyString) {
663
- content_ = new ::std::string;
664
- }
665
- content_->assign(reinterpret_cast<const char*>(value), size);
666
- }
667
- inline ::std::string* CodeGeneratorResponse_File::mutable_content() {
668
- set_has_content();
669
- if (content_ == &::google::protobuf::internal::kEmptyString) {
670
- content_ = new ::std::string;
671
- }
672
- return content_;
673
- }
674
- inline ::std::string* CodeGeneratorResponse_File::release_content() {
675
- clear_has_content();
676
- if (content_ == &::google::protobuf::internal::kEmptyString) {
677
- return NULL;
678
- } else {
679
- ::std::string* temp = content_;
680
- content_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
681
- return temp;
682
- }
683
- }
684
-
685
- // -------------------------------------------------------------------
686
-
687
- // CodeGeneratorResponse
688
-
689
- // optional string error = 1;
690
- inline bool CodeGeneratorResponse::has_error() const {
691
- return (_has_bits_[0] & 0x00000001u) != 0;
692
- }
693
- inline void CodeGeneratorResponse::set_has_error() {
694
- _has_bits_[0] |= 0x00000001u;
695
- }
696
- inline void CodeGeneratorResponse::clear_has_error() {
697
- _has_bits_[0] &= ~0x00000001u;
698
- }
699
- inline void CodeGeneratorResponse::clear_error() {
700
- if (error_ != &::google::protobuf::internal::kEmptyString) {
701
- error_->clear();
702
- }
703
- clear_has_error();
704
- }
705
- inline const ::std::string& CodeGeneratorResponse::error() const {
706
- return *error_;
707
- }
708
- inline void CodeGeneratorResponse::set_error(const ::std::string& value) {
709
- set_has_error();
710
- if (error_ == &::google::protobuf::internal::kEmptyString) {
711
- error_ = new ::std::string;
712
- }
713
- error_->assign(value);
714
- }
715
- inline void CodeGeneratorResponse::set_error(const char* value) {
716
- set_has_error();
717
- if (error_ == &::google::protobuf::internal::kEmptyString) {
718
- error_ = new ::std::string;
719
- }
720
- error_->assign(value);
721
- }
722
- inline void CodeGeneratorResponse::set_error(const char* value, size_t size) {
723
- set_has_error();
724
- if (error_ == &::google::protobuf::internal::kEmptyString) {
725
- error_ = new ::std::string;
726
- }
727
- error_->assign(reinterpret_cast<const char*>(value), size);
728
- }
729
- inline ::std::string* CodeGeneratorResponse::mutable_error() {
730
- set_has_error();
731
- if (error_ == &::google::protobuf::internal::kEmptyString) {
732
- error_ = new ::std::string;
733
- }
734
- return error_;
735
- }
736
- inline ::std::string* CodeGeneratorResponse::release_error() {
737
- clear_has_error();
738
- if (error_ == &::google::protobuf::internal::kEmptyString) {
739
- return NULL;
740
- } else {
741
- ::std::string* temp = error_;
742
- error_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
743
- return temp;
744
- }
745
- }
746
-
747
- // repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
748
- inline int CodeGeneratorResponse::file_size() const {
749
- return file_.size();
750
- }
751
- inline void CodeGeneratorResponse::clear_file() {
752
- file_.Clear();
753
- }
754
- inline const ::google::protobuf::compiler::CodeGeneratorResponse_File& CodeGeneratorResponse::file(int index) const {
755
- return file_.Get(index);
756
- }
757
- inline ::google::protobuf::compiler::CodeGeneratorResponse_File* CodeGeneratorResponse::mutable_file(int index) {
758
- return file_.Mutable(index);
759
- }
760
- inline ::google::protobuf::compiler::CodeGeneratorResponse_File* CodeGeneratorResponse::add_file() {
761
- return file_.Add();
762
- }
763
- inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::compiler::CodeGeneratorResponse_File >&
764
- CodeGeneratorResponse::file() const {
765
- return file_;
766
- }
767
- inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::compiler::CodeGeneratorResponse_File >*
768
- CodeGeneratorResponse::mutable_file() {
769
- return &file_;
770
- }
771
-
772
-
773
- // @@protoc_insertion_point(namespace_scope)
774
-
775
- } // namespace compiler
776
- } // namespace protobuf
777
- } // namespace google
778
-
779
- #ifndef SWIG
780
- namespace google {
781
- namespace protobuf {
782
-
783
-
784
- } // namespace google
785
- } // namespace protobuf
786
- #endif // SWIG
787
-
788
- // @@protoc_insertion_point(global_scope)
789
-
790
- #endif // PROTOBUF_google_2fprotobuf_2fcompiler_2fplugin_2eproto__INCLUDED