From 86535a1ce7609bb5549d2b4f7e7aded0948e8d45 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Wed, 27 Jul 2016 09:12:48 +0100 Subject: Remove legacy_enum_values flag for GA. --- src/google/protobuf/compiler/csharp/csharp_enum.cc | 4 +--- src/google/protobuf/compiler/csharp/csharp_generator.cc | 3 --- src/google/protobuf/compiler/csharp/csharp_options.h | 9 +-------- 3 files changed, 2 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/google/protobuf/compiler/csharp/csharp_enum.cc b/src/google/protobuf/compiler/csharp/csharp_enum.cc index 64381d0f..9e4da1ed 100644 --- a/src/google/protobuf/compiler/csharp/csharp_enum.cc +++ b/src/google/protobuf/compiler/csharp/csharp_enum.cc @@ -68,9 +68,7 @@ void EnumGenerator::Generate(io::Printer* printer) { for (int i = 0; i < descriptor_->value_count(); i++) { WriteEnumValueDocComment(printer, descriptor_->value(i)); string original_name = descriptor_->value(i)->name(); - string name = options()->legacy_enum_values - ? descriptor_->value(i)->name() - : GetEnumValueName(descriptor_->name(), descriptor_->value(i)->name()); + string name = GetEnumValueName(descriptor_->name(), descriptor_->value(i)->name()); // Make sure we don't get any duplicate names due to prefix removal. while (!used_names.insert(name).second) { // It's possible we'll end up giving this warning multiple times, but that's better than not at all. diff --git a/src/google/protobuf/compiler/csharp/csharp_generator.cc b/src/google/protobuf/compiler/csharp/csharp_generator.cc index d74e8c88..c13ed65b 100644 --- a/src/google/protobuf/compiler/csharp/csharp_generator.cc +++ b/src/google/protobuf/compiler/csharp/csharp_generator.cc @@ -83,9 +83,6 @@ bool Generator::Generate( cli_options.base_namespace_specified = true; } else if (options[i].first == "internal_access") { cli_options.internal_access = true; - } else if (options[i].first == "legacy_enum_values") { - // TODO: Remove this before final release - cli_options.legacy_enum_values = true; } else { *error = "Unknown generator option: " + options[i].first; return false; diff --git a/src/google/protobuf/compiler/csharp/csharp_options.h b/src/google/protobuf/compiler/csharp/csharp_options.h index 4079bf7f..426fb3b5 100644 --- a/src/google/protobuf/compiler/csharp/csharp_options.h +++ b/src/google/protobuf/compiler/csharp/csharp_options.h @@ -45,8 +45,7 @@ struct Options { file_extension(".cs"), base_namespace(""), base_namespace_specified(false), - internal_access(false), - legacy_enum_values(false) { + internal_access(false) { } // Extension of the generated file. Defaults to ".cs" string file_extension; @@ -69,12 +68,6 @@ struct Options { // Whether the generated classes should have accessibility level of "internal". // Defaults to false that generates "public" classes. bool internal_access; - // By default, C# codegen now uses PascalCased enum values names, after - // removing the enum type name as a prefix (if it *is* a prefix of the value). - // Setting this option reverts to the previous behavior of just copying the - // value name specified in the .proto file, allowing gradual migration. - // This option will be removed before final release. - bool legacy_enum_values; }; } // namespace csharp -- cgit v1.2.3 From 3916a0aa999df3da9e8853b5911a5caf43a863fb Mon Sep 17 00:00:00 2001 From: Jisi Liu Date: Mon, 1 Aug 2016 18:47:45 -0700 Subject: Add and fix C++ runtime docs --- src/Makefile.am | 1 + src/google/protobuf/arena.h | 10 ++--- .../protobuf/compiler/command_line_interface.h | 5 +++ .../protobuf/compiler/csharp/csharp_generator.h | 6 +++ src/google/protobuf/compiler/js/js_generator.h | 6 +++ .../compiler/objectivec/objectivec_generator.h | 4 ++ .../compiler/objectivec/objectivec_helpers.h | 2 + src/google/protobuf/compiler/ruby/ruby_generator.h | 6 +++ src/google/protobuf/map.h | 9 +++-- src/google/protobuf/util/field_comparator.h | 2 + src/google/protobuf/util/field_mask_util.h | 2 + src/google/protobuf/util/package_info.h | 46 ++++++++++++++++++++++ src/google/protobuf/util/time_util.h | 3 ++ src/google/protobuf/util/type_resolver.h | 2 + src/google/protobuf/util/type_resolver_util.h | 2 + 15 files changed, 98 insertions(+), 8 deletions(-) create mode 100644 src/google/protobuf/util/package_info.h (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 524886ea..cf3f1d8e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -546,6 +546,7 @@ EXTRA_DIST = \ google/protobuf/testdata/text_format_unittest_extensions_data_pointy.txt \ google/protobuf/package_info.h \ google/protobuf/io/package_info.h \ + google/protobuf/util/package_info.h \ google/protobuf/compiler/ruby/ruby_generated_code.proto \ google/protobuf/compiler/ruby/ruby_generated_code_pb.rb \ google/protobuf/compiler/package_info.h \ diff --git a/src/google/protobuf/arena.h b/src/google/protobuf/arena.h index 58b1e126..0a5eacee 100644 --- a/src/google/protobuf/arena.h +++ b/src/google/protobuf/arena.h @@ -28,6 +28,8 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// This file defines an Arena allocator for better allocation performance. + #ifndef GOOGLE_PROTOBUF_ARENA_H__ #define GOOGLE_PROTOBUF_ARENA_H__ @@ -211,12 +213,10 @@ struct ArenaOptions { // // This protocol is implemented by all arena-enabled proto2 message classes as // well as RepeatedPtrField. - -#if __cplusplus >= 201103L -class LIBPROTOBUF_EXPORT Arena final { -#else +// +// Do NOT subclass Arena. This class will be marked as final when C++11 is +// enabled. class LIBPROTOBUF_EXPORT Arena { -#endif public: // Arena constructor taking custom options. See ArenaOptions below for // descriptions of the options available. diff --git a/src/google/protobuf/compiler/command_line_interface.h b/src/google/protobuf/compiler/command_line_interface.h index d1377666..32084567 100644 --- a/src/google/protobuf/compiler/command_line_interface.h +++ b/src/google/protobuf/compiler/command_line_interface.h @@ -55,6 +55,11 @@ class FileDescriptor; // descriptor.h class FileDescriptorProto; // descriptor.pb.h template class RepeatedPtrField; // repeated_field.h +} // namespace protobuf +} // namespace google + +namespace google { +namespace protobuf { namespace compiler { class CodeGenerator; // code_generator.h diff --git a/src/google/protobuf/compiler/csharp/csharp_generator.h b/src/google/protobuf/compiler/csharp/csharp_generator.h index 9b54e914..fd41d852 100644 --- a/src/google/protobuf/compiler/csharp/csharp_generator.h +++ b/src/google/protobuf/compiler/csharp/csharp_generator.h @@ -28,6 +28,8 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Generates C# code for a given .proto file. + #ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_GENERATOR_H__ #define GOOGLE_PROTOBUF_COMPILER_CSHARP_GENERATOR_H__ @@ -40,6 +42,10 @@ namespace protobuf { namespace compiler { namespace csharp { +// CodeGenerator implementation which generates a C# source file and +// header. If you create your own protocol compiler binary and you want +// it to support C# output, you can do so by registering an instance of this +// CodeGenerator with the CommandLineInterface in your main() function. class LIBPROTOC_EXPORT Generator : public google::protobuf::compiler::CodeGenerator { virtual bool Generate( diff --git a/src/google/protobuf/compiler/js/js_generator.h b/src/google/protobuf/compiler/js/js_generator.h index 6fd7ca50..056c9897 100755 --- a/src/google/protobuf/compiler/js/js_generator.h +++ b/src/google/protobuf/compiler/js/js_generator.h @@ -28,6 +28,8 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Generates JavaScript code for a given .proto file. + #ifndef GOOGLE_PROTOBUF_COMPILER_JS_GENERATOR_H__ #define GOOGLE_PROTOBUF_COMPILER_JS_GENERATOR_H__ @@ -90,6 +92,10 @@ struct GeneratorOptions { string* error); }; +// CodeGenerator implementation which generates a JavaScript source file and +// header. If you create your own protocol compiler binary and you want it to +// support JavaScript output, you can do so by registering an instance of this +// CodeGenerator with the CommandLineInterface in your main() function. class LIBPROTOC_EXPORT Generator : public CodeGenerator { public: Generator() {} diff --git a/src/google/protobuf/compiler/objectivec/objectivec_generator.h b/src/google/protobuf/compiler/objectivec/objectivec_generator.h index 09266b04..9ddca574 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_generator.h +++ b/src/google/protobuf/compiler/objectivec/objectivec_generator.h @@ -41,6 +41,10 @@ namespace protobuf { namespace compiler { namespace objectivec { +// CodeGenerator implementation which generates a ObjectiveC source file and +// header. If you create your own protocol compiler binary and you want it to +// support ObjectiveC output, you can do so by registering an instance of this +// CodeGenerator with the CommandLineInterface in your main() function. class LIBPROTOC_EXPORT ObjectiveCGenerator : public CodeGenerator { public: ObjectiveCGenerator(); diff --git a/src/google/protobuf/compiler/objectivec/objectivec_helpers.h b/src/google/protobuf/compiler/objectivec/objectivec_helpers.h index be20beee..7aae0fd2 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_helpers.h +++ b/src/google/protobuf/compiler/objectivec/objectivec_helpers.h @@ -28,6 +28,8 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Helper functions for generating ObjectiveC code. + #ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_HELPERS_H__ #define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_HELPERS_H__ diff --git a/src/google/protobuf/compiler/ruby/ruby_generator.h b/src/google/protobuf/compiler/ruby/ruby_generator.h index 75555c31..8c1dfa26 100644 --- a/src/google/protobuf/compiler/ruby/ruby_generator.h +++ b/src/google/protobuf/compiler/ruby/ruby_generator.h @@ -28,6 +28,8 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Generates Ruby code for a given .proto file. + #ifndef GOOGLE_PROTOBUF_COMPILER_RUBY_GENERATOR_H__ #define GOOGLE_PROTOBUF_COMPILER_RUBY_GENERATOR_H__ @@ -40,6 +42,10 @@ namespace protobuf { namespace compiler { namespace ruby { +// CodeGenerator implementation for generated Ruby protocol buffer classes. +// If you create your own protocol compiler binary and you want it to support +// Ruby output, you can do so by registering an instance of this +// CodeGenerator with the CommandLineInterface in your main() function. class LIBPROTOC_EXPORT Generator : public google::protobuf::compiler::CodeGenerator { virtual bool Generate( diff --git a/src/google/protobuf/map.h b/src/google/protobuf/map.h index 1b9aa703..bfc63b0f 100644 --- a/src/google/protobuf/map.h +++ b/src/google/protobuf/map.h @@ -28,6 +28,12 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// This file defines the map container and its helpers to support protobuf maps. +// +// The Map and MapIterator types are provided by this header file. +// Please avoid using other types defined here, unless they are public +// types within Map or MapIterator, such as Map::value_type. + #ifndef GOOGLE_PROTOBUF_MAP_H__ #define GOOGLE_PROTOBUF_MAP_H__ @@ -50,9 +56,6 @@ namespace google { namespace protobuf { -// The Map and MapIterator types are provided by this header file. -// Please avoid using other types defined here, unless they are public -// types within Map or MapIterator, such as Map::value_type. template class Map; diff --git a/src/google/protobuf/util/field_comparator.h b/src/google/protobuf/util/field_comparator.h index 1b4d65b0..715560ed 100644 --- a/src/google/protobuf/util/field_comparator.h +++ b/src/google/protobuf/util/field_comparator.h @@ -28,6 +28,8 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Defines classes for field comparison. + // Author: ksroka@google.com (Krzysztof Sroka) #ifndef GOOGLE_PROTOBUF_UTIL_FIELD_COMPARATOR_H__ diff --git a/src/google/protobuf/util/field_mask_util.h b/src/google/protobuf/util/field_mask_util.h index e79b65e9..396c9aea 100644 --- a/src/google/protobuf/util/field_mask_util.h +++ b/src/google/protobuf/util/field_mask_util.h @@ -28,6 +28,8 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Defines utilities for the FieldMask well known type. + #ifndef GOOGLE_PROTOBUF_UTIL_FIELD_MASK_UTIL_H__ #define GOOGLE_PROTOBUF_UTIL_FIELD_MASK_UTIL_H__ diff --git a/src/google/protobuf/util/package_info.h b/src/google/protobuf/util/package_info.h new file mode 100644 index 00000000..e37e6dc0 --- /dev/null +++ b/src/google/protobuf/util/package_info.h @@ -0,0 +1,46 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// 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 +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// This file exists solely to document the google::protobuf::util namespace. +// It is not compiled into anything, but it may be read by an automated +// documentation generator. + +namespace google { + +namespace protobuf { + +// Utility classes. +// +// This package contains various utilities for message comprasion, JSON +// conversion, well known types, etc. +namespace util {} + +} // namespace protobuf +} // namespace google diff --git a/src/google/protobuf/util/time_util.h b/src/google/protobuf/util/time_util.h index 1bac0897..432c9f0a 100644 --- a/src/google/protobuf/util/time_util.h +++ b/src/google/protobuf/util/time_util.h @@ -28,6 +28,8 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Defines utilities for the Timestamp and Duration well known types. + #ifndef GOOGLE_PROTOBUF_UTIL_TIME_UTIL_H__ #define GOOGLE_PROTOBUF_UTIL_TIME_UTIL_H__ @@ -47,6 +49,7 @@ namespace google { namespace protobuf { namespace util { +// Utility functions for Timestamp and Duration. class LIBPROTOBUF_EXPORT TimeUtil { typedef google::protobuf::Timestamp Timestamp; typedef google::protobuf::Duration Duration; diff --git a/src/google/protobuf/util/type_resolver.h b/src/google/protobuf/util/type_resolver.h index 77d4416a..959f3c79 100644 --- a/src/google/protobuf/util/type_resolver.h +++ b/src/google/protobuf/util/type_resolver.h @@ -28,6 +28,8 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Defines a TypeResolver for the Any message. + #ifndef GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_H__ #define GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_H__ diff --git a/src/google/protobuf/util/type_resolver_util.h b/src/google/protobuf/util/type_resolver_util.h index c0ef3c1a..c17366fc 100644 --- a/src/google/protobuf/util/type_resolver_util.h +++ b/src/google/protobuf/util/type_resolver_util.h @@ -28,6 +28,8 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Defines utilities for the TypeResolver. + #ifndef GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_UTIL_H__ #define GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_UTIL_H__ -- cgit v1.2.3 From a989501f47a351472526a54c6e78bfbc4c6ec950 Mon Sep 17 00:00:00 2001 From: Sergio Campamá Date: Tue, 9 Aug 2016 05:26:24 -0700 Subject: Adds support for appledoc in generated code. (#1928) Convert mapping of proto comments to appledoc format so they show up in Xcode and cocoadocs. Fixes https://github.com/google/protobuf/issues/1866 --- objectivec/Tests/unittest_objc.proto | 9 + objectivec/google/protobuf/Any.pbobjc.h | 204 +++++----- objectivec/google/protobuf/Api.pbobjc.h | 304 ++++++++------- objectivec/google/protobuf/Duration.pbobjc.h | 120 +++--- objectivec/google/protobuf/Empty.pbobjc.h | 38 +- objectivec/google/protobuf/FieldMask.pbobjc.h | 426 +++++++++++---------- objectivec/google/protobuf/SourceContext.pbobjc.h | 30 +- objectivec/google/protobuf/Struct.pbobjc.h | 124 +++--- objectivec/google/protobuf/Timestamp.pbobjc.h | 144 +++---- objectivec/google/protobuf/Type.pbobjc.h | 274 +++++++------ objectivec/google/protobuf/Wrappers.pbobjc.h | 108 +++--- .../compiler/objectivec/objectivec_enum.cc | 18 +- .../compiler/objectivec/objectivec_enum_field.cc | 14 +- .../compiler/objectivec/objectivec_extension.cc | 2 +- .../compiler/objectivec/objectivec_field.cc | 6 +- .../compiler/objectivec/objectivec_file.cc | 18 +- .../compiler/objectivec/objectivec_helpers.cc | 39 +- .../compiler/objectivec/objectivec_helpers.h | 6 +- .../compiler/objectivec/objectivec_message.cc | 2 +- .../compiler/objectivec/objectivec_oneof.cc | 6 +- 20 files changed, 1041 insertions(+), 851 deletions(-) (limited to 'src') diff --git a/objectivec/Tests/unittest_objc.proto b/objectivec/Tests/unittest_objc.proto index 914945eb..e5577faf 100644 --- a/objectivec/Tests/unittest_objc.proto +++ b/objectivec/Tests/unittest_objc.proto @@ -34,6 +34,15 @@ import "google/protobuf/unittest.proto"; package protobuf_unittest; +// Used to check that Headerdocs and appledoc work correctly. If these comments +// are not handled correctly, Xcode will fail to build the tests. +message TestGeneratedComments { + // This is a string that could contain stuff like + // mime types as image/* or */plain. Maybe twitter usernames + // like @protobuf, @google or @something. + optional string string_field = 1; +} + // Using the messages in unittest.proto, setup for recursive cases for testing // extensions at various depths. extend TestAllExtensions { diff --git a/objectivec/google/protobuf/Any.pbobjc.h b/objectivec/google/protobuf/Any.pbobjc.h index 4253b604..940206b6 100644 --- a/objectivec/google/protobuf/Any.pbobjc.h +++ b/objectivec/google/protobuf/Any.pbobjc.h @@ -28,14 +28,16 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - GPBAnyRoot -/// Exposes the extension registry for this file. -/// -/// The base class provides: -/// @code -/// + (GPBExtensionRegistry *)extensionRegistry; -/// @endcode -/// which is a @c GPBExtensionRegistry that includes all the extensions defined by -/// this file and all files that it depends on. +/** + * Exposes the extension registry for this file. + * + * The base class provides: + * @code + * + (GPBExtensionRegistry *)extensionRegistry; + * @endcode + * which is a @c GPBExtensionRegistry that includes all the extensions defined by + * this file and all files that it depends on. + **/ @interface GPBAnyRoot : GPBRootObject @end @@ -46,101 +48,105 @@ typedef GPB_ENUM(GPBAny_FieldNumber) { GPBAny_FieldNumber_Value = 2, }; -/// `Any` contains an arbitrary serialized protocol buffer message along with a -/// URL that describes the type of the serialized message. -/// -/// Protobuf library provides support to pack/unpack Any values in the form -/// of utility functions or additional generated methods of the Any type. -/// -/// Example 1: Pack and unpack a message in C++. -/// -/// Foo foo = ...; -/// Any any; -/// any.PackFrom(foo); -/// ... -/// if (any.UnpackTo(&foo)) { -/// ... -/// } -/// -/// Example 2: Pack and unpack a message in Java. -/// -/// Foo foo = ...; -/// Any any = Any.pack(foo); -/// ... -/// if (any.is(Foo.class)) { -/// foo = any.unpack(Foo.class); -/// } -/// -/// Example 3: Pack and unpack a message in Python. -/// -/// foo = Foo(...) -/// any = Any() -/// any.Pack(foo) -/// ... -/// if any.Is(Foo.DESCRIPTOR): -/// any.Unpack(foo) -/// ... -/// -/// The pack methods provided by protobuf library will by default use -/// 'type.googleapis.com/full.type.name' as the type URL and the unpack -/// methods only use the fully qualified type name after the last '/' -/// in the type URL, for example "foo.bar.com/x/y.z" will yield type -/// name "y.z". -/// -/// -/// JSON -/// ==== -/// The JSON representation of an `Any` value uses the regular -/// representation of the deserialized, embedded message, with an -/// additional field `\@type` which contains the type URL. Example: -/// -/// package google.profile; -/// message Person { -/// string first_name = 1; -/// string last_name = 2; -/// } -/// -/// { -/// "\@type": "type.googleapis.com/google.profile.Person", -/// "firstName": , -/// "lastName": -/// } -/// -/// If the embedded message type is well-known and has a custom JSON -/// representation, that representation will be embedded adding a field -/// `value` which holds the custom JSON in addition to the `\@type` -/// field. Example (for message [google.protobuf.Duration][]): -/// -/// { -/// "\@type": "type.googleapis.com/google.protobuf.Duration", -/// "value": "1.212s" -/// } +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `\@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "\@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `\@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "\@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + **/ @interface GPBAny : GPBMessage -/// A URL/resource name whose content describes the type of the -/// serialized protocol buffer message. -/// -/// For URLs which use the scheme `http`, `https`, or no scheme, the -/// following restrictions and interpretations apply: -/// -/// * If no scheme is provided, `https` is assumed. -/// * The last segment of the URL's path must represent the fully -/// qualified name of the type (as in `path/google.protobuf.Duration`). -/// The name should be in a canonical form (e.g., leading "." is -/// not accepted). -/// * An HTTP GET on the URL must yield a [google.protobuf.Type][] -/// value in binary format, or produce an error. -/// * Applications are allowed to cache lookup results based on the -/// URL, or have them precompiled into a binary to avoid any -/// lookup. Therefore, binary compatibility needs to be preserved -/// on changes to types. (Use versioned type names to manage -/// breaking changes.) -/// -/// Schemes other than `http`, `https` (or the empty scheme) might be -/// used with implementation specific semantics. +/** + * A URL/resource name whose content describes the type of the + * serialized protocol buffer message. + * + * For URLs which use the scheme `http`, `https`, or no scheme, the + * following restrictions and interpretations apply: + * + * * If no scheme is provided, `https` is assumed. + * * The last segment of the URL's path must represent the fully + * qualified name of the type (as in `path/google.protobuf.Duration`). + * The name should be in a canonical form (e.g., leading "." is + * not accepted). + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + **/ @property(nonatomic, readwrite, copy, null_resettable) NSString *typeURL; -/// Must be a valid serialized protocol buffer of the above specified type. +/** Must be a valid serialized protocol buffer of the above specified type. */ @property(nonatomic, readwrite, copy, null_resettable) NSData *value; @end diff --git a/objectivec/google/protobuf/Api.pbobjc.h b/objectivec/google/protobuf/Api.pbobjc.h index 04341f47..3dda7698 100644 --- a/objectivec/google/protobuf/Api.pbobjc.h +++ b/objectivec/google/protobuf/Api.pbobjc.h @@ -34,14 +34,16 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - GPBApiRoot -/// Exposes the extension registry for this file. -/// -/// The base class provides: -/// @code -/// + (GPBExtensionRegistry *)extensionRegistry; -/// @endcode -/// which is a @c GPBExtensionRegistry that includes all the extensions defined by -/// this file and all files that it depends on. +/** + * Exposes the extension registry for this file. + * + * The base class provides: + * @code + * + (GPBExtensionRegistry *)extensionRegistry; + * @endcode + * which is a @c GPBExtensionRegistry that includes all the extensions defined by + * this file and all files that it depends on. + **/ @interface GPBApiRoot : GPBRootObject @end @@ -57,67 +59,79 @@ typedef GPB_ENUM(GPBApi_FieldNumber) { GPBApi_FieldNumber_Syntax = 7, }; -/// Api is a light-weight descriptor for a protocol buffer service. +/** + * Api is a light-weight descriptor for a protocol buffer service. + **/ @interface GPBApi : GPBMessage -/// The fully qualified name of this api, including package name -/// followed by the api's simple name. +/** + * The fully qualified name of this api, including package name + * followed by the api's simple name. + **/ @property(nonatomic, readwrite, copy, null_resettable) NSString *name; -/// The methods of this api, in unspecified order. +/** The methods of this api, in unspecified order. */ @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *methodsArray; -/// The number of items in @c methodsArray without causing the array to be created. +/** The number of items in @c methodsArray without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger methodsArray_Count; -/// Any metadata attached to the API. +/** Any metadata attached to the API. */ @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *optionsArray; -/// The number of items in @c optionsArray without causing the array to be created. +/** The number of items in @c optionsArray without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger optionsArray_Count; -/// A version string for this api. If specified, must have the form -/// `major-version.minor-version`, as in `1.10`. If the minor version -/// is omitted, it defaults to zero. If the entire version field is -/// empty, the major version is derived from the package name, as -/// outlined below. If the field is not empty, the version in the -/// package name will be verified to be consistent with what is -/// provided here. -/// -/// The versioning schema uses [semantic -/// versioning](http://semver.org) where the major version number -/// indicates a breaking change and the minor version an additive, -/// non-breaking change. Both version numbers are signals to users -/// what to expect from different versions, and should be carefully -/// chosen based on the product plan. -/// -/// The major version is also reflected in the package name of the -/// API, which must end in `v`, as in -/// `google.feature.v1`. For major versions 0 and 1, the suffix can -/// be omitted. Zero major versions must only be used for -/// experimental, none-GA apis. +/** + * A version string for this api. If specified, must have the form + * `major-version.minor-version`, as in `1.10`. If the minor version + * is omitted, it defaults to zero. If the entire version field is + * empty, the major version is derived from the package name, as + * outlined below. If the field is not empty, the version in the + * package name will be verified to be consistent with what is + * provided here. + * + * The versioning schema uses [semantic + * versioning](http://semver.org) where the major version number + * indicates a breaking change and the minor version an additive, + * non-breaking change. Both version numbers are signals to users + * what to expect from different versions, and should be carefully + * chosen based on the product plan. + * + * The major version is also reflected in the package name of the + * API, which must end in `v`, as in + * `google.feature.v1`. For major versions 0 and 1, the suffix can + * be omitted. Zero major versions must only be used for + * experimental, none-GA apis. + **/ @property(nonatomic, readwrite, copy, null_resettable) NSString *version; -/// Source context for the protocol buffer service represented by this -/// message. +/** + * Source context for the protocol buffer service represented by this + * message. + **/ @property(nonatomic, readwrite, strong, null_resettable) GPBSourceContext *sourceContext; -/// Test to see if @c sourceContext has been set. +/** Test to see if @c sourceContext has been set. */ @property(nonatomic, readwrite) BOOL hasSourceContext; -/// Included APIs. See [Mixin][]. +/** Included APIs. See [Mixin][]. */ @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *mixinsArray; -/// The number of items in @c mixinsArray without causing the array to be created. +/** The number of items in @c mixinsArray without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger mixinsArray_Count; -/// The source syntax of the service. +/** The source syntax of the service. */ @property(nonatomic, readwrite) enum GPBSyntax syntax; @end -/// Fetches the raw value of a @c GPBApi's @c syntax property, even -/// if the value was not defined by the enum at the time the code was generated. +/** + * Fetches the raw value of a @c GPBApi's @c syntax property, even + * if the value was not defined by the enum at the time the code was generated. + **/ int32_t GPBApi_Syntax_RawValue(GPBApi *message); -/// Sets the raw value of an @c GPBApi's @c syntax property, allowing -/// it to be set to a value that was not defined by the enum at the time the code -/// was generated. +/** + * Sets the raw value of an @c GPBApi's @c syntax property, allowing + * it to be set to a value that was not defined by the enum at the time the code + * was generated. + **/ void SetGPBApi_Syntax_RawValue(GPBApi *message, int32_t value); #pragma mark - GPBMethod @@ -132,40 +146,46 @@ typedef GPB_ENUM(GPBMethod_FieldNumber) { GPBMethod_FieldNumber_Syntax = 7, }; -/// Method represents a method of an api. +/** + * Method represents a method of an api. + **/ @interface GPBMethod : GPBMessage -/// The simple name of this method. +/** The simple name of this method. */ @property(nonatomic, readwrite, copy, null_resettable) NSString *name; -/// A URL of the input message type. +/** A URL of the input message type. */ @property(nonatomic, readwrite, copy, null_resettable) NSString *requestTypeURL; -/// If true, the request is streamed. +/** If true, the request is streamed. */ @property(nonatomic, readwrite) BOOL requestStreaming; -/// The URL of the output message type. +/** The URL of the output message type. */ @property(nonatomic, readwrite, copy, null_resettable) NSString *responseTypeURL; -/// If true, the response is streamed. +/** If true, the response is streamed. */ @property(nonatomic, readwrite) BOOL responseStreaming; -/// Any metadata attached to the method. +/** Any metadata attached to the method. */ @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *optionsArray; -/// The number of items in @c optionsArray without causing the array to be created. +/** The number of items in @c optionsArray without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger optionsArray_Count; -/// The source syntax of this method. +/** The source syntax of this method. */ @property(nonatomic, readwrite) enum GPBSyntax syntax; @end -/// Fetches the raw value of a @c GPBMethod's @c syntax property, even -/// if the value was not defined by the enum at the time the code was generated. +/** + * Fetches the raw value of a @c GPBMethod's @c syntax property, even + * if the value was not defined by the enum at the time the code was generated. + **/ int32_t GPBMethod_Syntax_RawValue(GPBMethod *message); -/// Sets the raw value of an @c GPBMethod's @c syntax property, allowing -/// it to be set to a value that was not defined by the enum at the time the code -/// was generated. +/** + * Sets the raw value of an @c GPBMethod's @c syntax property, allowing + * it to be set to a value that was not defined by the enum at the time the code + * was generated. + **/ void SetGPBMethod_Syntax_RawValue(GPBMethod *message, int32_t value); #pragma mark - GPBMixin @@ -175,90 +195,94 @@ typedef GPB_ENUM(GPBMixin_FieldNumber) { GPBMixin_FieldNumber_Root = 2, }; -/// Declares an API to be included in this API. The including API must -/// redeclare all the methods from the included API, but documentation -/// and options are inherited as follows: -/// -/// - If after comment and whitespace stripping, the documentation -/// string of the redeclared method is empty, it will be inherited -/// from the original method. -/// -/// - Each annotation belonging to the service config (http, -/// visibility) which is not set in the redeclared method will be -/// inherited. -/// -/// - If an http annotation is inherited, the path pattern will be -/// modified as follows. Any version prefix will be replaced by the -/// version of the including API plus the [root][] path if specified. -/// -/// Example of a simple mixin: -/// -/// package google.acl.v1; -/// service AccessControl { -/// // Get the underlying ACL object. -/// rpc GetAcl(GetAclRequest) returns (Acl) { -/// option (google.api.http).get = "/v1/{resource=**}:getAcl"; -/// } -/// } -/// -/// package google.storage.v2; -/// service Storage { -/// rpc GetAcl(GetAclRequest) returns (Acl); -/// -/// // Get a data record. -/// rpc GetData(GetDataRequest) returns (Data) { -/// option (google.api.http).get = "/v2/{resource=**}"; -/// } -/// } -/// -/// Example of a mixin configuration: -/// -/// apis: -/// - name: google.storage.v2.Storage -/// mixins: -/// - name: google.acl.v1.AccessControl -/// -/// The mixin construct implies that all methods in `AccessControl` are -/// also declared with same name and request/response types in -/// `Storage`. A documentation generator or annotation processor will -/// see the effective `Storage.GetAcl` method after inherting -/// documentation and annotations as follows: -/// -/// service Storage { -/// // Get the underlying ACL object. -/// rpc GetAcl(GetAclRequest) returns (Acl) { -/// option (google.api.http).get = "/v2/{resource=**}:getAcl"; -/// } -/// ... -/// } -/// -/// Note how the version in the path pattern changed from `v1` to `v2`. -/// -/// If the `root` field in the mixin is specified, it should be a -/// relative path under which inherited HTTP paths are placed. Example: -/// -/// apis: -/// - name: google.storage.v2.Storage -/// mixins: -/// - name: google.acl.v1.AccessControl -/// root: acls -/// -/// This implies the following inherited HTTP annotation: -/// -/// service Storage { -/// // Get the underlying ACL object. -/// rpc GetAcl(GetAclRequest) returns (Acl) { -/// option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; -/// } -/// ... -/// } +/** + * Declares an API to be included in this API. The including API must + * redeclare all the methods from the included API, but documentation + * and options are inherited as follows: + * + * - If after comment and whitespace stripping, the documentation + * string of the redeclared method is empty, it will be inherited + * from the original method. + * + * - Each annotation belonging to the service config (http, + * visibility) which is not set in the redeclared method will be + * inherited. + * + * - If an http annotation is inherited, the path pattern will be + * modified as follows. Any version prefix will be replaced by the + * version of the including API plus the [root][] path if specified. + * + * Example of a simple mixin: + * + * package google.acl.v1; + * service AccessControl { + * // Get the underlying ACL object. + * rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v1/{resource=**}:getAcl"; + * } + * } + * + * package google.storage.v2; + * service Storage { + * rpc GetAcl(GetAclRequest) returns (Acl); + * + * // Get a data record. + * rpc GetData(GetDataRequest) returns (Data) { + * option (google.api.http).get = "/v2/{resource=**}"; + * } + * } + * + * Example of a mixin configuration: + * + * apis: + * - name: google.storage.v2.Storage + * mixins: + * - name: google.acl.v1.AccessControl + * + * The mixin construct implies that all methods in `AccessControl` are + * also declared with same name and request/response types in + * `Storage`. A documentation generator or annotation processor will + * see the effective `Storage.GetAcl` method after inherting + * documentation and annotations as follows: + * + * service Storage { + * // Get the underlying ACL object. + * rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v2/{resource=**}:getAcl"; + * } + * ... + * } + * + * Note how the version in the path pattern changed from `v1` to `v2`. + * + * If the `root` field in the mixin is specified, it should be a + * relative path under which inherited HTTP paths are placed. Example: + * + * apis: + * - name: google.storage.v2.Storage + * mixins: + * - name: google.acl.v1.AccessControl + * root: acls + * + * This implies the following inherited HTTP annotation: + * + * service Storage { + * // Get the underlying ACL object. + * rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; + * } + * ... + * } + **/ @interface GPBMixin : GPBMessage -/// The fully qualified name of the API which is included. +/** The fully qualified name of the API which is included. */ @property(nonatomic, readwrite, copy, null_resettable) NSString *name; -/// If non-empty specifies a path under which inherited HTTP paths -/// are rooted. +/** + * If non-empty specifies a path under which inherited HTTP paths + * are rooted. + **/ @property(nonatomic, readwrite, copy, null_resettable) NSString *root; @end diff --git a/objectivec/google/protobuf/Duration.pbobjc.h b/objectivec/google/protobuf/Duration.pbobjc.h index 4c3173d3..8f9b3515 100644 --- a/objectivec/google/protobuf/Duration.pbobjc.h +++ b/objectivec/google/protobuf/Duration.pbobjc.h @@ -28,14 +28,16 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - GPBDurationRoot -/// Exposes the extension registry for this file. -/// -/// The base class provides: -/// @code -/// + (GPBExtensionRegistry *)extensionRegistry; -/// @endcode -/// which is a @c GPBExtensionRegistry that includes all the extensions defined by -/// this file and all files that it depends on. +/** + * Exposes the extension registry for this file. + * + * The base class provides: + * @code + * + (GPBExtensionRegistry *)extensionRegistry; + * @endcode + * which is a @c GPBExtensionRegistry that includes all the extensions defined by + * this file and all files that it depends on. + **/ @interface GPBDurationRoot : GPBRootObject @end @@ -46,58 +48,64 @@ typedef GPB_ENUM(GPBDuration_FieldNumber) { GPBDuration_FieldNumber_Nanos = 2, }; -/// A Duration represents a signed, fixed-length span of time represented -/// as a count of seconds and fractions of seconds at nanosecond -/// resolution. It is independent of any calendar and concepts like "day" -/// or "month". It is related to Timestamp in that the difference between -/// two Timestamp values is a Duration and it can be added or subtracted -/// from a Timestamp. Range is approximately +-10,000 years. -/// -/// Example 1: Compute Duration from two Timestamps in pseudo code. -/// -/// Timestamp start = ...; -/// Timestamp end = ...; -/// Duration duration = ...; -/// -/// duration.seconds = end.seconds - start.seconds; -/// duration.nanos = end.nanos - start.nanos; -/// -/// if (duration.seconds < 0 && duration.nanos > 0) { -/// duration.seconds += 1; -/// duration.nanos -= 1000000000; -/// } else if (durations.seconds > 0 && duration.nanos < 0) { -/// duration.seconds -= 1; -/// duration.nanos += 1000000000; -/// } -/// -/// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. -/// -/// Timestamp start = ...; -/// Duration duration = ...; -/// Timestamp end = ...; -/// -/// end.seconds = start.seconds + duration.seconds; -/// end.nanos = start.nanos + duration.nanos; -/// -/// if (end.nanos < 0) { -/// end.seconds -= 1; -/// end.nanos += 1000000000; -/// } else if (end.nanos >= 1000000000) { -/// end.seconds += 1; -/// end.nanos -= 1000000000; -/// } +/** + * A Duration represents a signed, fixed-length span of time represented + * as a count of seconds and fractions of seconds at nanosecond + * resolution. It is independent of any calendar and concepts like "day" + * or "month". It is related to Timestamp in that the difference between + * two Timestamp values is a Duration and it can be added or subtracted + * from a Timestamp. Range is approximately +-10,000 years. + * + * Example 1: Compute Duration from two Timestamps in pseudo code. + * + * Timestamp start = ...; + * Timestamp end = ...; + * Duration duration = ...; + * + * duration.seconds = end.seconds - start.seconds; + * duration.nanos = end.nanos - start.nanos; + * + * if (duration.seconds < 0 && duration.nanos > 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (durations.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } + * + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; + * + * end.seconds = start.seconds + duration.seconds; + * end.nanos = start.nanos + duration.nanos; + * + * if (end.nanos < 0) { + * end.seconds -= 1; + * end.nanos += 1000000000; + * } else if (end.nanos >= 1000000000) { + * end.seconds += 1; + * end.nanos -= 1000000000; + * } + **/ @interface GPBDuration : GPBMessage -/// Signed seconds of the span of time. Must be from -315,576,000,000 -/// to +315,576,000,000 inclusive. +/** + * Signed seconds of the span of time. Must be from -315,576,000,000 + * to +315,576,000,000 inclusive. + **/ @property(nonatomic, readwrite) int64_t seconds; -/// Signed fractions of a second at nanosecond resolution of the span -/// of time. Durations less than one second are represented with a 0 -/// `seconds` field and a positive or negative `nanos` field. For durations -/// of one second or more, a non-zero value for the `nanos` field must be -/// of the same sign as the `seconds` field. Must be from -999,999,999 -/// to +999,999,999 inclusive. +/** + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + **/ @property(nonatomic, readwrite) int32_t nanos; @end diff --git a/objectivec/google/protobuf/Empty.pbobjc.h b/objectivec/google/protobuf/Empty.pbobjc.h index 2d2a86bc..d85efd2c 100644 --- a/objectivec/google/protobuf/Empty.pbobjc.h +++ b/objectivec/google/protobuf/Empty.pbobjc.h @@ -28,28 +28,32 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - GPBEmptyRoot -/// Exposes the extension registry for this file. -/// -/// The base class provides: -/// @code -/// + (GPBExtensionRegistry *)extensionRegistry; -/// @endcode -/// which is a @c GPBExtensionRegistry that includes all the extensions defined by -/// this file and all files that it depends on. +/** + * Exposes the extension registry for this file. + * + * The base class provides: + * @code + * + (GPBExtensionRegistry *)extensionRegistry; + * @endcode + * which is a @c GPBExtensionRegistry that includes all the extensions defined by + * this file and all files that it depends on. + **/ @interface GPBEmptyRoot : GPBRootObject @end #pragma mark - GPBEmpty -/// A generic empty message that you can re-use to avoid defining duplicated -/// empty messages in your APIs. A typical example is to use it as the request -/// or the response type of an API method. For instance: -/// -/// service Foo { -/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); -/// } -/// -/// The JSON representation for `Empty` is empty JSON object `{}`. +/** + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: + * + * service Foo { + * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + * } + * + * The JSON representation for `Empty` is empty JSON object `{}`. + **/ @interface GPBEmpty : GPBMessage @end diff --git a/objectivec/google/protobuf/FieldMask.pbobjc.h b/objectivec/google/protobuf/FieldMask.pbobjc.h index 06053f1a..175db600 100644 --- a/objectivec/google/protobuf/FieldMask.pbobjc.h +++ b/objectivec/google/protobuf/FieldMask.pbobjc.h @@ -28,14 +28,16 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - GPBFieldMaskRoot -/// Exposes the extension registry for this file. -/// -/// The base class provides: -/// @code -/// + (GPBExtensionRegistry *)extensionRegistry; -/// @endcode -/// which is a @c GPBExtensionRegistry that includes all the extensions defined by -/// this file and all files that it depends on. +/** + * Exposes the extension registry for this file. + * + * The base class provides: + * @code + * + (GPBExtensionRegistry *)extensionRegistry; + * @endcode + * which is a @c GPBExtensionRegistry that includes all the extensions defined by + * this file and all files that it depends on. + **/ @interface GPBFieldMaskRoot : GPBRootObject @end @@ -45,212 +47,214 @@ typedef GPB_ENUM(GPBFieldMask_FieldNumber) { GPBFieldMask_FieldNumber_PathsArray = 1, }; -/// `FieldMask` represents a set of symbolic field paths, for example: -/// -/// paths: "f.a" -/// paths: "f.b.d" -/// -/// Here `f` represents a field in some root message, `a` and `b` -/// fields in the message found in `f`, and `d` a field found in the -/// message in `f.b`. -/// -/// Field masks are used to specify a subset of fields that should be -/// returned by a get operation or modified by an update operation. -/// Field masks also have a custom JSON encoding (see below). -/// -/// # Field Masks in Projections -/// -/// When used in the context of a projection, a response message or -/// sub-message is filtered by the API to only contain those fields as -/// specified in the mask. For example, if the mask in the previous -/// example is applied to a response message as follows: -/// -/// f { -/// a : 22 -/// b { -/// d : 1 -/// x : 2 -/// } -/// y : 13 -/// } -/// z: 8 -/// -/// The result will not contain specific values for fields x,y and z -/// (their value will be set to the default, and omitted in proto text -/// output): -/// -/// -/// f { -/// a : 22 -/// b { -/// d : 1 -/// } -/// } -/// -/// A repeated field is not allowed except at the last position of a -/// field mask. -/// -/// If a FieldMask object is not present in a get operation, the -/// operation applies to all fields (as if a FieldMask of all fields -/// had been specified). -/// -/// Note that a field mask does not necessarily apply to the -/// top-level response message. In case of a REST get operation, the -/// field mask applies directly to the response, but in case of a REST -/// list operation, the mask instead applies to each individual message -/// in the returned resource list. In case of a REST custom method, -/// other definitions may be used. Where the mask applies will be -/// clearly documented together with its declaration in the API. In -/// any case, the effect on the returned resource/resources is required -/// behavior for APIs. -/// -/// # Field Masks in Update Operations -/// -/// A field mask in update operations specifies which fields of the -/// targeted resource are going to be updated. The API is required -/// to only change the values of the fields as specified in the mask -/// and leave the others untouched. If a resource is passed in to -/// describe the updated values, the API ignores the values of all -/// fields not covered by the mask. -/// -/// If a repeated field is specified for an update operation, the existing -/// repeated values in the target resource will be overwritten by the new values. -/// Note that a repeated field is only allowed in the last position of a field -/// mask. -/// -/// If a sub-message is specified in the last position of the field mask for an -/// update operation, then the existing sub-message in the target resource is -/// overwritten. Given the target message: -/// -/// f { -/// b { -/// d : 1 -/// x : 2 -/// } -/// c : 1 -/// } -/// -/// And an update message: -/// -/// f { -/// b { -/// d : 10 -/// } -/// } -/// -/// then if the field mask is: -/// -/// paths: "f.b" -/// -/// then the result will be: -/// -/// f { -/// b { -/// d : 10 -/// } -/// c : 1 -/// } -/// -/// However, if the update mask was: -/// -/// paths: "f.b.d" -/// -/// then the result would be: -/// -/// f { -/// b { -/// d : 10 -/// x : 2 -/// } -/// c : 1 -/// } -/// -/// In order to reset a field's value to the default, the field must -/// be in the mask and set to the default value in the provided resource. -/// Hence, in order to reset all fields of a resource, provide a default -/// instance of the resource and set all fields in the mask, or do -/// not provide a mask as described below. -/// -/// If a field mask is not present on update, the operation applies to -/// all fields (as if a field mask of all fields has been specified). -/// Note that in the presence of schema evolution, this may mean that -/// fields the client does not know and has therefore not filled into -/// the request will be reset to their default. If this is unwanted -/// behavior, a specific service may require a client to always specify -/// a field mask, producing an error if not. -/// -/// As with get operations, the location of the resource which -/// describes the updated values in the request message depends on the -/// operation kind. In any case, the effect of the field mask is -/// required to be honored by the API. -/// -/// ## Considerations for HTTP REST -/// -/// The HTTP kind of an update operation which uses a field mask must -/// be set to PATCH instead of PUT in order to satisfy HTTP semantics -/// (PUT must only be used for full updates). -/// -/// # JSON Encoding of Field Masks -/// -/// In JSON, a field mask is encoded as a single string where paths are -/// separated by a comma. Fields name in each path are converted -/// to/from lower-camel naming conventions. -/// -/// As an example, consider the following message declarations: -/// -/// message Profile { -/// User user = 1; -/// Photo photo = 2; -/// } -/// message User { -/// string display_name = 1; -/// string address = 2; -/// } -/// -/// In proto a field mask for `Profile` may look as such: -/// -/// mask { -/// paths: "user.display_name" -/// paths: "photo" -/// } -/// -/// In JSON, the same mask is represented as below: -/// -/// { -/// mask: "user.displayName,photo" -/// } -/// -/// # Field Masks and Oneof Fields -/// -/// Field masks treat fields in oneofs just as regular fields. Consider the -/// following message: -/// -/// message SampleMessage { -/// oneof test_oneof { -/// string name = 4; -/// SubMessage sub_message = 9; -/// } -/// } -/// -/// The field mask can be: -/// -/// mask { -/// paths: "name" -/// } -/// -/// Or: -/// -/// mask { -/// paths: "sub_message" -/// } -/// -/// Note that oneof type names ("test_oneof" in this case) cannot be used in -/// paths. +/** + * `FieldMask` represents a set of symbolic field paths, for example: + * + * paths: "f.a" + * paths: "f.b.d" + * + * Here `f` represents a field in some root message, `a` and `b` + * fields in the message found in `f`, and `d` a field found in the + * message in `f.b`. + * + * Field masks are used to specify a subset of fields that should be + * returned by a get operation or modified by an update operation. + * Field masks also have a custom JSON encoding (see below). + * + * # Field Masks in Projections + * + * When used in the context of a projection, a response message or + * sub-message is filtered by the API to only contain those fields as + * specified in the mask. For example, if the mask in the previous + * example is applied to a response message as follows: + * + * f { + * a : 22 + * b { + * d : 1 + * x : 2 + * } + * y : 13 + * } + * z: 8 + * + * The result will not contain specific values for fields x,y and z + * (their value will be set to the default, and omitted in proto text + * output): + * + * + * f { + * a : 22 + * b { + * d : 1 + * } + * } + * + * A repeated field is not allowed except at the last position of a + * field mask. + * + * If a FieldMask object is not present in a get operation, the + * operation applies to all fields (as if a FieldMask of all fields + * had been specified). + * + * Note that a field mask does not necessarily apply to the + * top-level response message. In case of a REST get operation, the + * field mask applies directly to the response, but in case of a REST + * list operation, the mask instead applies to each individual message + * in the returned resource list. In case of a REST custom method, + * other definitions may be used. Where the mask applies will be + * clearly documented together with its declaration in the API. In + * any case, the effect on the returned resource/resources is required + * behavior for APIs. + * + * # Field Masks in Update Operations + * + * A field mask in update operations specifies which fields of the + * targeted resource are going to be updated. The API is required + * to only change the values of the fields as specified in the mask + * and leave the others untouched. If a resource is passed in to + * describe the updated values, the API ignores the values of all + * fields not covered by the mask. + * + * If a repeated field is specified for an update operation, the existing + * repeated values in the target resource will be overwritten by the new values. + * Note that a repeated field is only allowed in the last position of a field + * mask. + * + * If a sub-message is specified in the last position of the field mask for an + * update operation, then the existing sub-message in the target resource is + * overwritten. Given the target message: + * + * f { + * b { + * d : 1 + * x : 2 + * } + * c : 1 + * } + * + * And an update message: + * + * f { + * b { + * d : 10 + * } + * } + * + * then if the field mask is: + * + * paths: "f.b" + * + * then the result will be: + * + * f { + * b { + * d : 10 + * } + * c : 1 + * } + * + * However, if the update mask was: + * + * paths: "f.b.d" + * + * then the result would be: + * + * f { + * b { + * d : 10 + * x : 2 + * } + * c : 1 + * } + * + * In order to reset a field's value to the default, the field must + * be in the mask and set to the default value in the provided resource. + * Hence, in order to reset all fields of a resource, provide a default + * instance of the resource and set all fields in the mask, or do + * not provide a mask as described below. + * + * If a field mask is not present on update, the operation applies to + * all fields (as if a field mask of all fields has been specified). + * Note that in the presence of schema evolution, this may mean that + * fields the client does not know and has therefore not filled into + * the request will be reset to their default. If this is unwanted + * behavior, a specific service may require a client to always specify + * a field mask, producing an error if not. + * + * As with get operations, the location of the resource which + * describes the updated values in the request message depends on the + * operation kind. In any case, the effect of the field mask is + * required to be honored by the API. + * + * ## Considerations for HTTP REST + * + * The HTTP kind of an update operation which uses a field mask must + * be set to PATCH instead of PUT in order to satisfy HTTP semantics + * (PUT must only be used for full updates). + * + * # JSON Encoding of Field Masks + * + * In JSON, a field mask is encoded as a single string where paths are + * separated by a comma. Fields name in each path are converted + * to/from lower-camel naming conventions. + * + * As an example, consider the following message declarations: + * + * message Profile { + * User user = 1; + * Photo photo = 2; + * } + * message User { + * string display_name = 1; + * string address = 2; + * } + * + * In proto a field mask for `Profile` may look as such: + * + * mask { + * paths: "user.display_name" + * paths: "photo" + * } + * + * In JSON, the same mask is represented as below: + * + * { + * mask: "user.displayName,photo" + * } + * + * # Field Masks and Oneof Fields + * + * Field masks treat fields in oneofs just as regular fields. Consider the + * following message: + * + * message SampleMessage { + * oneof test_oneof { + * string name = 4; + * SubMessage sub_message = 9; + * } + * } + * + * The field mask can be: + * + * mask { + * paths: "name" + * } + * + * Or: + * + * mask { + * paths: "sub_message" + * } + * + * Note that oneof type names ("test_oneof" in this case) cannot be used in + * paths. + **/ @interface GPBFieldMask : GPBMessage -/// The set of field mask paths. +/** The set of field mask paths. */ @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *pathsArray; -/// The number of items in @c pathsArray without causing the array to be created. +/** The number of items in @c pathsArray without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger pathsArray_Count; @end diff --git a/objectivec/google/protobuf/SourceContext.pbobjc.h b/objectivec/google/protobuf/SourceContext.pbobjc.h index 4514fa9f..d9450057 100644 --- a/objectivec/google/protobuf/SourceContext.pbobjc.h +++ b/objectivec/google/protobuf/SourceContext.pbobjc.h @@ -28,14 +28,16 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - GPBSourceContextRoot -/// Exposes the extension registry for this file. -/// -/// The base class provides: -/// @code -/// + (GPBExtensionRegistry *)extensionRegistry; -/// @endcode -/// which is a @c GPBExtensionRegistry that includes all the extensions defined by -/// this file and all files that it depends on. +/** + * Exposes the extension registry for this file. + * + * The base class provides: + * @code + * + (GPBExtensionRegistry *)extensionRegistry; + * @endcode + * which is a @c GPBExtensionRegistry that includes all the extensions defined by + * this file and all files that it depends on. + **/ @interface GPBSourceContextRoot : GPBRootObject @end @@ -45,12 +47,16 @@ typedef GPB_ENUM(GPBSourceContext_FieldNumber) { GPBSourceContext_FieldNumber_FileName = 1, }; -/// `SourceContext` represents information about the source of a -/// protobuf element, like the file in which it is defined. +/** + * `SourceContext` represents information about the source of a + * protobuf element, like the file in which it is defined. + **/ @interface GPBSourceContext : GPBMessage -/// The path-qualified name of the .proto file that contained the associated -/// protobuf element. For example: `"google/protobuf/source_context.proto"`. +/** + * The path-qualified name of the .proto file that contained the associated + * protobuf element. For example: `"google/protobuf/source_context.proto"`. + **/ @property(nonatomic, readwrite, copy, null_resettable) NSString *fileName; @end diff --git a/objectivec/google/protobuf/Struct.pbobjc.h b/objectivec/google/protobuf/Struct.pbobjc.h index 3e2d55fd..670e049d 100644 --- a/objectivec/google/protobuf/Struct.pbobjc.h +++ b/objectivec/google/protobuf/Struct.pbobjc.h @@ -32,35 +32,43 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - Enum GPBNullValue -/// `NullValue` is a singleton enumeration to represent the null value for the -/// `Value` type union. -/// -/// The JSON representation for `NullValue` is JSON `null`. +/** + * `NullValue` is a singleton enumeration to represent the null value for the + * `Value` type union. + * + * The JSON representation for `NullValue` is JSON `null`. + **/ typedef GPB_ENUM(GPBNullValue) { - /// Value used if any message's field encounters a value that is not defined - /// by this enum. The message will also have C functions to get/set the rawValue - /// of the field. + /** + * Value used if any message's field encounters a value that is not defined + * by this enum. The message will also have C functions to get/set the rawValue + * of the field. + **/ GPBNullValue_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, - /// Null value. + /** Null value. */ GPBNullValue_NullValue = 0, }; GPBEnumDescriptor *GPBNullValue_EnumDescriptor(void); -/// Checks to see if the given value is defined by the enum or was not known at -/// the time this source was generated. +/** + * Checks to see if the given value is defined by the enum or was not known at + * the time this source was generated. + **/ BOOL GPBNullValue_IsValidValue(int32_t value); #pragma mark - GPBStructRoot -/// Exposes the extension registry for this file. -/// -/// The base class provides: -/// @code -/// + (GPBExtensionRegistry *)extensionRegistry; -/// @endcode -/// which is a @c GPBExtensionRegistry that includes all the extensions defined by -/// this file and all files that it depends on. +/** + * Exposes the extension registry for this file. + * + * The base class provides: + * @code + * + (GPBExtensionRegistry *)extensionRegistry; + * @endcode + * which is a @c GPBExtensionRegistry that includes all the extensions defined by + * this file and all files that it depends on. + **/ @interface GPBStructRoot : GPBRootObject @end @@ -70,19 +78,21 @@ typedef GPB_ENUM(GPBStruct_FieldNumber) { GPBStruct_FieldNumber_Fields = 1, }; -/// `Struct` represents a structured data value, consisting of fields -/// which map to dynamically typed values. In some languages, `Struct` -/// might be supported by a native representation. For example, in -/// scripting languages like JS a struct is represented as an -/// object. The details of that representation are described together -/// with the proto support for the language. -/// -/// The JSON representation for `Struct` is JSON object. +/** + * `Struct` represents a structured data value, consisting of fields + * which map to dynamically typed values. In some languages, `Struct` + * might be supported by a native representation. For example, in + * scripting languages like JS a struct is represented as an + * object. The details of that representation are described together + * with the proto support for the language. + * + * The JSON representation for `Struct` is JSON object. + **/ @interface GPBStruct : GPBMessage -/// Unordered map of dynamically typed values. +/** Unordered map of dynamically typed values. */ @property(nonatomic, readwrite, strong, null_resettable) NSMutableDictionary *fields; -/// The number of items in @c fields without causing the array to be created. +/** The number of items in @c fields without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger fields_Count; @end @@ -108,46 +118,54 @@ typedef GPB_ENUM(GPBValue_Kind_OneOfCase) { GPBValue_Kind_OneOfCase_ListValue = 6, }; -/// `Value` represents a dynamically typed value which can be either -/// null, a number, a string, a boolean, a recursive struct value, or a -/// list of values. A producer of value is expected to set one of that -/// variants, absence of any variant indicates an error. -/// -/// The JSON representation for `Value` is JSON value. +/** + * `Value` represents a dynamically typed value which can be either + * null, a number, a string, a boolean, a recursive struct value, or a + * list of values. A producer of value is expected to set one of that + * variants, absence of any variant indicates an error. + * + * The JSON representation for `Value` is JSON value. + **/ @interface GPBValue : GPBMessage -/// The kind of value. +/** The kind of value. */ @property(nonatomic, readonly) GPBValue_Kind_OneOfCase kindOneOfCase; -/// Represents a null value. +/** Represents a null value. */ @property(nonatomic, readwrite) GPBNullValue nullValue; -/// Represents a double value. +/** Represents a double value. */ @property(nonatomic, readwrite) double numberValue; -/// Represents a string value. +/** Represents a string value. */ @property(nonatomic, readwrite, copy, null_resettable) NSString *stringValue; -/// Represents a boolean value. +/** Represents a boolean value. */ @property(nonatomic, readwrite) BOOL boolValue; -/// Represents a structured value. +/** Represents a structured value. */ @property(nonatomic, readwrite, strong, null_resettable) GPBStruct *structValue; -/// Represents a repeated `Value`. +/** Represents a repeated `Value`. */ @property(nonatomic, readwrite, strong, null_resettable) GPBListValue *listValue; @end -/// Fetches the raw value of a @c GPBValue's @c nullValue property, even -/// if the value was not defined by the enum at the time the code was generated. +/** + * Fetches the raw value of a @c GPBValue's @c nullValue property, even + * if the value was not defined by the enum at the time the code was generated. + **/ int32_t GPBValue_NullValue_RawValue(GPBValue *message); -/// Sets the raw value of an @c GPBValue's @c nullValue property, allowing -/// it to be set to a value that was not defined by the enum at the time the code -/// was generated. +/** + * Sets the raw value of an @c GPBValue's @c nullValue property, allowing + * it to be set to a value that was not defined by the enum at the time the code + * was generated. + **/ void SetGPBValue_NullValue_RawValue(GPBValue *message, int32_t value); -/// Clears whatever value was set for the oneof 'kind'. +/** + * Clears whatever value was set for the oneof 'kind'. + **/ void GPBValue_ClearKindOneOfCase(GPBValue *message); #pragma mark - GPBListValue @@ -156,14 +174,16 @@ typedef GPB_ENUM(GPBListValue_FieldNumber) { GPBListValue_FieldNumber_ValuesArray = 1, }; -/// `ListValue` is a wrapper around a repeated field of values. -/// -/// The JSON representation for `ListValue` is JSON array. +/** + * `ListValue` is a wrapper around a repeated field of values. + * + * The JSON representation for `ListValue` is JSON array. + **/ @interface GPBListValue : GPBMessage -/// Repeated field of dynamically typed values. +/** Repeated field of dynamically typed values. */ @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *valuesArray; -/// The number of items in @c valuesArray without causing the array to be created. +/** The number of items in @c valuesArray without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger valuesArray_Count; @end diff --git a/objectivec/google/protobuf/Timestamp.pbobjc.h b/objectivec/google/protobuf/Timestamp.pbobjc.h index d15de7c7..352c260b 100644 --- a/objectivec/google/protobuf/Timestamp.pbobjc.h +++ b/objectivec/google/protobuf/Timestamp.pbobjc.h @@ -28,14 +28,16 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - GPBTimestampRoot -/// Exposes the extension registry for this file. -/// -/// The base class provides: -/// @code -/// + (GPBExtensionRegistry *)extensionRegistry; -/// @endcode -/// which is a @c GPBExtensionRegistry that includes all the extensions defined by -/// this file and all files that it depends on. +/** + * Exposes the extension registry for this file. + * + * The base class provides: + * @code + * + (GPBExtensionRegistry *)extensionRegistry; + * @endcode + * which is a @c GPBExtensionRegistry that includes all the extensions defined by + * this file and all files that it depends on. + **/ @interface GPBTimestampRoot : GPBRootObject @end @@ -46,70 +48,76 @@ typedef GPB_ENUM(GPBTimestamp_FieldNumber) { GPBTimestamp_FieldNumber_Nanos = 2, }; -/// A Timestamp represents a point in time independent of any time zone -/// or calendar, represented as seconds and fractions of seconds at -/// nanosecond resolution in UTC Epoch time. It is encoded using the -/// Proleptic Gregorian Calendar which extends the Gregorian calendar -/// backwards to year one. It is encoded assuming all minutes are 60 -/// seconds long, i.e. leap seconds are "smeared" so that no leap second -/// table is needed for interpretation. Range is from -/// 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. -/// By restricting to that range, we ensure that we can convert to -/// and from RFC 3339 date strings. -/// See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). -/// -/// Example 1: Compute Timestamp from POSIX `time()`. -/// -/// Timestamp timestamp; -/// timestamp.set_seconds(time(NULL)); -/// timestamp.set_nanos(0); -/// -/// Example 2: Compute Timestamp from POSIX `gettimeofday()`. -/// -/// struct timeval tv; -/// gettimeofday(&tv, NULL); -/// -/// Timestamp timestamp; -/// timestamp.set_seconds(tv.tv_sec); -/// timestamp.set_nanos(tv.tv_usec * 1000); -/// -/// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. -/// -/// FILETIME ft; -/// GetSystemTimeAsFileTime(&ft); -/// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; -/// -/// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z -/// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. -/// Timestamp timestamp; -/// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); -/// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); -/// -/// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. -/// -/// long millis = System.currentTimeMillis(); -/// -/// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) -/// .setNanos((int) ((millis % 1000) * 1000000)).build(); -/// -/// -/// Example 5: Compute Timestamp from current time in Python. -/// -/// now = time.time() -/// seconds = int(now) -/// nanos = int((now - seconds) * 10**9) -/// timestamp = Timestamp(seconds=seconds, nanos=nanos) +/** + * A Timestamp represents a point in time independent of any time zone + * or calendar, represented as seconds and fractions of seconds at + * nanosecond resolution in UTC Epoch time. It is encoded using the + * Proleptic Gregorian Calendar which extends the Gregorian calendar + * backwards to year one. It is encoded assuming all minutes are 60 + * seconds long, i.e. leap seconds are "smeared" so that no leap second + * table is needed for interpretation. Range is from + * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. + * By restricting to that range, we ensure that we can convert to + * and from RFC 3339 date strings. + * See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * + * Example 5: Compute Timestamp from current time in Python. + * + * now = time.time() + * seconds = int(now) + * nanos = int((now - seconds) * 10**9) + * timestamp = Timestamp(seconds=seconds, nanos=nanos) + **/ @interface GPBTimestamp : GPBMessage -/// Represents seconds of UTC time since Unix epoch -/// 1970-01-01T00:00:00Z. Must be from from 0001-01-01T00:00:00Z to -/// 9999-12-31T23:59:59Z inclusive. +/** + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + **/ @property(nonatomic, readwrite) int64_t seconds; -/// Non-negative fractions of a second at nanosecond resolution. Negative -/// second values with fractions must still have non-negative nanos values -/// that count forward in time. Must be from 0 to 999,999,999 -/// inclusive. +/** + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + **/ @property(nonatomic, readwrite) int32_t nanos; @end diff --git a/objectivec/google/protobuf/Type.pbobjc.h b/objectivec/google/protobuf/Type.pbobjc.h index 93ee3cec..05411958 100644 --- a/objectivec/google/protobuf/Type.pbobjc.h +++ b/objectivec/google/protobuf/Type.pbobjc.h @@ -34,134 +34,148 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - Enum GPBSyntax -/// The syntax in which a protocol buffer element is defined. +/** The syntax in which a protocol buffer element is defined. */ typedef GPB_ENUM(GPBSyntax) { - /// Value used if any message's field encounters a value that is not defined - /// by this enum. The message will also have C functions to get/set the rawValue - /// of the field. + /** + * Value used if any message's field encounters a value that is not defined + * by this enum. The message will also have C functions to get/set the rawValue + * of the field. + **/ GPBSyntax_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, - /// Syntax `proto2`. + /** Syntax `proto2`. */ GPBSyntax_SyntaxProto2 = 0, - /// Syntax `proto3`. + /** Syntax `proto3`. */ GPBSyntax_SyntaxProto3 = 1, }; GPBEnumDescriptor *GPBSyntax_EnumDescriptor(void); -/// Checks to see if the given value is defined by the enum or was not known at -/// the time this source was generated. +/** + * Checks to see if the given value is defined by the enum or was not known at + * the time this source was generated. + **/ BOOL GPBSyntax_IsValidValue(int32_t value); #pragma mark - Enum GPBField_Kind -/// Basic field types. +/** Basic field types. */ typedef GPB_ENUM(GPBField_Kind) { - /// Value used if any message's field encounters a value that is not defined - /// by this enum. The message will also have C functions to get/set the rawValue - /// of the field. + /** + * Value used if any message's field encounters a value that is not defined + * by this enum. The message will also have C functions to get/set the rawValue + * of the field. + **/ GPBField_Kind_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, - /// Field type unknown. + /** Field type unknown. */ GPBField_Kind_TypeUnknown = 0, - /// Field type double. + /** Field type double. */ GPBField_Kind_TypeDouble = 1, - /// Field type float. + /** Field type float. */ GPBField_Kind_TypeFloat = 2, - /// Field type int64. + /** Field type int64. */ GPBField_Kind_TypeInt64 = 3, - /// Field type uint64. + /** Field type uint64. */ GPBField_Kind_TypeUint64 = 4, - /// Field type int32. + /** Field type int32. */ GPBField_Kind_TypeInt32 = 5, - /// Field type fixed64. + /** Field type fixed64. */ GPBField_Kind_TypeFixed64 = 6, - /// Field type fixed32. + /** Field type fixed32. */ GPBField_Kind_TypeFixed32 = 7, - /// Field type bool. + /** Field type bool. */ GPBField_Kind_TypeBool = 8, - /// Field type string. + /** Field type string. */ GPBField_Kind_TypeString = 9, - /// Field type group. Proto2 syntax only, and deprecated. + /** Field type group. Proto2 syntax only, and deprecated. */ GPBField_Kind_TypeGroup = 10, - /// Field type message. + /** Field type message. */ GPBField_Kind_TypeMessage = 11, - /// Field type bytes. + /** Field type bytes. */ GPBField_Kind_TypeBytes = 12, - /// Field type uint32. + /** Field type uint32. */ GPBField_Kind_TypeUint32 = 13, - /// Field type enum. + /** Field type enum. */ GPBField_Kind_TypeEnum = 14, - /// Field type sfixed32. + /** Field type sfixed32. */ GPBField_Kind_TypeSfixed32 = 15, - /// Field type sfixed64. + /** Field type sfixed64. */ GPBField_Kind_TypeSfixed64 = 16, - /// Field type sint32. + /** Field type sint32. */ GPBField_Kind_TypeSint32 = 17, - /// Field type sint64. + /** Field type sint64. */ GPBField_Kind_TypeSint64 = 18, }; GPBEnumDescriptor *GPBField_Kind_EnumDescriptor(void); -/// Checks to see if the given value is defined by the enum or was not known at -/// the time this source was generated. +/** + * Checks to see if the given value is defined by the enum or was not known at + * the time this source was generated. + **/ BOOL GPBField_Kind_IsValidValue(int32_t value); #pragma mark - Enum GPBField_Cardinality -/// Whether a field is optional, required, or repeated. +/** Whether a field is optional, required, or repeated. */ typedef GPB_ENUM(GPBField_Cardinality) { - /// Value used if any message's field encounters a value that is not defined - /// by this enum. The message will also have C functions to get/set the rawValue - /// of the field. + /** + * Value used if any message's field encounters a value that is not defined + * by this enum. The message will also have C functions to get/set the rawValue + * of the field. + **/ GPBField_Cardinality_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, - /// For fields with unknown cardinality. + /** For fields with unknown cardinality. */ GPBField_Cardinality_CardinalityUnknown = 0, - /// For optional fields. + /** For optional fields. */ GPBField_Cardinality_CardinalityOptional = 1, - /// For required fields. Proto2 syntax only. + /** For required fields. Proto2 syntax only. */ GPBField_Cardinality_CardinalityRequired = 2, - /// For repeated fields. + /** For repeated fields. */ GPBField_Cardinality_CardinalityRepeated = 3, }; GPBEnumDescriptor *GPBField_Cardinality_EnumDescriptor(void); -/// Checks to see if the given value is defined by the enum or was not known at -/// the time this source was generated. +/** + * Checks to see if the given value is defined by the enum or was not known at + * the time this source was generated. + **/ BOOL GPBField_Cardinality_IsValidValue(int32_t value); #pragma mark - GPBTypeRoot -/// Exposes the extension registry for this file. -/// -/// The base class provides: -/// @code -/// + (GPBExtensionRegistry *)extensionRegistry; -/// @endcode -/// which is a @c GPBExtensionRegistry that includes all the extensions defined by -/// this file and all files that it depends on. +/** + * Exposes the extension registry for this file. + * + * The base class provides: + * @code + * + (GPBExtensionRegistry *)extensionRegistry; + * @endcode + * which is a @c GPBExtensionRegistry that includes all the extensions defined by + * this file and all files that it depends on. + **/ @interface GPBTypeRoot : GPBRootObject @end @@ -176,43 +190,49 @@ typedef GPB_ENUM(GPBType_FieldNumber) { GPBType_FieldNumber_Syntax = 6, }; -/// A protocol buffer message type. +/** + * A protocol buffer message type. + **/ @interface GPBType : GPBMessage -/// The fully qualified message name. +/** The fully qualified message name. */ @property(nonatomic, readwrite, copy, null_resettable) NSString *name; -/// The list of fields. +/** The list of fields. */ @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *fieldsArray; -/// The number of items in @c fieldsArray without causing the array to be created. +/** The number of items in @c fieldsArray without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger fieldsArray_Count; -/// The list of types appearing in `oneof` definitions in this type. +/** The list of types appearing in `oneof` definitions in this type. */ @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *oneofsArray; -/// The number of items in @c oneofsArray without causing the array to be created. +/** The number of items in @c oneofsArray without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger oneofsArray_Count; -/// The protocol buffer options. +/** The protocol buffer options. */ @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *optionsArray; -/// The number of items in @c optionsArray without causing the array to be created. +/** The number of items in @c optionsArray without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger optionsArray_Count; -/// The source context. +/** The source context. */ @property(nonatomic, readwrite, strong, null_resettable) GPBSourceContext *sourceContext; -/// Test to see if @c sourceContext has been set. +/** Test to see if @c sourceContext has been set. */ @property(nonatomic, readwrite) BOOL hasSourceContext; -/// The source syntax. +/** The source syntax. */ @property(nonatomic, readwrite) GPBSyntax syntax; @end -/// Fetches the raw value of a @c GPBType's @c syntax property, even -/// if the value was not defined by the enum at the time the code was generated. +/** + * Fetches the raw value of a @c GPBType's @c syntax property, even + * if the value was not defined by the enum at the time the code was generated. + **/ int32_t GPBType_Syntax_RawValue(GPBType *message); -/// Sets the raw value of an @c GPBType's @c syntax property, allowing -/// it to be set to a value that was not defined by the enum at the time the code -/// was generated. +/** + * Sets the raw value of an @c GPBType's @c syntax property, allowing + * it to be set to a value that was not defined by the enum at the time the code + * was generated. + **/ void SetGPBType_Syntax_RawValue(GPBType *message, int32_t value); #pragma mark - GPBField @@ -230,59 +250,73 @@ typedef GPB_ENUM(GPBField_FieldNumber) { GPBField_FieldNumber_DefaultValue = 11, }; -/// A single field of a message type. +/** + * A single field of a message type. + **/ @interface GPBField : GPBMessage -/// The field type. +/** The field type. */ @property(nonatomic, readwrite) GPBField_Kind kind; -/// The field cardinality. +/** The field cardinality. */ @property(nonatomic, readwrite) GPBField_Cardinality cardinality; -/// The field number. +/** The field number. */ @property(nonatomic, readwrite) int32_t number; -/// The field name. +/** The field name. */ @property(nonatomic, readwrite, copy, null_resettable) NSString *name; -/// The field type URL, without the scheme, for message or enumeration -/// types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. +/** + * The field type URL, without the scheme, for message or enumeration + * types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + **/ @property(nonatomic, readwrite, copy, null_resettable) NSString *typeURL; -/// The index of the field type in `Type.oneofs`, for message or enumeration -/// types. The first type has index 1; zero means the type is not in the list. +/** + * The index of the field type in `Type.oneofs`, for message or enumeration + * types. The first type has index 1; zero means the type is not in the list. + **/ @property(nonatomic, readwrite) int32_t oneofIndex; -/// Whether to use alternative packed wire representation. +/** Whether to use alternative packed wire representation. */ @property(nonatomic, readwrite) BOOL packed; -/// The protocol buffer options. +/** The protocol buffer options. */ @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *optionsArray; -/// The number of items in @c optionsArray without causing the array to be created. +/** The number of items in @c optionsArray without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger optionsArray_Count; -/// The field JSON name. +/** The field JSON name. */ @property(nonatomic, readwrite, copy, null_resettable) NSString *jsonName; -/// The string value of the default value of this field. Proto2 syntax only. +/** The string value of the default value of this field. Proto2 syntax only. */ @property(nonatomic, readwrite, copy, null_resettable) NSString *defaultValue; @end -/// Fetches the raw value of a @c GPBField's @c kind property, even -/// if the value was not defined by the enum at the time the code was generated. +/** + * Fetches the raw value of a @c GPBField's @c kind property, even + * if the value was not defined by the enum at the time the code was generated. + **/ int32_t GPBField_Kind_RawValue(GPBField *message); -/// Sets the raw value of an @c GPBField's @c kind property, allowing -/// it to be set to a value that was not defined by the enum at the time the code -/// was generated. +/** + * Sets the raw value of an @c GPBField's @c kind property, allowing + * it to be set to a value that was not defined by the enum at the time the code + * was generated. + **/ void SetGPBField_Kind_RawValue(GPBField *message, int32_t value); -/// Fetches the raw value of a @c GPBField's @c cardinality property, even -/// if the value was not defined by the enum at the time the code was generated. +/** + * Fetches the raw value of a @c GPBField's @c cardinality property, even + * if the value was not defined by the enum at the time the code was generated. + **/ int32_t GPBField_Cardinality_RawValue(GPBField *message); -/// Sets the raw value of an @c GPBField's @c cardinality property, allowing -/// it to be set to a value that was not defined by the enum at the time the code -/// was generated. +/** + * Sets the raw value of an @c GPBField's @c cardinality property, allowing + * it to be set to a value that was not defined by the enum at the time the code + * was generated. + **/ void SetGPBField_Cardinality_RawValue(GPBField *message, int32_t value); #pragma mark - GPBEnum @@ -295,38 +329,44 @@ typedef GPB_ENUM(GPBEnum_FieldNumber) { GPBEnum_FieldNumber_Syntax = 5, }; -/// Enum type definition. +/** + * Enum type definition. + **/ @interface GPBEnum : GPBMessage -/// Enum type name. +/** Enum type name. */ @property(nonatomic, readwrite, copy, null_resettable) NSString *name; -/// Enum value definitions. +/** Enum value definitions. */ @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *enumvalueArray; -/// The number of items in @c enumvalueArray without causing the array to be created. +/** The number of items in @c enumvalueArray without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger enumvalueArray_Count; -/// Protocol buffer options. +/** Protocol buffer options. */ @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *optionsArray; -/// The number of items in @c optionsArray without causing the array to be created. +/** The number of items in @c optionsArray without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger optionsArray_Count; -/// The source context. +/** The source context. */ @property(nonatomic, readwrite, strong, null_resettable) GPBSourceContext *sourceContext; -/// Test to see if @c sourceContext has been set. +/** Test to see if @c sourceContext has been set. */ @property(nonatomic, readwrite) BOOL hasSourceContext; -/// The source syntax. +/** The source syntax. */ @property(nonatomic, readwrite) GPBSyntax syntax; @end -/// Fetches the raw value of a @c GPBEnum's @c syntax property, even -/// if the value was not defined by the enum at the time the code was generated. +/** + * Fetches the raw value of a @c GPBEnum's @c syntax property, even + * if the value was not defined by the enum at the time the code was generated. + **/ int32_t GPBEnum_Syntax_RawValue(GPBEnum *message); -/// Sets the raw value of an @c GPBEnum's @c syntax property, allowing -/// it to be set to a value that was not defined by the enum at the time the code -/// was generated. +/** + * Sets the raw value of an @c GPBEnum's @c syntax property, allowing + * it to be set to a value that was not defined by the enum at the time the code + * was generated. + **/ void SetGPBEnum_Syntax_RawValue(GPBEnum *message, int32_t value); #pragma mark - GPBEnumValue @@ -337,18 +377,20 @@ typedef GPB_ENUM(GPBEnumValue_FieldNumber) { GPBEnumValue_FieldNumber_OptionsArray = 3, }; -/// Enum value definition. +/** + * Enum value definition. + **/ @interface GPBEnumValue : GPBMessage -/// Enum value name. +/** Enum value name. */ @property(nonatomic, readwrite, copy, null_resettable) NSString *name; -/// Enum value number. +/** Enum value number. */ @property(nonatomic, readwrite) int32_t number; -/// Protocol buffer options. +/** Protocol buffer options. */ @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *optionsArray; -/// The number of items in @c optionsArray without causing the array to be created. +/** The number of items in @c optionsArray without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger optionsArray_Count; @end @@ -360,16 +402,18 @@ typedef GPB_ENUM(GPBOption_FieldNumber) { GPBOption_FieldNumber_Value = 2, }; -/// A protocol buffer option, which can be attached to a message, field, -/// enumeration, etc. +/** + * A protocol buffer option, which can be attached to a message, field, + * enumeration, etc. + **/ @interface GPBOption : GPBMessage -/// The option's name. For example, `"java_package"`. +/** The option's name. For example, `"java_package"`. */ @property(nonatomic, readwrite, copy, null_resettable) NSString *name; -/// The option's value. For example, `"com.google.protobuf"`. +/** The option's value. For example, `"com.google.protobuf"`. */ @property(nonatomic, readwrite, strong, null_resettable) GPBAny *value; -/// Test to see if @c value has been set. +/** Test to see if @c value has been set. */ @property(nonatomic, readwrite) BOOL hasValue; @end diff --git a/objectivec/google/protobuf/Wrappers.pbobjc.h b/objectivec/google/protobuf/Wrappers.pbobjc.h index 5593d348..fc7d5abe 100644 --- a/objectivec/google/protobuf/Wrappers.pbobjc.h +++ b/objectivec/google/protobuf/Wrappers.pbobjc.h @@ -28,14 +28,16 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - GPBWrappersRoot -/// Exposes the extension registry for this file. -/// -/// The base class provides: -/// @code -/// + (GPBExtensionRegistry *)extensionRegistry; -/// @endcode -/// which is a @c GPBExtensionRegistry that includes all the extensions defined by -/// this file and all files that it depends on. +/** + * Exposes the extension registry for this file. + * + * The base class provides: + * @code + * + (GPBExtensionRegistry *)extensionRegistry; + * @endcode + * which is a @c GPBExtensionRegistry that includes all the extensions defined by + * this file and all files that it depends on. + **/ @interface GPBWrappersRoot : GPBRootObject @end @@ -45,12 +47,14 @@ typedef GPB_ENUM(GPBDoubleValue_FieldNumber) { GPBDoubleValue_FieldNumber_Value = 1, }; -/// Wrapper message for `double`. -/// -/// The JSON representation for `DoubleValue` is JSON number. +/** + * Wrapper message for `double`. + * + * The JSON representation for `DoubleValue` is JSON number. + **/ @interface GPBDoubleValue : GPBMessage -/// The double value. +/** The double value. */ @property(nonatomic, readwrite) double value; @end @@ -61,12 +65,14 @@ typedef GPB_ENUM(GPBFloatValue_FieldNumber) { GPBFloatValue_FieldNumber_Value = 1, }; -/// Wrapper message for `float`. -/// -/// The JSON representation for `FloatValue` is JSON number. +/** + * Wrapper message for `float`. + * + * The JSON representation for `FloatValue` is JSON number. + **/ @interface GPBFloatValue : GPBMessage -/// The float value. +/** The float value. */ @property(nonatomic, readwrite) float value; @end @@ -77,12 +83,14 @@ typedef GPB_ENUM(GPBInt64Value_FieldNumber) { GPBInt64Value_FieldNumber_Value = 1, }; -/// Wrapper message for `int64`. -/// -/// The JSON representation for `Int64Value` is JSON string. +/** + * Wrapper message for `int64`. + * + * The JSON representation for `Int64Value` is JSON string. + **/ @interface GPBInt64Value : GPBMessage -/// The int64 value. +/** The int64 value. */ @property(nonatomic, readwrite) int64_t value; @end @@ -93,12 +101,14 @@ typedef GPB_ENUM(GPBUInt64Value_FieldNumber) { GPBUInt64Value_FieldNumber_Value = 1, }; -/// Wrapper message for `uint64`. -/// -/// The JSON representation for `UInt64Value` is JSON string. +/** + * Wrapper message for `uint64`. + * + * The JSON representation for `UInt64Value` is JSON string. + **/ @interface GPBUInt64Value : GPBMessage -/// The uint64 value. +/** The uint64 value. */ @property(nonatomic, readwrite) uint64_t value; @end @@ -109,12 +119,14 @@ typedef GPB_ENUM(GPBInt32Value_FieldNumber) { GPBInt32Value_FieldNumber_Value = 1, }; -/// Wrapper message for `int32`. -/// -/// The JSON representation for `Int32Value` is JSON number. +/** + * Wrapper message for `int32`. + * + * The JSON representation for `Int32Value` is JSON number. + **/ @interface GPBInt32Value : GPBMessage -/// The int32 value. +/** The int32 value. */ @property(nonatomic, readwrite) int32_t value; @end @@ -125,12 +137,14 @@ typedef GPB_ENUM(GPBUInt32Value_FieldNumber) { GPBUInt32Value_FieldNumber_Value = 1, }; -/// Wrapper message for `uint32`. -/// -/// The JSON representation for `UInt32Value` is JSON number. +/** + * Wrapper message for `uint32`. + * + * The JSON representation for `UInt32Value` is JSON number. + **/ @interface GPBUInt32Value : GPBMessage -/// The uint32 value. +/** The uint32 value. */ @property(nonatomic, readwrite) uint32_t value; @end @@ -141,12 +155,14 @@ typedef GPB_ENUM(GPBBoolValue_FieldNumber) { GPBBoolValue_FieldNumber_Value = 1, }; -/// Wrapper message for `bool`. -/// -/// The JSON representation for `BoolValue` is JSON `true` and `false`. +/** + * Wrapper message for `bool`. + * + * The JSON representation for `BoolValue` is JSON `true` and `false`. + **/ @interface GPBBoolValue : GPBMessage -/// The bool value. +/** The bool value. */ @property(nonatomic, readwrite) BOOL value; @end @@ -157,12 +173,14 @@ typedef GPB_ENUM(GPBStringValue_FieldNumber) { GPBStringValue_FieldNumber_Value = 1, }; -/// Wrapper message for `string`. -/// -/// The JSON representation for `StringValue` is JSON string. +/** + * Wrapper message for `string`. + * + * The JSON representation for `StringValue` is JSON string. + **/ @interface GPBStringValue : GPBMessage -/// The string value. +/** The string value. */ @property(nonatomic, readwrite, copy, null_resettable) NSString *value; @end @@ -173,12 +191,14 @@ typedef GPB_ENUM(GPBBytesValue_FieldNumber) { GPBBytesValue_FieldNumber_Value = 1, }; -/// Wrapper message for `bytes`. -/// -/// The JSON representation for `BytesValue` is JSON string. +/** + * Wrapper message for `bytes`. + * + * The JSON representation for `BytesValue` is JSON string. + **/ @interface GPBBytesValue : GPBMessage -/// The bytes value. +/** The bytes value. */ @property(nonatomic, readwrite, copy, null_resettable) NSData *value; @end diff --git a/src/google/protobuf/compiler/objectivec/objectivec_enum.cc b/src/google/protobuf/compiler/objectivec/objectivec_enum.cc index e76f8e99..34e17823 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_enum.cc +++ b/src/google/protobuf/compiler/objectivec/objectivec_enum.cc @@ -62,7 +62,7 @@ void EnumGenerator::GenerateHeader(io::Printer* printer) { string enum_comments; SourceLocation location; if (descriptor_->GetSourceLocation(&location)) { - enum_comments = BuildCommentsString(location); + enum_comments = BuildCommentsString(location, true); } else { enum_comments = ""; } @@ -81,16 +81,18 @@ void EnumGenerator::GenerateHeader(io::Printer* printer) { if (HasPreservingUnknownEnumSemantics(descriptor_->file())) { // Include the unknown value. printer->Print( - "/// Value used if any message's field encounters a value that is not defined\n" - "/// by this enum. The message will also have C functions to get/set the rawValue\n" - "/// of the field.\n" + "/**\n" + " * Value used if any message's field encounters a value that is not defined\n" + " * by this enum. The message will also have C functions to get/set the rawValue\n" + " * of the field.\n" + " **/\n" "$name$_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue,\n", "name", name_); } for (int i = 0; i < all_values_.size(); i++) { SourceLocation location; if (all_values_[i]->GetSourceLocation(&location)) { - string comments = BuildCommentsString(location).c_str(); + string comments = BuildCommentsString(location, true).c_str(); if (comments.length() > 0) { if (i > 0) { printer->Print("\n"); @@ -111,8 +113,10 @@ void EnumGenerator::GenerateHeader(io::Printer* printer) { "\n" "GPBEnumDescriptor *$name$_EnumDescriptor(void);\n" "\n" - "/// Checks to see if the given value is defined by the enum or was not known at\n" - "/// the time this source was generated.\n" + "/**\n" + " * Checks to see if the given value is defined by the enum or was not known at\n" + " * the time this source was generated.\n" + " **/\n" "BOOL $name$_IsValidValue(int32_t value);\n" "\n", "name", name_); diff --git a/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc b/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc index b63bc0de..7a774a09 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc +++ b/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc @@ -83,12 +83,16 @@ void EnumFieldGenerator::GenerateCFunctionDeclarations( printer->Print( variables_, - "/// Fetches the raw value of a @c $owning_message_class$'s @c $name$ property, even\n" - "/// if the value was not defined by the enum at the time the code was generated.\n" + "/**\n" + " * Fetches the raw value of a @c $owning_message_class$'s @c $name$ property, even\n" + " * if the value was not defined by the enum at the time the code was generated.\n" + " **/\n" "int32_t $owning_message_class$_$capitalized_name$_RawValue($owning_message_class$ *message);\n" - "/// Sets the raw value of an @c $owning_message_class$'s @c $name$ property, allowing\n" - "/// it to be set to a value that was not defined by the enum at the time the code\n" - "/// was generated.\n" + "/**\n" + " * Sets the raw value of an @c $owning_message_class$'s @c $name$ property, allowing\n" + " * it to be set to a value that was not defined by the enum at the time the code\n" + " * was generated.\n" + " **/\n" "void Set$owning_message_class$_$capitalized_name$_RawValue($owning_message_class$ *message, int32_t value);\n" "\n"); } diff --git a/src/google/protobuf/compiler/objectivec/objectivec_extension.cc b/src/google/protobuf/compiler/objectivec/objectivec_extension.cc index 3f7ab9d3..c0e7253a 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_extension.cc +++ b/src/google/protobuf/compiler/objectivec/objectivec_extension.cc @@ -63,7 +63,7 @@ void ExtensionGenerator::GenerateMembersHeader(io::Printer* printer) { vars["method_name"] = method_name_; SourceLocation location; if (descriptor_->GetSourceLocation(&location)) { - vars["comments"] = BuildCommentsString(location); + vars["comments"] = BuildCommentsString(location, true); } else { vars["comments"] = ""; } diff --git a/src/google/protobuf/compiler/objectivec/objectivec_field.cc b/src/google/protobuf/compiler/objectivec/objectivec_field.cc index 812b4a1c..d2a6e882 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_field.cc +++ b/src/google/protobuf/compiler/objectivec/objectivec_field.cc @@ -64,7 +64,7 @@ void SetCommonFieldVariables(const FieldDescriptor* descriptor, SourceLocation location; if (descriptor->GetSourceLocation(&location)) { - (*variables)["comments"] = BuildCommentsString(location); + (*variables)["comments"] = BuildCommentsString(location, true); } else { (*variables)["comments"] = "\n"; } @@ -335,7 +335,7 @@ void ObjCObjFieldGenerator::GeneratePropertyDeclaration( if (WantsHasProperty()) { printer->Print( variables_, - "/// Test to see if @c $name$ has been set.\n" + "/** Test to see if @c $name$ has been set. */\n" "@property(nonatomic, readwrite) BOOL has$capitalized_name$$deprecated_attribute$;\n"); } if (IsInitName(variables_.find("name")->second)) { @@ -387,7 +387,7 @@ void RepeatedFieldGenerator::GeneratePropertyDeclaration( "$comments$" "$array_comment$" "@property(nonatomic, readwrite, strong, null_resettable) $array_property_type$ *$name$$storage_attribute$$deprecated_attribute$;\n" - "/// The number of items in @c $name$ without causing the array to be created.\n" + "/** The number of items in @c $name$ without causing the array to be created. */\n" "@property(nonatomic, readonly) NSUInteger $name$_Count$deprecated_attribute$;\n"); if (IsInitName(variables_.find("name")->second)) { // If property name starts with init we need to annotate it to get past ARC. diff --git a/src/google/protobuf/compiler/objectivec/objectivec_file.cc b/src/google/protobuf/compiler/objectivec/objectivec_file.cc index b864ef12..438f4113 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_file.cc +++ b/src/google/protobuf/compiler/objectivec/objectivec_file.cc @@ -357,14 +357,16 @@ void FileGenerator::GenerateHeader(io::Printer *printer) { printer->Print( "#pragma mark - $root_class_name$\n" "\n" - "/// Exposes the extension registry for this file.\n" - "///\n" - "/// The base class provides:\n" - "/// @code\n" - "/// + (GPBExtensionRegistry *)extensionRegistry;\n" - "/// @endcode\n" - "/// which is a @c GPBExtensionRegistry that includes all the extensions defined by\n" - "/// this file and all files that it depends on.\n" + "/**\n" + " * Exposes the extension registry for this file.\n" + " *\n" + " * The base class provides:\n" + " * @code\n" + " * + (GPBExtensionRegistry *)extensionRegistry;\n" + " * @endcode\n" + " * which is a @c GPBExtensionRegistry that includes all the extensions defined by\n" + " * this file and all files that it depends on.\n" + " **/\n" "@interface $root_class_name$ : GPBRootObject\n" "@end\n" "\n", diff --git a/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc b/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc index 22c7a883..28b3f5ae 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc +++ b/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc @@ -830,7 +830,8 @@ string BuildFlagsString(const vector& strings) { return string; } -string BuildCommentsString(const SourceLocation& location) { +string BuildCommentsString(const SourceLocation& location, + bool prefer_single_line) { const string& comments = location.leading_comments.empty() ? location.trailing_comments : location.leading_comments; @@ -839,15 +840,37 @@ string BuildCommentsString(const SourceLocation& location) { while (!lines.empty() && lines.back().empty()) { lines.pop_back(); } - string prefix("///"); - string suffix("\n"); + // If there are no comments, just return an empty string. + if (lines.size() == 0) { + return ""; + } + + string prefix; + string suffix; string final_comments; - for (int i = 0; i < lines.size(); i++) { - // HeaderDoc uses '\' and '@' for markers; escape them. - const string line = StringReplace(lines[i], "\\", "\\\\", true); - final_comments += - prefix + StringReplace(line, "@", "\\@", true) + suffix; + string epilogue; + + if (prefer_single_line && lines.size() == 1) { + prefix = "/** "; + suffix = " */\n"; + } else { + prefix = " * "; + suffix = "\n"; + final_comments += "/**\n"; + epilogue = " **/\n"; } + + for (int i = 0; i < lines.size(); i++) { + string line = StripPrefixString(lines[i], " "); + // HeaderDoc and appledoc use '\' and '@' for markers; escape them. + line = StringReplace(line, "\\", "\\\\", true); + line = StringReplace(line, "@", "\\@", true); + // Decouple / from * to not have inline comments inside comments. + line = StringReplace(line, "/*", "/\\*", true); + line = StringReplace(line, "*/", "*\\/", true); + final_comments += prefix + line + suffix; + } + final_comments += epilogue; return final_comments; } diff --git a/src/google/protobuf/compiler/objectivec/objectivec_helpers.h b/src/google/protobuf/compiler/objectivec/objectivec_helpers.h index 7aae0fd2..c96d5ea5 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_helpers.h +++ b/src/google/protobuf/compiler/objectivec/objectivec_helpers.h @@ -172,8 +172,10 @@ bool HasNonZeroDefaultValue(const FieldDescriptor* field); string BuildFlagsString(const vector& strings); -// Builds a HeaderDoc style comment out of the comments in the .proto file. -string BuildCommentsString(const SourceLocation& location); +// Builds HeaderDoc/appledoc style comments out of the comments in the .proto +// file. +string BuildCommentsString(const SourceLocation& location, + bool prefer_single_line); // The name the commonly used by the library when built as a framework. // This lines up to the name used in the CocoaPod. diff --git a/src/google/protobuf/compiler/objectivec/objectivec_message.cc b/src/google/protobuf/compiler/objectivec/objectivec_message.cc index e1a78619..822da893 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_message.cc +++ b/src/google/protobuf/compiler/objectivec/objectivec_message.cc @@ -331,7 +331,7 @@ void MessageGenerator::GenerateMessageHeader(io::Printer* printer) { string message_comments; SourceLocation location; if (descriptor_->GetSourceLocation(&location)) { - message_comments = BuildCommentsString(location); + message_comments = BuildCommentsString(location, false); } else { message_comments = ""; } diff --git a/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc b/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc index 3dda903b..5531ae24 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc +++ b/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc @@ -53,7 +53,7 @@ OneofGenerator::OneofGenerator(const OneofDescriptor* descriptor) string comments; SourceLocation location; if (descriptor_->GetSourceLocation(&location)) { - comments = BuildCommentsString(location); + comments = BuildCommentsString(location, true); } else { comments = ""; } @@ -104,7 +104,9 @@ void OneofGenerator::GeneratePublicCasePropertyDeclaration( void OneofGenerator::GenerateClearFunctionDeclaration(io::Printer* printer) { printer->Print( variables_, - "/// Clears whatever value was set for the oneof '$name$'.\n" + "/**\n" + " * Clears whatever value was set for the oneof '$name$'.\n" + " **/\n" "void $owning_message_class$_Clear$capitalized_name$OneOfCase($owning_message_class$ *message);\n"); } -- cgit v1.2.3 From 62f2ff86b58f4d8d82516812a4b20429ad255ab2 Mon Sep 17 00:00:00 2001 From: Sergio Campamá Date: Fri, 12 Aug 2016 11:44:03 -0700 Subject: Fixes extra whitespace on generated comments. (#1950) Fixes extra whitespace on generated comments. --- objectivec/GPBExtensionRegistry.h | 2 +- objectivec/google/protobuf/Any.pbobjc.h | 34 ++++---- objectivec/google/protobuf/Api.pbobjc.h | 36 ++++---- objectivec/google/protobuf/Duration.pbobjc.h | 16 ++-- objectivec/google/protobuf/Empty.pbobjc.h | 4 +- objectivec/google/protobuf/FieldMask.pbobjc.h | 96 +++++++++++----------- objectivec/google/protobuf/Struct.pbobjc.h | 8 +- objectivec/google/protobuf/Timestamp.pbobjc.h | 28 +++---- objectivec/google/protobuf/Wrappers.pbobjc.h | 18 ++-- .../compiler/objectivec/objectivec_helpers.cc | 12 ++- 10 files changed, 131 insertions(+), 123 deletions(-) (limited to 'src') diff --git a/objectivec/GPBExtensionRegistry.h b/objectivec/GPBExtensionRegistry.h index b395db17..d79632d2 100644 --- a/objectivec/GPBExtensionRegistry.h +++ b/objectivec/GPBExtensionRegistry.h @@ -77,7 +77,7 @@ NS_ASSUME_NONNULL_BEGIN * @param descriptor The descriptor to look for a registered extension on. * @param fieldNumber The field number of the extension to look for. * - * @return The registered GPBExtensionDescripto or nil if none was found. + * @return The registered GPBExtensionDescriptor or nil if none was found. **/ - (nullable GPBExtensionDescriptor *)extensionForDescriptor:(GPBDescriptor *)descriptor fieldNumber:(NSInteger)fieldNumber; diff --git a/objectivec/google/protobuf/Any.pbobjc.h b/objectivec/google/protobuf/Any.pbobjc.h index 940206b6..842052fe 100644 --- a/objectivec/google/protobuf/Any.pbobjc.h +++ b/objectivec/google/protobuf/Any.pbobjc.h @@ -51,12 +51,12 @@ typedef GPB_ENUM(GPBAny_FieldNumber) { /** * `Any` contains an arbitrary serialized protocol buffer message along with a * URL that describes the type of the serialized message. - * + * * Protobuf library provides support to pack/unpack Any values in the form * of utility functions or additional generated methods of the Any type. - * + * * Example 1: Pack and unpack a message in C++. - * + * * Foo foo = ...; * Any any; * any.PackFrom(foo); @@ -64,18 +64,18 @@ typedef GPB_ENUM(GPBAny_FieldNumber) { * if (any.UnpackTo(&foo)) { * ... * } - * + * * Example 2: Pack and unpack a message in Java. - * + * * Foo foo = ...; * Any any = Any.pack(foo); * ... * if (any.is(Foo.class)) { * foo = any.unpack(Foo.class); * } - * + * * Example 3: Pack and unpack a message in Python. - * + * * foo = Foo(...) * any = Any() * any.Pack(foo) @@ -83,37 +83,37 @@ typedef GPB_ENUM(GPBAny_FieldNumber) { * if any.Is(Foo.DESCRIPTOR): * any.Unpack(foo) * ... - * + * * The pack methods provided by protobuf library will by default use * 'type.googleapis.com/full.type.name' as the type URL and the unpack * methods only use the fully qualified type name after the last '/' * in the type URL, for example "foo.bar.com/x/y.z" will yield type * name "y.z". - * - * + * + * * JSON * ==== * The JSON representation of an `Any` value uses the regular * representation of the deserialized, embedded message, with an * additional field `\@type` which contains the type URL. Example: - * + * * package google.profile; * message Person { * string first_name = 1; * string last_name = 2; * } - * + * * { * "\@type": "type.googleapis.com/google.profile.Person", * "firstName": , * "lastName": * } - * + * * If the embedded message type is well-known and has a custom JSON * representation, that representation will be embedded adding a field * `value` which holds the custom JSON in addition to the `\@type` * field. Example (for message [google.protobuf.Duration][]): - * + * * { * "\@type": "type.googleapis.com/google.protobuf.Duration", * "value": "1.212s" @@ -124,10 +124,10 @@ typedef GPB_ENUM(GPBAny_FieldNumber) { /** * A URL/resource name whose content describes the type of the * serialized protocol buffer message. - * + * * For URLs which use the scheme `http`, `https`, or no scheme, the * following restrictions and interpretations apply: - * + * * * If no scheme is provided, `https` is assumed. * * The last segment of the URL's path must represent the fully * qualified name of the type (as in `path/google.protobuf.Duration`). @@ -140,7 +140,7 @@ typedef GPB_ENUM(GPBAny_FieldNumber) { * lookup. Therefore, binary compatibility needs to be preserved * on changes to types. (Use versioned type names to manage * breaking changes.) - * + * * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. **/ diff --git a/objectivec/google/protobuf/Api.pbobjc.h b/objectivec/google/protobuf/Api.pbobjc.h index 3dda7698..182e866c 100644 --- a/objectivec/google/protobuf/Api.pbobjc.h +++ b/objectivec/google/protobuf/Api.pbobjc.h @@ -88,14 +88,14 @@ typedef GPB_ENUM(GPBApi_FieldNumber) { * outlined below. If the field is not empty, the version in the * package name will be verified to be consistent with what is * provided here. - * + * * The versioning schema uses [semantic * versioning](http://semver.org) where the major version number * indicates a breaking change and the minor version an additive, * non-breaking change. Both version numbers are signals to users * what to expect from different versions, and should be carefully * chosen based on the product plan. - * + * * The major version is also reflected in the package name of the * API, which must end in `v`, as in * `google.feature.v1`. For major versions 0 and 1, the suffix can @@ -199,21 +199,21 @@ typedef GPB_ENUM(GPBMixin_FieldNumber) { * Declares an API to be included in this API. The including API must * redeclare all the methods from the included API, but documentation * and options are inherited as follows: - * + * * - If after comment and whitespace stripping, the documentation * string of the redeclared method is empty, it will be inherited * from the original method. - * + * * - Each annotation belonging to the service config (http, * visibility) which is not set in the redeclared method will be * inherited. - * + * * - If an http annotation is inherited, the path pattern will be * modified as follows. Any version prefix will be replaced by the * version of the including API plus the [root][] path if specified. - * + * * Example of a simple mixin: - * + * * package google.acl.v1; * service AccessControl { * // Get the underlying ACL object. @@ -221,30 +221,30 @@ typedef GPB_ENUM(GPBMixin_FieldNumber) { * option (google.api.http).get = "/v1/{resource=**}:getAcl"; * } * } - * + * * package google.storage.v2; * service Storage { * rpc GetAcl(GetAclRequest) returns (Acl); - * + * * // Get a data record. * rpc GetData(GetDataRequest) returns (Data) { * option (google.api.http).get = "/v2/{resource=**}"; * } * } - * + * * Example of a mixin configuration: - * + * * apis: * - name: google.storage.v2.Storage * mixins: * - name: google.acl.v1.AccessControl - * + * * The mixin construct implies that all methods in `AccessControl` are * also declared with same name and request/response types in * `Storage`. A documentation generator or annotation processor will * see the effective `Storage.GetAcl` method after inherting * documentation and annotations as follows: - * + * * service Storage { * // Get the underlying ACL object. * rpc GetAcl(GetAclRequest) returns (Acl) { @@ -252,20 +252,20 @@ typedef GPB_ENUM(GPBMixin_FieldNumber) { * } * ... * } - * + * * Note how the version in the path pattern changed from `v1` to `v2`. - * + * * If the `root` field in the mixin is specified, it should be a * relative path under which inherited HTTP paths are placed. Example: - * + * * apis: * - name: google.storage.v2.Storage * mixins: * - name: google.acl.v1.AccessControl * root: acls - * + * * This implies the following inherited HTTP annotation: - * + * * service Storage { * // Get the underlying ACL object. * rpc GetAcl(GetAclRequest) returns (Acl) { diff --git a/objectivec/google/protobuf/Duration.pbobjc.h b/objectivec/google/protobuf/Duration.pbobjc.h index 8f9b3515..fa91e223 100644 --- a/objectivec/google/protobuf/Duration.pbobjc.h +++ b/objectivec/google/protobuf/Duration.pbobjc.h @@ -55,16 +55,16 @@ typedef GPB_ENUM(GPBDuration_FieldNumber) { * or "month". It is related to Timestamp in that the difference between * two Timestamp values is a Duration and it can be added or subtracted * from a Timestamp. Range is approximately +-10,000 years. - * + * * Example 1: Compute Duration from two Timestamps in pseudo code. - * + * * Timestamp start = ...; * Timestamp end = ...; * Duration duration = ...; - * + * * duration.seconds = end.seconds - start.seconds; * duration.nanos = end.nanos - start.nanos; - * + * * if (duration.seconds < 0 && duration.nanos > 0) { * duration.seconds += 1; * duration.nanos -= 1000000000; @@ -72,16 +72,16 @@ typedef GPB_ENUM(GPBDuration_FieldNumber) { * duration.seconds -= 1; * duration.nanos += 1000000000; * } - * + * * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - * + * * Timestamp start = ...; * Duration duration = ...; * Timestamp end = ...; - * + * * end.seconds = start.seconds + duration.seconds; * end.nanos = start.nanos + duration.nanos; - * + * * if (end.nanos < 0) { * end.seconds -= 1; * end.nanos += 1000000000; diff --git a/objectivec/google/protobuf/Empty.pbobjc.h b/objectivec/google/protobuf/Empty.pbobjc.h index d85efd2c..4d36174d 100644 --- a/objectivec/google/protobuf/Empty.pbobjc.h +++ b/objectivec/google/protobuf/Empty.pbobjc.h @@ -47,11 +47,11 @@ NS_ASSUME_NONNULL_BEGIN * A generic empty message that you can re-use to avoid defining duplicated * empty messages in your APIs. A typical example is to use it as the request * or the response type of an API method. For instance: - * + * * service Foo { * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); * } - * + * * The JSON representation for `Empty` is empty JSON object `{}`. **/ @interface GPBEmpty : GPBMessage diff --git a/objectivec/google/protobuf/FieldMask.pbobjc.h b/objectivec/google/protobuf/FieldMask.pbobjc.h index 175db600..491463f9 100644 --- a/objectivec/google/protobuf/FieldMask.pbobjc.h +++ b/objectivec/google/protobuf/FieldMask.pbobjc.h @@ -49,25 +49,25 @@ typedef GPB_ENUM(GPBFieldMask_FieldNumber) { /** * `FieldMask` represents a set of symbolic field paths, for example: - * + * * paths: "f.a" * paths: "f.b.d" - * + * * Here `f` represents a field in some root message, `a` and `b` * fields in the message found in `f`, and `d` a field found in the * message in `f.b`. - * + * * Field masks are used to specify a subset of fields that should be * returned by a get operation or modified by an update operation. * Field masks also have a custom JSON encoding (see below). - * + * * # Field Masks in Projections - * + * * When used in the context of a projection, a response message or * sub-message is filtered by the API to only contain those fields as * specified in the mask. For example, if the mask in the previous * example is applied to a response message as follows: - * + * * f { * a : 22 * b { @@ -77,26 +77,26 @@ typedef GPB_ENUM(GPBFieldMask_FieldNumber) { * y : 13 * } * z: 8 - * + * * The result will not contain specific values for fields x,y and z * (their value will be set to the default, and omitted in proto text * output): - * - * + * + * * f { * a : 22 * b { * d : 1 * } * } - * + * * A repeated field is not allowed except at the last position of a * field mask. - * + * * If a FieldMask object is not present in a get operation, the * operation applies to all fields (as if a FieldMask of all fields * had been specified). - * + * * Note that a field mask does not necessarily apply to the * top-level response message. In case of a REST get operation, the * field mask applies directly to the response, but in case of a REST @@ -106,25 +106,25 @@ typedef GPB_ENUM(GPBFieldMask_FieldNumber) { * clearly documented together with its declaration in the API. In * any case, the effect on the returned resource/resources is required * behavior for APIs. - * + * * # Field Masks in Update Operations - * + * * A field mask in update operations specifies which fields of the * targeted resource are going to be updated. The API is required * to only change the values of the fields as specified in the mask * and leave the others untouched. If a resource is passed in to * describe the updated values, the API ignores the values of all * fields not covered by the mask. - * + * * If a repeated field is specified for an update operation, the existing * repeated values in the target resource will be overwritten by the new values. * Note that a repeated field is only allowed in the last position of a field * mask. - * + * * If a sub-message is specified in the last position of the field mask for an * update operation, then the existing sub-message in the target resource is * overwritten. Given the target message: - * + * * f { * b { * d : 1 @@ -132,34 +132,34 @@ typedef GPB_ENUM(GPBFieldMask_FieldNumber) { * } * c : 1 * } - * + * * And an update message: - * + * * f { * b { * d : 10 * } * } - * + * * then if the field mask is: - * + * * paths: "f.b" - * + * * then the result will be: - * + * * f { * b { * d : 10 * } * c : 1 * } - * + * * However, if the update mask was: - * + * * paths: "f.b.d" - * + * * then the result would be: - * + * * f { * b { * d : 10 @@ -167,13 +167,13 @@ typedef GPB_ENUM(GPBFieldMask_FieldNumber) { * } * c : 1 * } - * + * * In order to reset a field's value to the default, the field must * be in the mask and set to the default value in the provided resource. * Hence, in order to reset all fields of a resource, provide a default * instance of the resource and set all fields in the mask, or do * not provide a mask as described below. - * + * * If a field mask is not present on update, the operation applies to * all fields (as if a field mask of all fields has been specified). * Note that in the presence of schema evolution, this may mean that @@ -181,26 +181,26 @@ typedef GPB_ENUM(GPBFieldMask_FieldNumber) { * the request will be reset to their default. If this is unwanted * behavior, a specific service may require a client to always specify * a field mask, producing an error if not. - * + * * As with get operations, the location of the resource which * describes the updated values in the request message depends on the * operation kind. In any case, the effect of the field mask is * required to be honored by the API. - * + * * ## Considerations for HTTP REST - * + * * The HTTP kind of an update operation which uses a field mask must * be set to PATCH instead of PUT in order to satisfy HTTP semantics * (PUT must only be used for full updates). - * + * * # JSON Encoding of Field Masks - * + * * In JSON, a field mask is encoded as a single string where paths are * separated by a comma. Fields name in each path are converted * to/from lower-camel naming conventions. - * + * * As an example, consider the following message declarations: - * + * * message Profile { * User user = 1; * Photo photo = 2; @@ -209,44 +209,44 @@ typedef GPB_ENUM(GPBFieldMask_FieldNumber) { * string display_name = 1; * string address = 2; * } - * + * * In proto a field mask for `Profile` may look as such: - * + * * mask { * paths: "user.display_name" * paths: "photo" * } - * + * * In JSON, the same mask is represented as below: - * + * * { * mask: "user.displayName,photo" * } - * + * * # Field Masks and Oneof Fields - * + * * Field masks treat fields in oneofs just as regular fields. Consider the * following message: - * + * * message SampleMessage { * oneof test_oneof { * string name = 4; * SubMessage sub_message = 9; * } * } - * + * * The field mask can be: - * + * * mask { * paths: "name" * } - * + * * Or: - * + * * mask { * paths: "sub_message" * } - * + * * Note that oneof type names ("test_oneof" in this case) cannot be used in * paths. **/ diff --git a/objectivec/google/protobuf/Struct.pbobjc.h b/objectivec/google/protobuf/Struct.pbobjc.h index 670e049d..a5b31cd0 100644 --- a/objectivec/google/protobuf/Struct.pbobjc.h +++ b/objectivec/google/protobuf/Struct.pbobjc.h @@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN /** * `NullValue` is a singleton enumeration to represent the null value for the * `Value` type union. - * + * * The JSON representation for `NullValue` is JSON `null`. **/ typedef GPB_ENUM(GPBNullValue) { @@ -85,7 +85,7 @@ typedef GPB_ENUM(GPBStruct_FieldNumber) { * scripting languages like JS a struct is represented as an * object. The details of that representation are described together * with the proto support for the language. - * + * * The JSON representation for `Struct` is JSON object. **/ @interface GPBStruct : GPBMessage @@ -123,7 +123,7 @@ typedef GPB_ENUM(GPBValue_Kind_OneOfCase) { * null, a number, a string, a boolean, a recursive struct value, or a * list of values. A producer of value is expected to set one of that * variants, absence of any variant indicates an error. - * + * * The JSON representation for `Value` is JSON value. **/ @interface GPBValue : GPBMessage @@ -176,7 +176,7 @@ typedef GPB_ENUM(GPBListValue_FieldNumber) { /** * `ListValue` is a wrapper around a repeated field of values. - * + * * The JSON representation for `ListValue` is JSON array. **/ @interface GPBListValue : GPBMessage diff --git a/objectivec/google/protobuf/Timestamp.pbobjc.h b/objectivec/google/protobuf/Timestamp.pbobjc.h index 352c260b..ebfa670f 100644 --- a/objectivec/google/protobuf/Timestamp.pbobjc.h +++ b/objectivec/google/protobuf/Timestamp.pbobjc.h @@ -60,44 +60,44 @@ typedef GPB_ENUM(GPBTimestamp_FieldNumber) { * By restricting to that range, we ensure that we can convert to * and from RFC 3339 date strings. * See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). - * + * * Example 1: Compute Timestamp from POSIX `time()`. - * + * * Timestamp timestamp; * timestamp.set_seconds(time(NULL)); * timestamp.set_nanos(0); - * + * * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * + * * struct timeval tv; * gettimeofday(&tv, NULL); - * + * * Timestamp timestamp; * timestamp.set_seconds(tv.tv_sec); * timestamp.set_nanos(tv.tv_usec * 1000); - * + * * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * + * * FILETIME ft; * GetSystemTimeAsFileTime(&ft); * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * + * * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. * Timestamp timestamp; * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * + * * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * + * * long millis = System.currentTimeMillis(); - * + * * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * + * + * * Example 5: Compute Timestamp from current time in Python. - * + * * now = time.time() * seconds = int(now) * nanos = int((now - seconds) * 10**9) diff --git a/objectivec/google/protobuf/Wrappers.pbobjc.h b/objectivec/google/protobuf/Wrappers.pbobjc.h index fc7d5abe..e397c480 100644 --- a/objectivec/google/protobuf/Wrappers.pbobjc.h +++ b/objectivec/google/protobuf/Wrappers.pbobjc.h @@ -49,7 +49,7 @@ typedef GPB_ENUM(GPBDoubleValue_FieldNumber) { /** * Wrapper message for `double`. - * + * * The JSON representation for `DoubleValue` is JSON number. **/ @interface GPBDoubleValue : GPBMessage @@ -67,7 +67,7 @@ typedef GPB_ENUM(GPBFloatValue_FieldNumber) { /** * Wrapper message for `float`. - * + * * The JSON representation for `FloatValue` is JSON number. **/ @interface GPBFloatValue : GPBMessage @@ -85,7 +85,7 @@ typedef GPB_ENUM(GPBInt64Value_FieldNumber) { /** * Wrapper message for `int64`. - * + * * The JSON representation for `Int64Value` is JSON string. **/ @interface GPBInt64Value : GPBMessage @@ -103,7 +103,7 @@ typedef GPB_ENUM(GPBUInt64Value_FieldNumber) { /** * Wrapper message for `uint64`. - * + * * The JSON representation for `UInt64Value` is JSON string. **/ @interface GPBUInt64Value : GPBMessage @@ -121,7 +121,7 @@ typedef GPB_ENUM(GPBInt32Value_FieldNumber) { /** * Wrapper message for `int32`. - * + * * The JSON representation for `Int32Value` is JSON number. **/ @interface GPBInt32Value : GPBMessage @@ -139,7 +139,7 @@ typedef GPB_ENUM(GPBUInt32Value_FieldNumber) { /** * Wrapper message for `uint32`. - * + * * The JSON representation for `UInt32Value` is JSON number. **/ @interface GPBUInt32Value : GPBMessage @@ -157,7 +157,7 @@ typedef GPB_ENUM(GPBBoolValue_FieldNumber) { /** * Wrapper message for `bool`. - * + * * The JSON representation for `BoolValue` is JSON `true` and `false`. **/ @interface GPBBoolValue : GPBMessage @@ -175,7 +175,7 @@ typedef GPB_ENUM(GPBStringValue_FieldNumber) { /** * Wrapper message for `string`. - * + * * The JSON representation for `StringValue` is JSON string. **/ @interface GPBStringValue : GPBMessage @@ -193,7 +193,7 @@ typedef GPB_ENUM(GPBBytesValue_FieldNumber) { /** * Wrapper message for `bytes`. - * + * * The JSON representation for `BytesValue` is JSON string. **/ @interface GPBBytesValue : GPBMessage diff --git a/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc b/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc index 28b3f5ae..4a94373a 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc +++ b/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc @@ -850,14 +850,17 @@ string BuildCommentsString(const SourceLocation& location, string final_comments; string epilogue; + bool add_leading_space = false; + if (prefer_single_line && lines.size() == 1) { prefix = "/** "; suffix = " */\n"; } else { - prefix = " * "; + prefix = "* "; suffix = "\n"; final_comments += "/**\n"; epilogue = " **/\n"; + add_leading_space = true; } for (int i = 0; i < lines.size(); i++) { @@ -868,7 +871,12 @@ string BuildCommentsString(const SourceLocation& location, // Decouple / from * to not have inline comments inside comments. line = StringReplace(line, "/*", "/\\*", true); line = StringReplace(line, "*/", "*\\/", true); - final_comments += prefix + line + suffix; + line = prefix + line; + StripWhitespace(&line); + // If not a one line, need to add the first space before *, as + // StripWhitespace would have removed it. + line = (add_leading_space ? " " : "") + line; + final_comments += line + suffix; } final_comments += epilogue; return final_comments; -- cgit v1.2.3 From 08b1c718e437041bfe0e6a28611621896e4fe904 Mon Sep 17 00:00:00 2001 From: Khing Date: Wed, 7 Sep 2016 11:34:03 +1000 Subject: Fix #2032 unused parameter 'deterministic' Parameter deterministic is unused in InternalSerializeWithCachedSizesToArray(), which generates unused parameter warning in every message. --- src/google/protobuf/any.pb.cc | 1 + src/google/protobuf/api.pb.cc | 3 +++ src/google/protobuf/compiler/cpp/cpp_message.cc | 1 + src/google/protobuf/compiler/plugin.pb.cc | 3 +++ src/google/protobuf/descriptor.pb.cc | 25 +++++++++++++++++++++++++ src/google/protobuf/duration.pb.cc | 1 + src/google/protobuf/empty.pb.cc | 1 + src/google/protobuf/field_mask.pb.cc | 1 + src/google/protobuf/source_context.pb.cc | 1 + src/google/protobuf/struct.pb.cc | 3 +++ src/google/protobuf/timestamp.pb.cc | 1 + src/google/protobuf/type.pb.cc | 5 +++++ src/google/protobuf/wrappers.pb.cc | 9 +++++++++ 13 files changed, 55 insertions(+) (limited to 'src') diff --git a/src/google/protobuf/any.pb.cc b/src/google/protobuf/any.pb.cc index ccccc9c1..80e96528 100644 --- a/src/google/protobuf/any.pb.cc +++ b/src/google/protobuf/any.pb.cc @@ -278,6 +278,7 @@ void Any::SerializeWithCachedSizes( ::google::protobuf::uint8* Any::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Any) // optional string type_url = 1; if (this->type_url().size() > 0) { diff --git a/src/google/protobuf/api.pb.cc b/src/google/protobuf/api.pb.cc index cfb30786..131ca206 100644 --- a/src/google/protobuf/api.pb.cc +++ b/src/google/protobuf/api.pb.cc @@ -470,6 +470,7 @@ void Api::SerializeWithCachedSizes( ::google::protobuf::uint8* Api::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Api) // optional string name = 1; if (this->name().size() > 0) { @@ -1224,6 +1225,7 @@ void Method::SerializeWithCachedSizes( ::google::protobuf::uint8* Method::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Method) // optional string name = 1; if (this->name().size() > 0) { @@ -1806,6 +1808,7 @@ void Mixin::SerializeWithCachedSizes( ::google::protobuf::uint8* Mixin::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Mixin) // optional string name = 1; if (this->name().size() > 0) { diff --git a/src/google/protobuf/compiler/cpp/cpp_message.cc b/src/google/protobuf/compiler/cpp/cpp_message.cc index 405a5fed..aa00962e 100644 --- a/src/google/protobuf/compiler/cpp/cpp_message.cc +++ b/src/google/protobuf/compiler/cpp/cpp_message.cc @@ -3363,6 +3363,7 @@ GenerateSerializeWithCachedSizesToArray(io::Printer* printer) { "classname", classname_); printer->Indent(); + printer->Print("(void)deterministic; // Unused\n"); printer->Print( "// @@protoc_insertion_point(serialize_to_array_start:$full_name$)\n", "full_name", descriptor_->full_name()); diff --git a/src/google/protobuf/compiler/plugin.pb.cc b/src/google/protobuf/compiler/plugin.pb.cc index 9064c382..5247f9a2 100644 --- a/src/google/protobuf/compiler/plugin.pb.cc +++ b/src/google/protobuf/compiler/plugin.pb.cc @@ -368,6 +368,7 @@ void CodeGeneratorRequest::SerializeWithCachedSizes( ::google::protobuf::uint8* CodeGeneratorRequest::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.CodeGeneratorRequest) // repeated string file_to_generate = 1; for (int i = 0; i < this->file_to_generate_size(); i++) { @@ -877,6 +878,7 @@ void CodeGeneratorResponse_File::SerializeWithCachedSizes( ::google::protobuf::uint8* CodeGeneratorResponse_File::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.CodeGeneratorResponse.File) // optional string name = 1; if (has_name()) { @@ -1211,6 +1213,7 @@ void CodeGeneratorResponse::SerializeWithCachedSizes( ::google::protobuf::uint8* CodeGeneratorResponse::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.CodeGeneratorResponse) // optional string error = 1; if (has_error()) { diff --git a/src/google/protobuf/descriptor.pb.cc b/src/google/protobuf/descriptor.pb.cc index 0028c708..26494b6d 100644 --- a/src/google/protobuf/descriptor.pb.cc +++ b/src/google/protobuf/descriptor.pb.cc @@ -1040,6 +1040,7 @@ void FileDescriptorSet::SerializeWithCachedSizes( ::google::protobuf::uint8* FileDescriptorSet::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FileDescriptorSet) // repeated .google.protobuf.FileDescriptorProto file = 1; for (unsigned int i = 0, n = this->file_size(); i < n; i++) { @@ -1632,6 +1633,7 @@ void FileDescriptorProto::SerializeWithCachedSizes( ::google::protobuf::uint8* FileDescriptorProto::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FileDescriptorProto) // optional string name = 1; if (has_name()) { @@ -2631,6 +2633,7 @@ void DescriptorProto_ExtensionRange::SerializeWithCachedSizes( ::google::protobuf::uint8* DescriptorProto_ExtensionRange::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.DescriptorProto.ExtensionRange) // optional int32 start = 1; if (has_start()) { @@ -2934,6 +2937,7 @@ void DescriptorProto_ReservedRange::SerializeWithCachedSizes( ::google::protobuf::uint8* DescriptorProto_ReservedRange::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.DescriptorProto.ReservedRange) // optional int32 start = 1; if (has_start()) { @@ -3435,6 +3439,7 @@ void DescriptorProto::SerializeWithCachedSizes( ::google::protobuf::uint8* DescriptorProto::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.DescriptorProto) // optional string name = 1; if (has_name()) { @@ -4675,6 +4680,7 @@ void FieldDescriptorProto::SerializeWithCachedSizes( ::google::protobuf::uint8* FieldDescriptorProto::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FieldDescriptorProto) // optional string name = 1; if (has_name()) { @@ -5563,6 +5569,7 @@ void OneofDescriptorProto::SerializeWithCachedSizes( ::google::protobuf::uint8* OneofDescriptorProto::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.OneofDescriptorProto) // optional string name = 1; if (has_name()) { @@ -6002,6 +6009,7 @@ void EnumDescriptorProto::SerializeWithCachedSizes( ::google::protobuf::uint8* EnumDescriptorProto::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumDescriptorProto) // optional string name = 1; if (has_name()) { @@ -6487,6 +6495,7 @@ void EnumValueDescriptorProto::SerializeWithCachedSizes( ::google::protobuf::uint8* EnumValueDescriptorProto::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumValueDescriptorProto) // optional string name = 1; if (has_name()) { @@ -6966,6 +6975,7 @@ void ServiceDescriptorProto::SerializeWithCachedSizes( ::google::protobuf::uint8* ServiceDescriptorProto::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.ServiceDescriptorProto) // optional string name = 1; if (has_name()) { @@ -7559,6 +7569,7 @@ void MethodDescriptorProto::SerializeWithCachedSizes( ::google::protobuf::uint8* MethodDescriptorProto::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.MethodDescriptorProto) // optional string name = 1; if (has_name()) { @@ -8596,6 +8607,7 @@ void FileOptions::SerializeWithCachedSizes( ::google::protobuf::uint8* FileOptions::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FileOptions) // optional string java_package = 1; if (has_java_package()) { @@ -9741,6 +9753,7 @@ void MessageOptions::SerializeWithCachedSizes( ::google::protobuf::uint8* MessageOptions::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.MessageOptions) // optional bool message_set_wire_format = 1 [default = false]; if (has_message_set_wire_format()) { @@ -10409,6 +10422,7 @@ void FieldOptions::SerializeWithCachedSizes( ::google::protobuf::uint8* FieldOptions::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FieldOptions) // optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; if (has_ctype()) { @@ -10945,6 +10959,7 @@ void OneofOptions::SerializeWithCachedSizes( ::google::protobuf::uint8* OneofOptions::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.OneofOptions) // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; for (unsigned int i = 0, n = this->uninterpreted_option_size(); i < n; i++) { @@ -11308,6 +11323,7 @@ void EnumOptions::SerializeWithCachedSizes( ::google::protobuf::uint8* EnumOptions::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumOptions) // optional bool allow_alias = 2; if (has_allow_alias()) { @@ -11709,6 +11725,7 @@ void EnumValueOptions::SerializeWithCachedSizes( ::google::protobuf::uint8* EnumValueOptions::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumValueOptions) // optional bool deprecated = 1 [default = false]; if (has_deprecated()) { @@ -12070,6 +12087,7 @@ void ServiceOptions::SerializeWithCachedSizes( ::google::protobuf::uint8* ServiceOptions::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.ServiceOptions) // optional bool deprecated = 33 [default = false]; if (has_deprecated()) { @@ -12431,6 +12449,7 @@ void MethodOptions::SerializeWithCachedSizes( ::google::protobuf::uint8* MethodOptions::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.MethodOptions) // optional bool deprecated = 33 [default = false]; if (has_deprecated()) { @@ -12793,6 +12812,7 @@ void UninterpretedOption_NamePart::SerializeWithCachedSizes( ::google::protobuf::uint8* UninterpretedOption_NamePart::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.UninterpretedOption.NamePart) // required string name_part = 1; if (has_name_part()) { @@ -13259,6 +13279,7 @@ void UninterpretedOption::SerializeWithCachedSizes( ::google::protobuf::uint8* UninterpretedOption::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.UninterpretedOption) // repeated .google.protobuf.UninterpretedOption.NamePart name = 2; for (unsigned int i = 0, n = this->name_size(); i < n; i++) { @@ -14104,6 +14125,7 @@ void SourceCodeInfo_Location::SerializeWithCachedSizes( ::google::protobuf::uint8* SourceCodeInfo_Location::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.SourceCodeInfo.Location) // repeated int32 path = 1 [packed = true]; if (this->path_size() > 0) { @@ -14466,6 +14488,7 @@ void SourceCodeInfo::SerializeWithCachedSizes( ::google::protobuf::uint8* SourceCodeInfo::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.SourceCodeInfo) // repeated .google.protobuf.SourceCodeInfo.Location location = 1; for (unsigned int i = 0, n = this->location_size(); i < n; i++) { @@ -15077,6 +15100,7 @@ void GeneratedCodeInfo_Annotation::SerializeWithCachedSizes( ::google::protobuf::uint8* GeneratedCodeInfo_Annotation::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.GeneratedCodeInfo.Annotation) // repeated int32 path = 1 [packed = true]; if (this->path_size() > 0) { @@ -15396,6 +15420,7 @@ void GeneratedCodeInfo::SerializeWithCachedSizes( ::google::protobuf::uint8* GeneratedCodeInfo::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.GeneratedCodeInfo) // repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; for (unsigned int i = 0, n = this->annotation_size(); i < n; i++) { diff --git a/src/google/protobuf/duration.pb.cc b/src/google/protobuf/duration.pb.cc index 94ece18e..f916000e 100644 --- a/src/google/protobuf/duration.pb.cc +++ b/src/google/protobuf/duration.pb.cc @@ -274,6 +274,7 @@ void Duration::SerializeWithCachedSizes( ::google::protobuf::uint8* Duration::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Duration) // optional int64 seconds = 1; if (this->seconds() != 0) { diff --git a/src/google/protobuf/empty.pb.cc b/src/google/protobuf/empty.pb.cc index 83775753..7ef97790 100644 --- a/src/google/protobuf/empty.pb.cc +++ b/src/google/protobuf/empty.pb.cc @@ -216,6 +216,7 @@ void Empty::SerializeWithCachedSizes( ::google::protobuf::uint8* Empty::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Empty) // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Empty) return target; diff --git a/src/google/protobuf/field_mask.pb.cc b/src/google/protobuf/field_mask.pb.cc index ed05fe57..d2acc38b 100644 --- a/src/google/protobuf/field_mask.pb.cc +++ b/src/google/protobuf/field_mask.pb.cc @@ -240,6 +240,7 @@ void FieldMask::SerializeWithCachedSizes( ::google::protobuf::uint8* FieldMask::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FieldMask) // repeated string paths = 1; for (int i = 0; i < this->paths_size(); i++) { diff --git a/src/google/protobuf/source_context.pb.cc b/src/google/protobuf/source_context.pb.cc index 5cc77bf3..019ccf15 100644 --- a/src/google/protobuf/source_context.pb.cc +++ b/src/google/protobuf/source_context.pb.cc @@ -239,6 +239,7 @@ void SourceContext::SerializeWithCachedSizes( ::google::protobuf::uint8* SourceContext::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.SourceContext) // optional string file_name = 1; if (this->file_name().size() > 0) { diff --git a/src/google/protobuf/struct.pb.cc b/src/google/protobuf/struct.pb.cc index a551384c..998ea0e0 100644 --- a/src/google/protobuf/struct.pb.cc +++ b/src/google/protobuf/struct.pb.cc @@ -394,6 +394,7 @@ void Struct::SerializeWithCachedSizes( ::google::protobuf::uint8* Struct::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Struct) // map fields = 1; if (!this->fields().empty()) { @@ -847,6 +848,7 @@ void Value::SerializeWithCachedSizes( ::google::protobuf::uint8* Value::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Value) // optional .google.protobuf.NullValue null_value = 1; if (has_null_value()) { @@ -1444,6 +1446,7 @@ void ListValue::SerializeWithCachedSizes( ::google::protobuf::uint8* ListValue::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.ListValue) // repeated .google.protobuf.Value values = 1; for (unsigned int i = 0, n = this->values_size(); i < n; i++) { diff --git a/src/google/protobuf/timestamp.pb.cc b/src/google/protobuf/timestamp.pb.cc index 542e5ed7..0a18edbe 100644 --- a/src/google/protobuf/timestamp.pb.cc +++ b/src/google/protobuf/timestamp.pb.cc @@ -288,6 +288,7 @@ void Timestamp::SerializeWithCachedSizes( ::google::protobuf::uint8* Timestamp::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Timestamp) // optional int64 seconds = 1; if (this->seconds() != 0) { diff --git a/src/google/protobuf/type.pb.cc b/src/google/protobuf/type.pb.cc index 7ba909ef..87a7864f 100644 --- a/src/google/protobuf/type.pb.cc +++ b/src/google/protobuf/type.pb.cc @@ -543,6 +543,7 @@ void Type::SerializeWithCachedSizes( ::google::protobuf::uint8* Type::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Type) // optional string name = 1; if (this->name().size() > 0) { @@ -1416,6 +1417,7 @@ void Field::SerializeWithCachedSizes( ::google::protobuf::uint8* Field::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Field) // optional .google.protobuf.Field.Kind kind = 1; if (this->kind() != 0) { @@ -2195,6 +2197,7 @@ void Enum::SerializeWithCachedSizes( ::google::protobuf::uint8* Enum::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Enum) // optional string name = 1; if (this->name().size() > 0) { @@ -2707,6 +2710,7 @@ void EnumValue::SerializeWithCachedSizes( ::google::protobuf::uint8* EnumValue::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumValue) // optional string name = 1; if (this->name().size() > 0) { @@ -3093,6 +3097,7 @@ void Option::SerializeWithCachedSizes( ::google::protobuf::uint8* Option::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Option) // optional string name = 1; if (this->name().size() > 0) { diff --git a/src/google/protobuf/wrappers.pb.cc b/src/google/protobuf/wrappers.pb.cc index 33a69d3b..627b556e 100644 --- a/src/google/protobuf/wrappers.pb.cc +++ b/src/google/protobuf/wrappers.pb.cc @@ -443,6 +443,7 @@ void DoubleValue::SerializeWithCachedSizes( ::google::protobuf::uint8* DoubleValue::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.DoubleValue) // optional double value = 1; if (this->value() != 0) { @@ -705,6 +706,7 @@ void FloatValue::SerializeWithCachedSizes( ::google::protobuf::uint8* FloatValue::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FloatValue) // optional float value = 1; if (this->value() != 0) { @@ -967,6 +969,7 @@ void Int64Value::SerializeWithCachedSizes( ::google::protobuf::uint8* Int64Value::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Int64Value) // optional int64 value = 1; if (this->value() != 0) { @@ -1231,6 +1234,7 @@ void UInt64Value::SerializeWithCachedSizes( ::google::protobuf::uint8* UInt64Value::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.UInt64Value) // optional uint64 value = 1; if (this->value() != 0) { @@ -1495,6 +1499,7 @@ void Int32Value::SerializeWithCachedSizes( ::google::protobuf::uint8* Int32Value::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Int32Value) // optional int32 value = 1; if (this->value() != 0) { @@ -1759,6 +1764,7 @@ void UInt32Value::SerializeWithCachedSizes( ::google::protobuf::uint8* UInt32Value::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.UInt32Value) // optional uint32 value = 1; if (this->value() != 0) { @@ -2023,6 +2029,7 @@ void BoolValue::SerializeWithCachedSizes( ::google::protobuf::uint8* BoolValue::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.BoolValue) // optional bool value = 1; if (this->value() != 0) { @@ -2294,6 +2301,7 @@ void StringValue::SerializeWithCachedSizes( ::google::protobuf::uint8* StringValue::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.StringValue) // optional string value = 1; if (this->value().size() > 0) { @@ -2617,6 +2625,7 @@ void BytesValue::SerializeWithCachedSizes( ::google::protobuf::uint8* BytesValue::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.BytesValue) // optional bytes value = 1; if (this->value().size() > 0) { -- cgit v1.2.3