diff --git a/java/util/src/main/java/com/google/protobuf/util/Structs.java b/java/util/src/main/java/com/google/protobuf/util/Structs.java
new file mode 100755
index 0000000000..b1696ecdbc
--- /dev/null
+++ b/java/util/src/main/java/com/google/protobuf/util/Structs.java
@@ -0,0 +1,65 @@
+// 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.
+
+package com.google.protobuf.util;
+
+import com.google.protobuf.Struct;
+import com.google.protobuf.Value;
+
+/** Utilities to help create {@code google.protobuf.Struct} messages. */
+public final class Structs {
+
+ /**
+ * Returns a struct containing the key-value pair.
+ */
+ public static Struct of(String k1, Value v1) {
+ return Struct.newBuilder().putFields(k1, v1).build();
+ }
+
+ /**
+ * Returns a struct containing each of the key-value pairs.
+ *
+ * Providing duplicate keys is undefined behavior.
+ */
+ public static Struct of(String k1, Value v1, String k2, Value v2) {
+ return Struct.newBuilder().putFields(k1, v1).putFields(k2, v2).build();
+ }
+
+ /**
+ * Returns a struct containing each of the key-value pairs.
+ *
+ *
Providing duplicate keys is undefined behavior.
+ */
+ public static Struct of(String k1, Value v1, String k2, Value v2, String k3, Value v3) {
+ return Struct.newBuilder().putFields(k1, v1).putFields(k2, v2).putFields(k3, v3).build();
+ }
+
+ private Structs() {}
+}
diff --git a/java/util/src/main/java/com/google/protobuf/util/Values.java b/java/util/src/main/java/com/google/protobuf/util/Values.java
new file mode 100755
index 0000000000..b3ade2ddfb
--- /dev/null
+++ b/java/util/src/main/java/com/google/protobuf/util/Values.java
@@ -0,0 +1,85 @@
+// 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.
+
+package com.google.protobuf.util;
+
+import com.google.protobuf.ListValue;
+import com.google.protobuf.NullValue;
+import com.google.protobuf.Struct;
+import com.google.protobuf.Value;
+
+/** Utilities to help create {@code google.protobuf.Value} messages. */
+public final class Values {
+
+ private static final Value NULL_VALUE =
+ Value.newBuilder().setNullValue(NullValue.NULL_VALUE).build();
+
+ public static Value ofNull() {
+ return NULL_VALUE;
+ }
+
+ /** Returns a Value object with number set to value. */
+ public static Value of(boolean value) {
+ return Value.newBuilder().setBoolValue(value).build();
+ }
+
+ /** Returns a Value object with number set to value. */
+ public static Value of(double value) {
+ return Value.newBuilder().setNumberValue(value).build();
+ }
+
+ /** Returns a Value object with string set to value. */
+ public static Value of(String value) {
+ return Value.newBuilder().setStringValue(value).build();
+ }
+
+ /** Returns a Value object with struct set to value. */
+ public static Value of(Struct value) {
+ return Value.newBuilder().setStructValue(value).build();
+ }
+
+ /** Returns a Value with ListValue set to value. */
+ public static Value of(ListValue value) {
+ return Value.newBuilder().setListValue(value).build();
+ }
+
+ /**
+ * Returns a Value with ListValue set to the appending the result of calling {@link #of(Object)}
+ * on each element in the iterable.
+ */
+ public static Value of(Iterable values) {
+ Value.Builder valueBuilder = Value.newBuilder();
+ ListValue.Builder listValue = valueBuilder.getListValueBuilder();
+ listValue.addAllValues(values);
+ return valueBuilder.build();
+ }
+
+ private Values() {}
+}
diff --git a/java/util/src/test/java/com/google/protobuf/util/StructsTest.java b/java/util/src/test/java/com/google/protobuf/util/StructsTest.java
new file mode 100755
index 0000000000..265aff5776
--- /dev/null
+++ b/java/util/src/test/java/com/google/protobuf/util/StructsTest.java
@@ -0,0 +1,59 @@
+// 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.
+
+package com.google.protobuf.util;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import com.google.protobuf.Struct;
+import junit.framework.TestCase;
+
+public final class StructsTest extends TestCase {
+
+ public void test1pair_constructsObject() throws Exception {
+ Struct.Builder expected = Struct.newBuilder();
+ JsonFormat.parser().merge("{\"k1\": 1}", expected);
+ assertThat(Structs.of("k1", Values.of(1))).isEqualTo(expected.build());
+ }
+
+ public void test2pair_constructsObject() throws Exception {
+ Struct.Builder expected = Struct.newBuilder();
+ JsonFormat.parser().merge("{\"k1\": 1, \"k2\": 2}", expected);
+ assertThat(Structs.of("k1", Values.of(1), "k2", Values.of(2))).isEqualTo(expected.build());
+ }
+
+ public void test3pair_constructsObject() throws Exception {
+ Struct.Builder expected = Struct.newBuilder();
+ JsonFormat.parser().merge("{\"k1\": 1, \"k2\": 2, \"k3\": 3}", expected);
+ assertThat(Structs.of("k1", Values.of(1), "k2", Values.of(2), "k3", Values.of(3)))
+ .isEqualTo(expected.build());
+ }
+
+}
diff --git a/java/util/src/test/java/com/google/protobuf/util/ValuesTest.java b/java/util/src/test/java/com/google/protobuf/util/ValuesTest.java
new file mode 100755
index 0000000000..d646e97282
--- /dev/null
+++ b/java/util/src/test/java/com/google/protobuf/util/ValuesTest.java
@@ -0,0 +1,102 @@
+// 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.
+
+package com.google.protobuf.util;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import com.google.protobuf.ListValue;
+import com.google.protobuf.NullValue;
+import com.google.protobuf.Struct;
+import com.google.protobuf.Value;
+import java.util.ArrayList;
+import java.util.List;
+import junit.framework.TestCase;
+
+public final class ValuesTest extends TestCase {
+ public void testOfNull_IsNullValue() throws Exception {
+ assertThat(Values.ofNull())
+ .isEqualTo(Value.newBuilder().setNullValue(NullValue.NULL_VALUE).build());
+ }
+
+ public void testOfBoolean_ConstructsValue() {
+ assertThat(Values.of(true)).isEqualTo(Value.newBuilder().setBoolValue(true).build());
+ assertThat(Values.of(false)).isEqualTo(Value.newBuilder().setBoolValue(false).build());
+ }
+
+ public void testOfNumeric_ConstructsValue() {
+ assertThat(Values.of(100)).isEqualTo(Value.newBuilder().setNumberValue(100).build());
+ assertThat(Values.of(1000L)).isEqualTo(Value.newBuilder().setNumberValue(1000).build());
+ assertThat(Values.of(1000.23f)).isEqualTo(Value.newBuilder().setNumberValue(1000.23f).build());
+ assertThat(Values.of(10000.23)).isEqualTo(Value.newBuilder().setNumberValue(10000.23).build());
+ }
+
+ public void testOfString_ConstructsValue() {
+ assertThat(Values.of("")).isEqualTo(Value.newBuilder().setStringValue("").build());
+ assertThat(Values.of("foo")).isEqualTo(Value.newBuilder().setStringValue("foo").build());
+ }
+
+ public void testOfStruct_ConstructsValue() {
+ Struct.Builder builder = Struct.newBuilder();
+ builder.putFields("a", Values.of("a"));
+ builder.putFields("b", Values.of("b"));
+
+ assertThat(Values.of(builder.build()))
+ .isEqualTo(Value.newBuilder().setStructValue(builder.build()).build());
+ }
+
+ public void testOfListValue_ConstructsInstance() {
+ ListValue.Builder builder = ListValue.newBuilder();
+ builder.addValues(Values.of(1));
+ builder.addValues(Values.of(2));
+
+ assertThat(Values.of(builder.build()))
+ .isEqualTo(Value.newBuilder().setListValue(builder.build()).build());
+ }
+
+ public void testOfIterable_ReturnsTheValue() {
+ ListValue.Builder builder = ListValue.newBuilder();
+ builder.addValues(Values.of(1));
+ builder.addValues(Values.of(2));
+ builder.addValues(Values.of(true));
+ builder.addValues(Value.newBuilder().setListValue(builder.build()).build());
+
+ List list = new ArrayList<>();
+ list.add(Values.of(1));
+ list.add(Values.of(2));
+ list.add(Values.of(true));
+ List copyList = new ArrayList<>(list);
+ list.add(Values.of(copyList));
+
+ assertThat(Values.of(list)).isEqualTo(Value.newBuilder().setListValue(builder).build());
+ assertThat(Values.of(new ArrayList()))
+ .isEqualTo(Value.newBuilder().setListValue(ListValue.getDefaultInstance()).build());
+ }
+}
diff --git a/python/google/protobuf/descriptor_pool.py b/python/google/protobuf/descriptor_pool.py
index bc5029a557..f41dc522c6 100644
--- a/python/google/protobuf/descriptor_pool.py
+++ b/python/google/protobuf/descriptor_pool.py
@@ -99,8 +99,6 @@ def _IsMessageSetExtension(field):
field.label == descriptor.FieldDescriptor.LABEL_OPTIONAL)
-
-
class DescriptorPool(object):
"""A collection of protobufs dynamically constructed by descriptor protos."""
diff --git a/python/google/protobuf/internal/message_test.py b/python/google/protobuf/internal/message_test.py
index 3927ce1cdf..9de3e7a016 100755
--- a/python/google/protobuf/internal/message_test.py
+++ b/python/google/protobuf/internal/message_test.py
@@ -1725,6 +1725,7 @@ class Proto3Test(unittest.TestCase):
self.assertIsNone(msg.map_int32_int32.get(5))
self.assertEqual(10, msg.map_int32_int32.get(5, 10))
+ self.assertEqual(10, msg.map_int32_int32.get(key=5, default=10))
self.assertIsNone(msg.map_int32_int32.get(5))
msg.map_int32_int32[5] = 15
@@ -1735,6 +1736,7 @@ class Proto3Test(unittest.TestCase):
self.assertIsNone(msg.map_int32_foreign_message.get(5))
self.assertEqual(10, msg.map_int32_foreign_message.get(5, 10))
+ self.assertEqual(10, msg.map_int32_foreign_message.get(key=5, default=10))
submsg = msg.map_int32_foreign_message[5]
self.assertIs(submsg, msg.map_int32_foreign_message.get(5))
diff --git a/python/google/protobuf/pyext/map_container.cc b/python/google/protobuf/pyext/map_container.cc
index 07c94c779c..9c8727efab 100644
--- a/python/google/protobuf/pyext/map_container.cc
+++ b/python/google/protobuf/pyext/map_container.cc
@@ -464,10 +464,13 @@ int MapReflectionFriend::ScalarMapSetItem(PyObject* _self, PyObject* key,
}
}
-static PyObject* ScalarMapGet(PyObject* self, PyObject* args) {
+static PyObject* ScalarMapGet(PyObject* self, PyObject* args,
+ PyObject* kwargs) {
+ static char* kwlist[] = {"key", "default", nullptr};
PyObject* key;
PyObject* default_value = NULL;
- if (PyArg_ParseTuple(args, "O|O", &key, &default_value) < 0) {
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|O", kwlist, &key,
+ &default_value)) {
return NULL;
}
@@ -532,23 +535,23 @@ static void ScalarMapDealloc(PyObject* _self) {
}
static PyMethodDef ScalarMapMethods[] = {
- { "__contains__", MapReflectionFriend::Contains, METH_O,
- "Tests whether a key is a member of the map." },
- { "clear", (PyCFunction)Clear, METH_NOARGS,
- "Removes all elements from the map." },
- { "get", ScalarMapGet, METH_VARARGS,
- "Gets the value for the given key if present, or otherwise a default" },
- { "GetEntryClass", (PyCFunction)GetEntryClass, METH_NOARGS,
- "Return the class used to build Entries of (key, value) pairs." },
- { "MergeFrom", (PyCFunction)MapReflectionFriend::MergeFrom, METH_O,
- "Merges a map into the current map." },
- /*
- { "__deepcopy__", (PyCFunction)DeepCopy, METH_VARARGS,
- "Makes a deep copy of the class." },
- { "__reduce__", (PyCFunction)Reduce, METH_NOARGS,
- "Outputs picklable representation of the repeated field." },
- */
- {NULL, NULL},
+ {"__contains__", MapReflectionFriend::Contains, METH_O,
+ "Tests whether a key is a member of the map."},
+ {"clear", (PyCFunction)Clear, METH_NOARGS,
+ "Removes all elements from the map."},
+ {"get", (PyCFunction)ScalarMapGet, METH_VARARGS | METH_KEYWORDS,
+ "Gets the value for the given key if present, or otherwise a default"},
+ {"GetEntryClass", (PyCFunction)GetEntryClass, METH_NOARGS,
+ "Return the class used to build Entries of (key, value) pairs."},
+ {"MergeFrom", (PyCFunction)MapReflectionFriend::MergeFrom, METH_O,
+ "Merges a map into the current map."},
+ /*
+ { "__deepcopy__", (PyCFunction)DeepCopy, METH_VARARGS,
+ "Makes a deep copy of the class." },
+ { "__reduce__", (PyCFunction)Reduce, METH_NOARGS,
+ "Outputs picklable representation of the repeated field." },
+ */
+ {NULL, NULL},
};
PyTypeObject *ScalarMapContainer_Type;
@@ -773,10 +776,12 @@ PyObject* MapReflectionFriend::MessageMapToStr(PyObject* _self) {
return PyObject_Repr(dict.get());
}
-PyObject* MessageMapGet(PyObject* self, PyObject* args) {
+PyObject* MessageMapGet(PyObject* self, PyObject* args, PyObject* kwargs) {
+ static char* kwlist[] = {"key", "default", nullptr};
PyObject* key;
PyObject* default_value = NULL;
- if (PyArg_ParseTuple(args, "O|O", &key, &default_value) < 0) {
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|O", kwlist, &key,
+ &default_value)) {
return NULL;
}
@@ -810,25 +815,25 @@ static void MessageMapDealloc(PyObject* _self) {
}
static PyMethodDef MessageMapMethods[] = {
- { "__contains__", (PyCFunction)MapReflectionFriend::Contains, METH_O,
- "Tests whether the map contains this element."},
- { "clear", (PyCFunction)Clear, METH_NOARGS,
- "Removes all elements from the map."},
- { "get", MessageMapGet, METH_VARARGS,
- "Gets the value for the given key if present, or otherwise a default" },
- { "get_or_create", MapReflectionFriend::MessageMapGetItem, METH_O,
- "Alias for getitem, useful to make explicit that the map is mutated." },
- { "GetEntryClass", (PyCFunction)GetEntryClass, METH_NOARGS,
- "Return the class used to build Entries of (key, value) pairs." },
- { "MergeFrom", (PyCFunction)MapReflectionFriend::MergeFrom, METH_O,
- "Merges a map into the current map." },
- /*
- { "__deepcopy__", (PyCFunction)DeepCopy, METH_VARARGS,
- "Makes a deep copy of the class." },
- { "__reduce__", (PyCFunction)Reduce, METH_NOARGS,
- "Outputs picklable representation of the repeated field." },
- */
- {NULL, NULL},
+ {"__contains__", (PyCFunction)MapReflectionFriend::Contains, METH_O,
+ "Tests whether the map contains this element."},
+ {"clear", (PyCFunction)Clear, METH_NOARGS,
+ "Removes all elements from the map."},
+ {"get", (PyCFunction)MessageMapGet, METH_VARARGS | METH_KEYWORDS,
+ "Gets the value for the given key if present, or otherwise a default"},
+ {"get_or_create", MapReflectionFriend::MessageMapGetItem, METH_O,
+ "Alias for getitem, useful to make explicit that the map is mutated."},
+ {"GetEntryClass", (PyCFunction)GetEntryClass, METH_NOARGS,
+ "Return the class used to build Entries of (key, value) pairs."},
+ {"MergeFrom", (PyCFunction)MapReflectionFriend::MergeFrom, METH_O,
+ "Merges a map into the current map."},
+ /*
+ { "__deepcopy__", (PyCFunction)DeepCopy, METH_VARARGS,
+ "Makes a deep copy of the class." },
+ { "__reduce__", (PyCFunction)Reduce, METH_NOARGS,
+ "Outputs picklable representation of the repeated field." },
+ */
+ {NULL, NULL},
};
PyTypeObject *MessageMapContainer_Type;
diff --git a/src/google/protobuf/any.pb.cc b/src/google/protobuf/any.pb.cc
index 778773b8d4..879db89725 100644
--- a/src/google/protobuf/any.pb.cc
+++ b/src/google/protobuf/any.pb.cc
@@ -111,7 +111,7 @@ bool Any::ParseAnyTypeUrl(const string& type_url,
full_type_name);
}
-class Any::HasBitSetters {
+class Any::_Internal {
public:
};
@@ -131,11 +131,11 @@ Any::Any(const Any& from)
_any_metadata_(&type_url_, &value_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
type_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- if (from.type_url().size() > 0) {
+ if (!from.type_url().empty()) {
type_url_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.type_url_);
}
value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- if (from.value().size() > 0) {
+ if (!from.value().empty()) {
value_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.value_);
}
// @@protoc_insertion_point(copy_constructor:google.protobuf.Any)
diff --git a/src/google/protobuf/any.pb.h b/src/google/protobuf/any.pb.h
index 214d521c4d..5383adf68b 100644
--- a/src/google/protobuf/any.pb.h
+++ b/src/google/protobuf/any.pb.h
@@ -217,7 +217,7 @@ class PROTOBUF_EXPORT Any :
// @@protoc_insertion_point(class_scope:google.protobuf.Any)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr type_url_;
diff --git a/src/google/protobuf/api.pb.cc b/src/google/protobuf/api.pb.cc
index bc07c60fbe..29060c09b0 100644
--- a/src/google/protobuf/api.pb.cc
+++ b/src/google/protobuf/api.pb.cc
@@ -178,13 +178,13 @@ void Api::InitAsDefaultInstance() {
PROTOBUF_NAMESPACE_ID::_Api_default_instance_._instance.get_mutable()->source_context_ = const_cast< PROTOBUF_NAMESPACE_ID::SourceContext*>(
PROTOBUF_NAMESPACE_ID::SourceContext::internal_default_instance());
}
-class Api::HasBitSetters {
+class Api::_Internal {
public:
static const PROTOBUF_NAMESPACE_ID::SourceContext& source_context(const Api* msg);
};
const PROTOBUF_NAMESPACE_ID::SourceContext&
-Api::HasBitSetters::source_context(const Api* msg) {
+Api::_Internal::source_context(const Api* msg) {
return *msg->source_context_;
}
void Api::clear_options() {
@@ -219,11 +219,11 @@ Api::Api(const Api& from)
mixins_(from.mixins_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- if (from.name().size() > 0) {
+ if (!from.name().empty()) {
name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
}
version_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- if (from.version().size() > 0) {
+ if (!from.version().empty()) {
version_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.version_);
}
if (from.has_source_context()) {
@@ -542,7 +542,7 @@ void Api::SerializeWithCachedSizes(
// .google.protobuf.SourceContext source_context = 5;
if (this->has_source_context()) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
- 5, HasBitSetters::source_context(this), output);
+ 5, _Internal::source_context(this), output);
}
// repeated .google.protobuf.Mixin mixins = 6;
@@ -615,7 +615,7 @@ void Api::SerializeWithCachedSizes(
if (this->has_source_context()) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
- 5, HasBitSetters::source_context(this), target);
+ 5, _Internal::source_context(this), target);
}
// repeated .google.protobuf.Mixin mixins = 6;
@@ -804,7 +804,7 @@ void Api::InternalSwap(Api* other) {
void Method::InitAsDefaultInstance() {
}
-class Method::HasBitSetters {
+class Method::_Internal {
public:
};
@@ -832,15 +832,15 @@ Method::Method(const Method& from)
options_(from.options_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- if (from.name().size() > 0) {
+ if (!from.name().empty()) {
name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
}
request_type_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- if (from.request_type_url().size() > 0) {
+ if (!from.request_type_url().empty()) {
request_type_url_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.request_type_url_);
}
response_type_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- if (from.response_type_url().size() > 0) {
+ if (!from.response_type_url().empty()) {
response_type_url_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.response_type_url_);
}
::memcpy(&request_streaming_, &from.request_streaming_,
@@ -1402,7 +1402,7 @@ void Method::InternalSwap(Method* other) {
void Mixin::InitAsDefaultInstance() {
}
-class Mixin::HasBitSetters {
+class Mixin::_Internal {
public:
};
@@ -1421,11 +1421,11 @@ Mixin::Mixin(const Mixin& from)
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- if (from.name().size() > 0) {
+ if (!from.name().empty()) {
name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
}
root_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- if (from.root().size() > 0) {
+ if (!from.root().empty()) {
root_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.root_);
}
// @@protoc_insertion_point(copy_constructor:google.protobuf.Mixin)
diff --git a/src/google/protobuf/api.pb.h b/src/google/protobuf/api.pb.h
index 4853593bae..83beaa12e7 100644
--- a/src/google/protobuf/api.pb.h
+++ b/src/google/protobuf/api.pb.h
@@ -262,7 +262,7 @@ class PROTOBUF_EXPORT Api :
// @@protoc_insertion_point(class_scope:google.protobuf.Api)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Method > methods_;
@@ -454,7 +454,7 @@ class PROTOBUF_EXPORT Method :
// @@protoc_insertion_point(class_scope:google.protobuf.Method)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Option > options_;
@@ -604,7 +604,7 @@ class PROTOBUF_EXPORT Mixin :
// @@protoc_insertion_point(class_scope:google.protobuf.Mixin)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
diff --git a/src/google/protobuf/compiler/cpp/cpp_field.cc b/src/google/protobuf/compiler/cpp/cpp_field.cc
index 411136f3b9..137e133a2b 100644
--- a/src/google/protobuf/compiler/cpp/cpp_field.cc
+++ b/src/google/protobuf/compiler/cpp/cpp_field.cc
@@ -77,7 +77,7 @@ void SetCommonFieldVariables(const FieldDescriptor* descriptor,
(*variables)["clear_hasbit"] = "";
if (HasFieldPresence(descriptor->file())) {
(*variables)["set_hasbit_io"] =
- "HasBitSetters::set_has_" + FieldName(descriptor) + "(&_has_bits_);";
+ "_Internal::set_has_" + FieldName(descriptor) + "(&_has_bits_);";
} else {
(*variables)["set_hasbit_io"] = "";
}
diff --git a/src/google/protobuf/compiler/cpp/cpp_helpers.cc b/src/google/protobuf/compiler/cpp/cpp_helpers.cc
index 6a32c56474..4cec899b83 100644
--- a/src/google/protobuf/compiler/cpp/cpp_helpers.cc
+++ b/src/google/protobuf/compiler/cpp/cpp_helpers.cc
@@ -1381,7 +1381,7 @@ class ParseLoopGenerator {
// For now only optimize small hasbits.
if (hasbits_size != 1) hasbits_size = 0;
if (hasbits_size) {
- format_("HasBitSetters::HasBits has_bits{};\n");
+ format_("_Internal::HasBits has_bits{};\n");
format_.Set("has_bits", "has_bits");
} else {
format_.Set("has_bits", "_has_bits_");
@@ -1420,7 +1420,7 @@ class ParseLoopGenerator {
field_name = ", kFieldName";
}
if (HasFieldPresence(field->file())) {
- format_("HasBitSetters::set_has_$1$(&$has_bits$);\n", FieldName(field));
+ format_("_Internal::set_has_$1$(&$has_bits$);\n", FieldName(field));
}
string default_string =
field->default_value_string().empty()
@@ -1536,7 +1536,7 @@ class ParseLoopGenerator {
FieldName(field), field->containing_oneof()->name());
} else if (HasFieldPresence(field->file())) {
format_(
- "HasBitSetters::set_has_$1$(&$has_bits$);\n"
+ "_Internal::set_has_$1$(&$has_bits$);\n"
"ptr = ctx->ParseMessage(&$1$_, ptr);\n",
FieldName(field));
} else {
@@ -1546,7 +1546,7 @@ class ParseLoopGenerator {
} else if (IsImplicitWeakField(field, options_, scc_analyzer_)) {
if (!field->is_repeated()) {
format_(
- "ptr = ctx->ParseMessage(HasBitSetters::mutable_$1$(this), "
+ "ptr = ctx->ParseMessage(_Internal::mutable_$1$(this), "
"ptr);\n",
FieldName(field));
} else {
@@ -1633,7 +1633,7 @@ class ParseLoopGenerator {
prefix, FieldName(field), zigzag);
} else {
if (HasFieldPresence(field->file())) {
- format_("HasBitSetters::set_has_$1$(&$has_bits$);\n",
+ format_("_Internal::set_has_$1$(&$has_bits$);\n",
FieldName(field));
}
format_(
@@ -1655,8 +1655,7 @@ class ParseLoopGenerator {
prefix, FieldName(field), type);
} else {
if (HasFieldPresence(field->file())) {
- format_("HasBitSetters::set_has_$1$(&$has_bits$);\n",
- FieldName(field));
+ format_("_Internal::set_has_$1$(&$has_bits$);\n", FieldName(field));
}
format_(
"$1$_ = $pi_ns$::UnalignedLoad<$2$>(ptr);\n"
diff --git a/src/google/protobuf/compiler/cpp/cpp_message.cc b/src/google/protobuf/compiler/cpp/cpp_message.cc
index 1a01922cef..43dc0f57d0 100644
--- a/src/google/protobuf/compiler/cpp/cpp_message.cc
+++ b/src/google/protobuf/compiler/cpp/cpp_message.cc
@@ -1392,7 +1392,7 @@ void MessageGenerator::GenerateClassDefinition(io::Printer* printer) {
format(" private:\n");
format.Indent();
// TODO(seongkim): Remove hack to track field access and remove this class.
- format("class HasBitSetters;\n");
+ format("class _Internal;\n");
for (auto field : FieldRange(descriptor_)) {
@@ -1990,7 +1990,7 @@ void MessageGenerator::GenerateClassMethods(io::Printer* printer) {
}
format(
- "class $classname$::HasBitSetters {\n"
+ "class $classname$::_Internal {\n"
" public:\n");
format.Indent();
if (HasFieldPresence(descriptor_->file()) && HasBitsSize() != 0) {
diff --git a/src/google/protobuf/compiler/cpp/cpp_message_field.cc b/src/google/protobuf/compiler/cpp/cpp_message_field.cc
index 659e3faeb8..3007cc2a3b 100644
--- a/src/google/protobuf/compiler/cpp/cpp_message_field.cc
+++ b/src/google/protobuf/compiler/cpp/cpp_message_field.cc
@@ -269,7 +269,7 @@ void MessageFieldGenerator::GenerateInternalAccessorDeclarations(
void MessageFieldGenerator::GenerateInternalAccessorDefinitions(
io::Printer* printer) const {
- // In theory, these accessors could be inline in HasBitSetters. However, in
+ // In theory, these accessors could be inline in _Internal. However, in
// practice, the linker is then not able to throw them out making implicit
// weak dependencies not work at all.
Formatter format(printer, variables_);
@@ -278,7 +278,7 @@ void MessageFieldGenerator::GenerateInternalAccessorDefinitions(
// MergePartialFromCodedStream, and their purpose is to provide access to
// the field without creating a strong dependency on the message type.
format(
- "const ::$proto_ns$::MessageLite& $classname$::HasBitSetters::$name$(\n"
+ "const ::$proto_ns$::MessageLite& $classname$::_Internal::$name$(\n"
" const $classname$* msg) {\n"
" if (msg->$name$_ != nullptr) {\n"
" return *msg->$name$_;\n"
@@ -293,7 +293,7 @@ void MessageFieldGenerator::GenerateInternalAccessorDefinitions(
if (SupportsArenas(descriptor_)) {
format(
"::$proto_ns$::MessageLite*\n"
- "$classname$::HasBitSetters::mutable_$name$($classname$* msg) {\n");
+ "$classname$::_Internal::mutable_$name$($classname$* msg) {\n");
if (HasFieldPresence(descriptor_->file())) {
format(" msg->$set_hasbit$\n");
}
@@ -315,7 +315,7 @@ void MessageFieldGenerator::GenerateInternalAccessorDefinitions(
} else {
format(
"::$proto_ns$::MessageLite*\n"
- "$classname$::HasBitSetters::mutable_$name$($classname$* msg) {\n");
+ "$classname$::_Internal::mutable_$name$($classname$* msg) {\n");
if (HasFieldPresence(descriptor_->file())) {
format(" msg->$set_hasbit$\n");
}
@@ -339,7 +339,7 @@ void MessageFieldGenerator::GenerateInternalAccessorDefinitions(
// message fields under serialize.
format(
"const $type$&\n"
- "$classname$::HasBitSetters::$name$(const $classname$* msg) {\n"
+ "$classname$::_Internal::$name$(const $classname$* msg) {\n"
" return *msg->$field_member$;\n"
"}\n");
}
@@ -382,8 +382,8 @@ void MessageFieldGenerator::GenerateMergingCode(io::Printer* printer) const {
Formatter format(printer, variables_);
if (implicit_weak_field_) {
format(
- "HasBitSetters::mutable_$name$(this)->CheckTypeAndMergeFrom(\n"
- " HasBitSetters::$name$(&from));\n");
+ "_Internal::mutable_$name$(this)->CheckTypeAndMergeFrom(\n"
+ " _Internal::$name$(&from));\n");
} else {
format("mutable_$name$()->$type$::MergeFrom(from.$name$());\n");
}
@@ -430,7 +430,7 @@ void MessageFieldGenerator::GenerateMergeFromCodedStream(
if (implicit_weak_field_) {
format(
"DO_(::$proto_ns$::internal::WireFormatLite::ReadMessage(\n"
- " input, HasBitSetters::mutable_$name$(this)));\n");
+ " input, _Internal::mutable_$name$(this)));\n");
} else if (descriptor_->type() == FieldDescriptor::TYPE_MESSAGE) {
format(
"DO_(::$proto_ns$::internal::WireFormatLite::ReadMessage(\n"
@@ -447,7 +447,7 @@ void MessageFieldGenerator::GenerateSerializeWithCachedSizes(
Formatter format(printer, variables_);
format(
"::$proto_ns$::internal::WireFormatLite::Write$stream_writer$(\n"
- " $number$, HasBitSetters::$name$(this), output);\n");
+ " $number$, _Internal::$name$(this), output);\n");
}
void MessageFieldGenerator::GenerateSerializeWithCachedSizesToArray(
@@ -456,7 +456,7 @@ void MessageFieldGenerator::GenerateSerializeWithCachedSizesToArray(
format(
"target = ::$proto_ns$::internal::WireFormatLite::\n"
" InternalWrite$declared_type$ToArray(\n"
- " $number$, HasBitSetters::$name$(this), target);\n");
+ " $number$, _Internal::$name$(this), target);\n");
}
void MessageFieldGenerator::GenerateByteSize(io::Printer* printer) const {
diff --git a/src/google/protobuf/compiler/cpp/cpp_string_field.cc b/src/google/protobuf/compiler/cpp/cpp_string_field.cc
index bd25d7a84e..1f14b16dc1 100644
--- a/src/google/protobuf/compiler/cpp/cpp_string_field.cc
+++ b/src/google/protobuf/compiler/cpp/cpp_string_field.cc
@@ -519,7 +519,7 @@ void StringFieldGenerator::GenerateCopyConstructorCode(
if (HasFieldPresence(descriptor_->file())) {
format("if (from.has_$name$()) {\n");
} else {
- format("if (from.$name$().size() > 0) {\n");
+ format("if (!from.$name$().empty()) {\n");
}
format.Indent();
diff --git a/src/google/protobuf/compiler/parser.cc b/src/google/protobuf/compiler/parser.cc
index 235c10249b..1c0efda18d 100644
--- a/src/google/protobuf/compiler/parser.cc
+++ b/src/google/protobuf/compiler/parser.cc
@@ -157,6 +157,16 @@ bool IsLowerUnderscore(const string& name) {
return true;
}
+bool IsNumberFollowUnderscore(const string& name) {
+ for (int i = 1; i < name.length(); i++) {
+ const char c = name[i];
+ if (IsNumber(c) && name[i - 1] == '_') {
+ return true;
+ }
+ }
+ return false;
+}
+
} // anonymous namespace
// Makes code slightly more readable. The meaning of "DO(foo)" is
@@ -1004,6 +1014,12 @@ bool Parser::ParseMessageFieldNoLabel(
"Field name should be lowercase. Found: " + field->name() +
". See: https://developers.google.com/protocol-buffers/docs/style");
}
+ if (IsNumberFollowUnderscore(field->name())) {
+ AddWarning(
+ "Number should not come right after an underscore. Found: " +
+ field->name() +
+ ". See: https://developers.google.com/protocol-buffers/docs/style");
+ }
}
DO(Consume("=", "Missing field number."));
diff --git a/src/google/protobuf/compiler/parser_unittest.cc b/src/google/protobuf/compiler/parser_unittest.cc
index 80e01a50cf..43784cb321 100644
--- a/src/google/protobuf/compiler/parser_unittest.cc
+++ b/src/google/protobuf/compiler/parser_unittest.cc
@@ -65,9 +65,15 @@ class MockErrorCollector : public io::ErrorCollector {
MockErrorCollector() = default;
~MockErrorCollector() override = default;
+ std::string warning_;
std::string text_;
// implements ErrorCollector ---------------------------------------
+ void AddWarning(int line, int column, const std::string& message) override {
+ strings::SubstituteAndAppend(&warning_, "$0:$1: $2\n", line, column,
+ message);
+ }
+
void AddError(int line, int column, const std::string& message) override {
strings::SubstituteAndAppend(&text_, "$0:$1: $2\n", line, column, message);
}
@@ -223,6 +229,43 @@ TEST_F(ParserTest, WarnIfSyntaxIdentifierOmmitted) {
string::npos);
}
+TEST_F(ParserTest, WarnIfFieldNameIsNotUpperCamel) {
+ SetupParser(
+ "syntax = \"proto2\";"
+ "message abc {}");
+ FileDescriptorProto file;
+ EXPECT_TRUE(parser_->Parse(input_.get(), &file));
+ EXPECT_TRUE(error_collector_.warning_.find(
+ "Message name should be in UpperCamelCase. Found: abc.") !=
+ string::npos);
+}
+
+TEST_F(ParserTest, WarnIfFieldNameIsNotLowerUnderscore) {
+ SetupParser(
+ "syntax = \"proto2\";"
+ "message A {"
+ " optional string SongName = 1;"
+ "}");
+ FileDescriptorProto file;
+ EXPECT_TRUE(parser_->Parse(input_.get(), &file));
+ EXPECT_TRUE(error_collector_.warning_.find(
+ "Field name should be lowercase. Found: SongName") !=
+ string::npos);
+}
+
+TEST_F(ParserTest, WarnIfFieldNameContainsNumberImmediatelyFollowUnderscore) {
+ SetupParser(
+ "syntax = \"proto2\";"
+ "message A {"
+ " optional string song_name_1 = 1;"
+ "}");
+ FileDescriptorProto file;
+ EXPECT_TRUE(parser_->Parse(input_.get(), &file));
+ EXPECT_TRUE(error_collector_.warning_.find(
+ "Number should not come right after an underscore. Found: "
+ "song_name_1.") != string::npos);
+}
+
// ===================================================================
typedef ParserTest ParseMessageTest;
diff --git a/src/google/protobuf/compiler/plugin.pb.cc b/src/google/protobuf/compiler/plugin.pb.cc
index 7b0d9e65e7..e027234585 100644
--- a/src/google/protobuf/compiler/plugin.pb.cc
+++ b/src/google/protobuf/compiler/plugin.pb.cc
@@ -208,7 +208,7 @@ namespace compiler {
void Version::InitAsDefaultInstance() {
}
-class Version::HasBitSetters {
+class Version::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
static void set_has_major(HasBits* has_bits) {
@@ -300,7 +300,7 @@ void Version::Clear() {
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* Version::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
- HasBitSetters::HasBits has_bits{};
+ _Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
@@ -309,7 +309,7 @@ const char* Version::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::in
// optional int32 major = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
- HasBitSetters::set_has_major(&has_bits);
+ _Internal::set_has_major(&has_bits);
major_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -317,7 +317,7 @@ const char* Version::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::in
// optional int32 minor = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
- HasBitSetters::set_has_minor(&has_bits);
+ _Internal::set_has_minor(&has_bits);
minor_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -325,7 +325,7 @@ const char* Version::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::in
// optional int32 patch = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
- HasBitSetters::set_has_patch(&has_bits);
+ _Internal::set_has_patch(&has_bits);
patch_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -371,7 +371,7 @@ bool Version::MergePartialFromCodedStream(
// optional int32 major = 1;
case 1: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) {
- HasBitSetters::set_has_major(&_has_bits_);
+ _Internal::set_has_major(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
input, &major_)));
@@ -384,7 +384,7 @@ bool Version::MergePartialFromCodedStream(
// optional int32 minor = 2;
case 2: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) {
- HasBitSetters::set_has_minor(&_has_bits_);
+ _Internal::set_has_minor(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
input, &minor_)));
@@ -397,7 +397,7 @@ bool Version::MergePartialFromCodedStream(
// optional int32 patch = 3;
case 3: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) {
- HasBitSetters::set_has_patch(&_has_bits_);
+ _Internal::set_has_patch(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
input, &patch_)));
@@ -657,7 +657,7 @@ void CodeGeneratorRequest::InitAsDefaultInstance() {
PROTOBUF_NAMESPACE_ID::compiler::_CodeGeneratorRequest_default_instance_._instance.get_mutable()->compiler_version_ = const_cast< PROTOBUF_NAMESPACE_ID::compiler::Version*>(
PROTOBUF_NAMESPACE_ID::compiler::Version::internal_default_instance());
}
-class CodeGeneratorRequest::HasBitSetters {
+class CodeGeneratorRequest::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
static void set_has_parameter(HasBits* has_bits) {
@@ -670,7 +670,7 @@ class CodeGeneratorRequest::HasBitSetters {
};
const PROTOBUF_NAMESPACE_ID::compiler::Version&
-CodeGeneratorRequest::HasBitSetters::compiler_version(const CodeGeneratorRequest* msg) {
+CodeGeneratorRequest::_Internal::compiler_version(const CodeGeneratorRequest* msg) {
return *msg->compiler_version_;
}
void CodeGeneratorRequest::clear_proto_file() {
@@ -757,7 +757,7 @@ void CodeGeneratorRequest::Clear() {
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* CodeGeneratorRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
- HasBitSetters::HasBits has_bits{};
+ _Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
@@ -936,7 +936,7 @@ void CodeGeneratorRequest::SerializeWithCachedSizes(
// optional .google.protobuf.compiler.Version compiler_version = 3;
if (cached_has_bits & 0x00000002u) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
- 3, HasBitSetters::compiler_version(this), output);
+ 3, _Internal::compiler_version(this), output);
}
// repeated .google.protobuf.FileDescriptorProto proto_file = 15;
@@ -987,7 +987,7 @@ void CodeGeneratorRequest::SerializeWithCachedSizes(
if (cached_has_bits & 0x00000002u) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
- 3, HasBitSetters::compiler_version(this), target);
+ 3, _Internal::compiler_version(this), target);
}
// repeated .google.protobuf.FileDescriptorProto proto_file = 15;
@@ -1139,7 +1139,7 @@ void CodeGeneratorRequest::InternalSwap(CodeGeneratorRequest* other) {
void CodeGeneratorResponse_File::InitAsDefaultInstance() {
}
-class CodeGeneratorResponse_File::HasBitSetters {
+class CodeGeneratorResponse_File::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
static void set_has_name(HasBits* has_bits) {
@@ -1236,7 +1236,7 @@ void CodeGeneratorResponse_File::Clear() {
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* CodeGeneratorResponse_File::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
- HasBitSetters::HasBits has_bits{};
+ _Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
@@ -1576,7 +1576,7 @@ void CodeGeneratorResponse_File::InternalSwap(CodeGeneratorResponse_File* other)
void CodeGeneratorResponse::InitAsDefaultInstance() {
}
-class CodeGeneratorResponse::HasBitSetters {
+class CodeGeneratorResponse::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
static void set_has_error(HasBits* has_bits) {
@@ -1648,7 +1648,7 @@ void CodeGeneratorResponse::Clear() {
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* CodeGeneratorResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
- HasBitSetters::HasBits has_bits{};
+ _Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
diff --git a/src/google/protobuf/compiler/plugin.pb.h b/src/google/protobuf/compiler/plugin.pb.h
index 9ebd29e13a..7e46231ab5 100644
--- a/src/google/protobuf/compiler/plugin.pb.h
+++ b/src/google/protobuf/compiler/plugin.pb.h
@@ -240,7 +240,7 @@ class PROTOC_EXPORT Version :
// @@protoc_insertion_point(class_scope:google.protobuf.compiler.Version)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
@@ -423,7 +423,7 @@ class PROTOC_EXPORT CodeGeneratorRequest :
// @@protoc_insertion_point(class_scope:google.protobuf.compiler.CodeGeneratorRequest)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
@@ -593,7 +593,7 @@ class PROTOC_EXPORT CodeGeneratorResponse_File :
// @@protoc_insertion_point(class_scope:google.protobuf.compiler.CodeGeneratorResponse.File)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
@@ -750,7 +750,7 @@ class PROTOC_EXPORT CodeGeneratorResponse :
// @@protoc_insertion_point(class_scope:google.protobuf.compiler.CodeGeneratorResponse)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
diff --git a/src/google/protobuf/descriptor.pb.cc b/src/google/protobuf/descriptor.pb.cc
index 892b9c93e0..be3a706219 100644
--- a/src/google/protobuf/descriptor.pb.cc
+++ b/src/google/protobuf/descriptor.pb.cc
@@ -1381,7 +1381,7 @@ constexpr int MethodOptions::IdempotencyLevel_ARRAYSIZE;
void FileDescriptorSet::InitAsDefaultInstance() {
}
-class FileDescriptorSet::HasBitSetters {
+class FileDescriptorSet::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
};
@@ -1690,7 +1690,7 @@ void FileDescriptorProto::InitAsDefaultInstance() {
PROTOBUF_NAMESPACE_ID::_FileDescriptorProto_default_instance_._instance.get_mutable()->source_code_info_ = const_cast< PROTOBUF_NAMESPACE_ID::SourceCodeInfo*>(
PROTOBUF_NAMESPACE_ID::SourceCodeInfo::internal_default_instance());
}
-class FileDescriptorProto::HasBitSetters {
+class FileDescriptorProto::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
static void set_has_name(HasBits* has_bits) {
@@ -1713,11 +1713,11 @@ class FileDescriptorProto::HasBitSetters {
};
const PROTOBUF_NAMESPACE_ID::FileOptions&
-FileDescriptorProto::HasBitSetters::options(const FileDescriptorProto* msg) {
+FileDescriptorProto::_Internal::options(const FileDescriptorProto* msg) {
return *msg->options_;
}
const PROTOBUF_NAMESPACE_ID::SourceCodeInfo&
-FileDescriptorProto::HasBitSetters::source_code_info(const FileDescriptorProto* msg) {
+FileDescriptorProto::_Internal::source_code_info(const FileDescriptorProto* msg) {
return *msg->source_code_info_;
}
void FileDescriptorProto::unsafe_arena_set_allocated_options(
@@ -1899,7 +1899,7 @@ void FileDescriptorProto::Clear() {
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* FileDescriptorProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
- HasBitSetters::HasBits has_bits{};
+ _Internal::HasBits has_bits{};
::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
@@ -2318,13 +2318,13 @@ void FileDescriptorProto::SerializeWithCachedSizes(
// optional .google.protobuf.FileOptions options = 8;
if (cached_has_bits & 0x00000008u) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
- 8, HasBitSetters::options(this), output);
+ 8, _Internal::options(this), output);
}
// optional .google.protobuf.SourceCodeInfo source_code_info = 9;
if (cached_has_bits & 0x00000010u) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
- 9, HasBitSetters::source_code_info(this), output);
+ 9, _Internal::source_code_info(this), output);
}
// repeated int32 public_dependency = 10;
@@ -2431,14 +2431,14 @@ void FileDescriptorProto::SerializeWithCachedSizes(
if (cached_has_bits & 0x00000008u) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
- 8, HasBitSetters::options(this), target);
+ 8, _Internal::options(this), target);
}
// optional .google.protobuf.SourceCodeInfo source_code_info = 9;
if (cached_has_bits & 0x00000010u) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
- 9, HasBitSetters::source_code_info(this), target);
+ 9, _Internal::source_code_info(this), target);
}
// repeated int32 public_dependency = 10;
@@ -2719,7 +2719,7 @@ void DescriptorProto_ExtensionRange::InitAsDefaultInstance() {
PROTOBUF_NAMESPACE_ID::_DescriptorProto_ExtensionRange_default_instance_._instance.get_mutable()->options_ = const_cast< PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions*>(
PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions::internal_default_instance());
}
-class DescriptorProto_ExtensionRange::HasBitSetters {
+class DescriptorProto_ExtensionRange::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
static void set_has_start(HasBits* has_bits) {
@@ -2735,7 +2735,7 @@ class DescriptorProto_ExtensionRange::HasBitSetters {
};
const PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions&
-DescriptorProto_ExtensionRange::HasBitSetters::options(const DescriptorProto_ExtensionRange* msg) {
+DescriptorProto_ExtensionRange::_Internal::options(const DescriptorProto_ExtensionRange* msg) {
return *msg->options_;
}
void DescriptorProto_ExtensionRange::unsafe_arena_set_allocated_options(
@@ -2840,7 +2840,7 @@ void DescriptorProto_ExtensionRange::Clear() {
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* DescriptorProto_ExtensionRange::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
- HasBitSetters::HasBits has_bits{};
+ _Internal::HasBits has_bits{};
::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
@@ -2850,7 +2850,7 @@ const char* DescriptorProto_ExtensionRange::_InternalParse(const char* ptr, ::PR
// optional int32 start = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
- HasBitSetters::set_has_start(&has_bits);
+ _Internal::set_has_start(&has_bits);
start_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -2858,7 +2858,7 @@ const char* DescriptorProto_ExtensionRange::_InternalParse(const char* ptr, ::PR
// optional int32 end = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
- HasBitSetters::set_has_end(&has_bits);
+ _Internal::set_has_end(&has_bits);
end_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -2904,7 +2904,7 @@ bool DescriptorProto_ExtensionRange::MergePartialFromCodedStream(
// optional int32 start = 1;
case 1: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) {
- HasBitSetters::set_has_start(&_has_bits_);
+ _Internal::set_has_start(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
input, &start_)));
@@ -2917,7 +2917,7 @@ bool DescriptorProto_ExtensionRange::MergePartialFromCodedStream(
// optional int32 end = 2;
case 2: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) {
- HasBitSetters::set_has_end(&_has_bits_);
+ _Internal::set_has_end(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
input, &end_)));
@@ -2979,7 +2979,7 @@ void DescriptorProto_ExtensionRange::SerializeWithCachedSizes(
// optional .google.protobuf.ExtensionRangeOptions options = 3;
if (cached_has_bits & 0x00000001u) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
- 3, HasBitSetters::options(this), output);
+ 3, _Internal::options(this), output);
}
if (_internal_metadata_.have_unknown_fields()) {
@@ -3010,7 +3010,7 @@ void DescriptorProto_ExtensionRange::SerializeWithCachedSizes(
if (cached_has_bits & 0x00000001u) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
- 3, HasBitSetters::options(this), target);
+ 3, _Internal::options(this), target);
}
if (_internal_metadata_.have_unknown_fields()) {
@@ -3158,7 +3158,7 @@ void DescriptorProto_ExtensionRange::InternalSwap(DescriptorProto_ExtensionRange
void DescriptorProto_ReservedRange::InitAsDefaultInstance() {
}
-class DescriptorProto_ReservedRange::HasBitSetters {
+class DescriptorProto_ReservedRange::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
static void set_has_start(HasBits* has_bits) {
@@ -3246,7 +3246,7 @@ void DescriptorProto_ReservedRange::Clear() {
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* DescriptorProto_ReservedRange::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
- HasBitSetters::HasBits has_bits{};
+ _Internal::HasBits has_bits{};
::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
@@ -3256,7 +3256,7 @@ const char* DescriptorProto_ReservedRange::_InternalParse(const char* ptr, ::PRO
// optional int32 start = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
- HasBitSetters::set_has_start(&has_bits);
+ _Internal::set_has_start(&has_bits);
start_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -3264,7 +3264,7 @@ const char* DescriptorProto_ReservedRange::_InternalParse(const char* ptr, ::PRO
// optional int32 end = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
- HasBitSetters::set_has_end(&has_bits);
+ _Internal::set_has_end(&has_bits);
end_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -3303,7 +3303,7 @@ bool DescriptorProto_ReservedRange::MergePartialFromCodedStream(
// optional int32 start = 1;
case 1: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) {
- HasBitSetters::set_has_start(&_has_bits_);
+ _Internal::set_has_start(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
input, &start_)));
@@ -3316,7 +3316,7 @@ bool DescriptorProto_ReservedRange::MergePartialFromCodedStream(
// optional int32 end = 2;
case 2: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) {
- HasBitSetters::set_has_end(&_has_bits_);
+ _Internal::set_has_end(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
input, &end_)));
@@ -3521,7 +3521,7 @@ void DescriptorProto::InitAsDefaultInstance() {
PROTOBUF_NAMESPACE_ID::_DescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< PROTOBUF_NAMESPACE_ID::MessageOptions*>(
PROTOBUF_NAMESPACE_ID::MessageOptions::internal_default_instance());
}
-class DescriptorProto::HasBitSetters {
+class DescriptorProto::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
static void set_has_name(HasBits* has_bits) {
@@ -3534,7 +3534,7 @@ class DescriptorProto::HasBitSetters {
};
const PROTOBUF_NAMESPACE_ID::MessageOptions&
-DescriptorProto::HasBitSetters::options(const DescriptorProto* msg) {
+DescriptorProto::_Internal::options(const DescriptorProto* msg) {
return *msg->options_;
}
void DescriptorProto::unsafe_arena_set_allocated_options(
@@ -3672,7 +3672,7 @@ void DescriptorProto::Clear() {
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* DescriptorProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
- HasBitSetters::HasBits has_bits{};
+ _Internal::HasBits has_bits{};
::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
@@ -4025,7 +4025,7 @@ void DescriptorProto::SerializeWithCachedSizes(
// optional .google.protobuf.MessageOptions options = 7;
if (cached_has_bits & 0x00000002u) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
- 7, HasBitSetters::options(this), output);
+ 7, _Internal::options(this), output);
}
// repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8;
@@ -4125,7 +4125,7 @@ void DescriptorProto::SerializeWithCachedSizes(
if (cached_has_bits & 0x00000002u) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
- 7, HasBitSetters::options(this), target);
+ 7, _Internal::options(this), target);
}
// repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8;
@@ -4395,7 +4395,7 @@ void DescriptorProto::InternalSwap(DescriptorProto* other) {
void ExtensionRangeOptions::InitAsDefaultInstance() {
}
-class ExtensionRangeOptions::HasBitSetters {
+class ExtensionRangeOptions::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
};
@@ -4732,7 +4732,7 @@ void FieldDescriptorProto::InitAsDefaultInstance() {
PROTOBUF_NAMESPACE_ID::_FieldDescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< PROTOBUF_NAMESPACE_ID::FieldOptions*>(
PROTOBUF_NAMESPACE_ID::FieldOptions::internal_default_instance());
}
-class FieldDescriptorProto::HasBitSetters {
+class FieldDescriptorProto::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
static void set_has_name(HasBits* has_bits) {
@@ -4769,7 +4769,7 @@ class FieldDescriptorProto::HasBitSetters {
};
const PROTOBUF_NAMESPACE_ID::FieldOptions&
-FieldDescriptorProto::HasBitSetters::options(const FieldDescriptorProto* msg) {
+FieldDescriptorProto::_Internal::options(const FieldDescriptorProto* msg) {
return *msg->options_;
}
void FieldDescriptorProto::unsafe_arena_set_allocated_options(
@@ -4939,7 +4939,7 @@ void FieldDescriptorProto::Clear() {
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* FieldDescriptorProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
- HasBitSetters::HasBits has_bits{};
+ _Internal::HasBits has_bits{};
::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
@@ -4963,7 +4963,7 @@ const char* FieldDescriptorProto::_InternalParse(const char* ptr, ::PROTOBUF_NAM
// optional int32 number = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
- HasBitSetters::set_has_number(&has_bits);
+ _Internal::set_has_number(&has_bits);
number_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -5016,7 +5016,7 @@ const char* FieldDescriptorProto::_InternalParse(const char* ptr, ::PROTOBUF_NAM
// optional int32 oneof_index = 9;
case 9:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 72)) {
- HasBitSetters::set_has_oneof_index(&has_bits);
+ _Internal::set_has_oneof_index(&has_bits);
oneof_index_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -5092,7 +5092,7 @@ bool FieldDescriptorProto::MergePartialFromCodedStream(
// optional int32 number = 3;
case 3: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) {
- HasBitSetters::set_has_number(&_has_bits_);
+ _Internal::set_has_number(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
input, &number_)));
@@ -5184,7 +5184,7 @@ bool FieldDescriptorProto::MergePartialFromCodedStream(
// optional int32 oneof_index = 9;
case 9: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (72 & 0xFF)) {
- HasBitSetters::set_has_oneof_index(&_has_bits_);
+ _Internal::set_has_oneof_index(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
input, &oneof_index_)));
@@ -5297,7 +5297,7 @@ void FieldDescriptorProto::SerializeWithCachedSizes(
// optional .google.protobuf.FieldOptions options = 8;
if (cached_has_bits & 0x00000020u) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
- 8, HasBitSetters::options(this), output);
+ 8, _Internal::options(this), output);
}
// optional int32 oneof_index = 9;
@@ -5394,7 +5394,7 @@ void FieldDescriptorProto::SerializeWithCachedSizes(
if (cached_has_bits & 0x00000020u) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
- 8, HasBitSetters::options(this), target);
+ 8, _Internal::options(this), target);
}
// optional int32 oneof_index = 9;
@@ -5645,7 +5645,7 @@ void OneofDescriptorProto::InitAsDefaultInstance() {
PROTOBUF_NAMESPACE_ID::_OneofDescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< PROTOBUF_NAMESPACE_ID::OneofOptions*>(
PROTOBUF_NAMESPACE_ID::OneofOptions::internal_default_instance());
}
-class OneofDescriptorProto::HasBitSetters {
+class OneofDescriptorProto::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
static void set_has_name(HasBits* has_bits) {
@@ -5658,7 +5658,7 @@ class OneofDescriptorProto::HasBitSetters {
};
const PROTOBUF_NAMESPACE_ID::OneofOptions&
-OneofDescriptorProto::HasBitSetters::options(const OneofDescriptorProto* msg) {
+OneofDescriptorProto::_Internal::options(const OneofDescriptorProto* msg) {
return *msg->options_;
}
void OneofDescriptorProto::unsafe_arena_set_allocated_options(
@@ -5764,7 +5764,7 @@ void OneofDescriptorProto::Clear() {
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* OneofDescriptorProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
- HasBitSetters::HasBits has_bits{};
+ _Internal::HasBits has_bits{};
::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
@@ -5883,7 +5883,7 @@ void OneofDescriptorProto::SerializeWithCachedSizes(
// optional .google.protobuf.OneofOptions options = 2;
if (cached_has_bits & 0x00000002u) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
- 2, HasBitSetters::options(this), output);
+ 2, _Internal::options(this), output);
}
if (_internal_metadata_.have_unknown_fields()) {
@@ -5915,7 +5915,7 @@ void OneofDescriptorProto::SerializeWithCachedSizes(
if (cached_has_bits & 0x00000002u) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
- 2, HasBitSetters::options(this), target);
+ 2, _Internal::options(this), target);
}
if (_internal_metadata_.have_unknown_fields()) {
@@ -6052,7 +6052,7 @@ void OneofDescriptorProto::InternalSwap(OneofDescriptorProto* other) {
void EnumDescriptorProto_EnumReservedRange::InitAsDefaultInstance() {
}
-class EnumDescriptorProto_EnumReservedRange::HasBitSetters {
+class EnumDescriptorProto_EnumReservedRange::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
static void set_has_start(HasBits* has_bits) {
@@ -6140,7 +6140,7 @@ void EnumDescriptorProto_EnumReservedRange::Clear() {
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* EnumDescriptorProto_EnumReservedRange::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
- HasBitSetters::HasBits has_bits{};
+ _Internal::HasBits has_bits{};
::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
@@ -6150,7 +6150,7 @@ const char* EnumDescriptorProto_EnumReservedRange::_InternalParse(const char* pt
// optional int32 start = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
- HasBitSetters::set_has_start(&has_bits);
+ _Internal::set_has_start(&has_bits);
start_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -6158,7 +6158,7 @@ const char* EnumDescriptorProto_EnumReservedRange::_InternalParse(const char* pt
// optional int32 end = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
- HasBitSetters::set_has_end(&has_bits);
+ _Internal::set_has_end(&has_bits);
end_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -6197,7 +6197,7 @@ bool EnumDescriptorProto_EnumReservedRange::MergePartialFromCodedStream(
// optional int32 start = 1;
case 1: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) {
- HasBitSetters::set_has_start(&_has_bits_);
+ _Internal::set_has_start(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
input, &start_)));
@@ -6210,7 +6210,7 @@ bool EnumDescriptorProto_EnumReservedRange::MergePartialFromCodedStream(
// optional int32 end = 2;
case 2: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) {
- HasBitSetters::set_has_end(&_has_bits_);
+ _Internal::set_has_end(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
input, &end_)));
@@ -6415,7 +6415,7 @@ void EnumDescriptorProto::InitAsDefaultInstance() {
PROTOBUF_NAMESPACE_ID::_EnumDescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< PROTOBUF_NAMESPACE_ID::EnumOptions*>(
PROTOBUF_NAMESPACE_ID::EnumOptions::internal_default_instance());
}
-class EnumDescriptorProto::HasBitSetters {
+class EnumDescriptorProto::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
static void set_has_name(HasBits* has_bits) {
@@ -6428,7 +6428,7 @@ class EnumDescriptorProto::HasBitSetters {
};
const PROTOBUF_NAMESPACE_ID::EnumOptions&
-EnumDescriptorProto::HasBitSetters::options(const EnumDescriptorProto* msg) {
+EnumDescriptorProto::_Internal::options(const EnumDescriptorProto* msg) {
return *msg->options_;
}
void EnumDescriptorProto::unsafe_arena_set_allocated_options(
@@ -6546,7 +6546,7 @@ void EnumDescriptorProto::Clear() {
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* EnumDescriptorProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
- HasBitSetters::HasBits has_bits{};
+ _Internal::HasBits has_bits{};
::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
@@ -6748,7 +6748,7 @@ void EnumDescriptorProto::SerializeWithCachedSizes(
// optional .google.protobuf.EnumOptions options = 3;
if (cached_has_bits & 0x00000002u) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
- 3, HasBitSetters::options(this), output);
+ 3, _Internal::options(this), output);
}
// repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4;
@@ -6807,7 +6807,7 @@ void EnumDescriptorProto::SerializeWithCachedSizes(
if (cached_has_bits & 0x00000002u) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
- 3, HasBitSetters::options(this), target);
+ 3, _Internal::options(this), target);
}
// repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4;
@@ -7001,7 +7001,7 @@ void EnumValueDescriptorProto::InitAsDefaultInstance() {
PROTOBUF_NAMESPACE_ID::_EnumValueDescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< PROTOBUF_NAMESPACE_ID::EnumValueOptions*>(
PROTOBUF_NAMESPACE_ID::EnumValueOptions::internal_default_instance());
}
-class EnumValueDescriptorProto::HasBitSetters {
+class EnumValueDescriptorProto::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
static void set_has_name(HasBits* has_bits) {
@@ -7017,7 +7017,7 @@ class EnumValueDescriptorProto::HasBitSetters {
};
const PROTOBUF_NAMESPACE_ID::EnumValueOptions&
-EnumValueDescriptorProto::HasBitSetters::options(const EnumValueDescriptorProto* msg) {
+EnumValueDescriptorProto::_Internal::options(const EnumValueDescriptorProto* msg) {
return *msg->options_;
}
void EnumValueDescriptorProto::unsafe_arena_set_allocated_options(
@@ -7128,7 +7128,7 @@ void EnumValueDescriptorProto::Clear() {
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* EnumValueDescriptorProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
- HasBitSetters::HasBits has_bits{};
+ _Internal::HasBits has_bits{};
::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
@@ -7145,7 +7145,7 @@ const char* EnumValueDescriptorProto::_InternalParse(const char* ptr, ::PROTOBUF
// optional int32 number = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
- HasBitSetters::set_has_number(&has_bits);
+ _Internal::set_has_number(&has_bits);
number_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -7206,7 +7206,7 @@ bool EnumValueDescriptorProto::MergePartialFromCodedStream(
// optional int32 number = 2;
case 2: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) {
- HasBitSetters::set_has_number(&_has_bits_);
+ _Internal::set_has_number(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
input, &number_)));
@@ -7273,7 +7273,7 @@ void EnumValueDescriptorProto::SerializeWithCachedSizes(
// optional .google.protobuf.EnumValueOptions options = 3;
if (cached_has_bits & 0x00000002u) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
- 3, HasBitSetters::options(this), output);
+ 3, _Internal::options(this), output);
}
if (_internal_metadata_.have_unknown_fields()) {
@@ -7310,7 +7310,7 @@ void EnumValueDescriptorProto::SerializeWithCachedSizes(
if (cached_has_bits & 0x00000002u) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
- 3, HasBitSetters::options(this), target);
+ 3, _Internal::options(this), target);
}
if (_internal_metadata_.have_unknown_fields()) {
@@ -7461,7 +7461,7 @@ void ServiceDescriptorProto::InitAsDefaultInstance() {
PROTOBUF_NAMESPACE_ID::_ServiceDescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< PROTOBUF_NAMESPACE_ID::ServiceOptions*>(
PROTOBUF_NAMESPACE_ID::ServiceOptions::internal_default_instance());
}
-class ServiceDescriptorProto::HasBitSetters {
+class ServiceDescriptorProto::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
static void set_has_name(HasBits* has_bits) {
@@ -7474,7 +7474,7 @@ class ServiceDescriptorProto::HasBitSetters {
};
const PROTOBUF_NAMESPACE_ID::ServiceOptions&
-ServiceDescriptorProto::HasBitSetters::options(const ServiceDescriptorProto* msg) {
+ServiceDescriptorProto::_Internal::options(const ServiceDescriptorProto* msg) {
return *msg->options_;
}
void ServiceDescriptorProto::unsafe_arena_set_allocated_options(
@@ -7584,7 +7584,7 @@ void ServiceDescriptorProto::Clear() {
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* ServiceDescriptorProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
- HasBitSetters::HasBits has_bits{};
+ _Internal::HasBits has_bits{};
::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
@@ -7735,7 +7735,7 @@ void ServiceDescriptorProto::SerializeWithCachedSizes(
// optional .google.protobuf.ServiceOptions options = 3;
if (cached_has_bits & 0x00000002u) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
- 3, HasBitSetters::options(this), output);
+ 3, _Internal::options(this), output);
}
if (_internal_metadata_.have_unknown_fields()) {
@@ -7775,7 +7775,7 @@ void ServiceDescriptorProto::SerializeWithCachedSizes(
if (cached_has_bits & 0x00000002u) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
- 3, HasBitSetters::options(this), target);
+ 3, _Internal::options(this), target);
}
if (_internal_metadata_.have_unknown_fields()) {
@@ -7928,7 +7928,7 @@ void MethodDescriptorProto::InitAsDefaultInstance() {
PROTOBUF_NAMESPACE_ID::_MethodDescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< PROTOBUF_NAMESPACE_ID::MethodOptions*>(
PROTOBUF_NAMESPACE_ID::MethodOptions::internal_default_instance());
}
-class MethodDescriptorProto::HasBitSetters {
+class MethodDescriptorProto::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
static void set_has_name(HasBits* has_bits) {
@@ -7953,7 +7953,7 @@ class MethodDescriptorProto::HasBitSetters {
};
const PROTOBUF_NAMESPACE_ID::MethodOptions&
-MethodDescriptorProto::HasBitSetters::options(const MethodDescriptorProto* msg) {
+MethodDescriptorProto::_Internal::options(const MethodDescriptorProto* msg) {
return *msg->options_;
}
void MethodDescriptorProto::unsafe_arena_set_allocated_options(
@@ -8091,7 +8091,7 @@ void MethodDescriptorProto::Clear() {
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* MethodDescriptorProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
- HasBitSetters::HasBits has_bits{};
+ _Internal::HasBits has_bits{};
::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
@@ -8129,7 +8129,7 @@ const char* MethodDescriptorProto::_InternalParse(const char* ptr, ::PROTOBUF_NA
// optional bool client_streaming = 5 [default = false];
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
- HasBitSetters::set_has_client_streaming(&has_bits);
+ _Internal::set_has_client_streaming(&has_bits);
client_streaming_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -8137,7 +8137,7 @@ const char* MethodDescriptorProto::_InternalParse(const char* ptr, ::PROTOBUF_NA
// optional bool server_streaming = 6 [default = false];
case 6:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) {
- HasBitSetters::set_has_server_streaming(&has_bits);
+ _Internal::set_has_server_streaming(&has_bits);
server_streaming_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -8232,7 +8232,7 @@ bool MethodDescriptorProto::MergePartialFromCodedStream(
// optional bool client_streaming = 5 [default = false];
case 5: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) {
- HasBitSetters::set_has_client_streaming(&_has_bits_);
+ _Internal::set_has_client_streaming(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
input, &client_streaming_)));
@@ -8245,7 +8245,7 @@ bool MethodDescriptorProto::MergePartialFromCodedStream(
// optional bool server_streaming = 6 [default = false];
case 6: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (48 & 0xFF)) {
- HasBitSetters::set_has_server_streaming(&_has_bits_);
+ _Internal::set_has_server_streaming(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
input, &server_streaming_)));
@@ -8316,7 +8316,7 @@ void MethodDescriptorProto::SerializeWithCachedSizes(
// optional .google.protobuf.MethodOptions options = 4;
if (cached_has_bits & 0x00000008u) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
- 4, HasBitSetters::options(this), output);
+ 4, _Internal::options(this), output);
}
// optional bool client_streaming = 5 [default = false];
@@ -8380,7 +8380,7 @@ void MethodDescriptorProto::SerializeWithCachedSizes(
if (cached_has_bits & 0x00000008u) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
- 4, HasBitSetters::options(this), target);
+ 4, _Internal::options(this), target);
}
// optional bool client_streaming = 5 [default = false];
@@ -8570,7 +8570,7 @@ void MethodDescriptorProto::InternalSwap(MethodDescriptorProto* other) {
void FileOptions::InitAsDefaultInstance() {
}
-class FileOptions::HasBitSetters {
+class FileOptions::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
static void set_has_java_package(HasBits* has_bits) {
@@ -8849,7 +8849,7 @@ void FileOptions::Clear() {
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* FileOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
- HasBitSetters::HasBits has_bits{};
+ _Internal::HasBits has_bits{};
::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
@@ -8885,7 +8885,7 @@ const char* FileOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID
// optional bool java_multiple_files = 10 [default = false];
case 10:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 80)) {
- HasBitSetters::set_has_java_multiple_files(&has_bits);
+ _Internal::set_has_java_multiple_files(&has_bits);
java_multiple_files_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -8900,7 +8900,7 @@ const char* FileOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID
// optional bool cc_generic_services = 16 [default = false];
case 16:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 128)) {
- HasBitSetters::set_has_cc_generic_services(&has_bits);
+ _Internal::set_has_cc_generic_services(&has_bits);
cc_generic_services_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -8908,7 +8908,7 @@ const char* FileOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID
// optional bool java_generic_services = 17 [default = false];
case 17:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 136)) {
- HasBitSetters::set_has_java_generic_services(&has_bits);
+ _Internal::set_has_java_generic_services(&has_bits);
java_generic_services_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -8916,7 +8916,7 @@ const char* FileOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID
// optional bool py_generic_services = 18 [default = false];
case 18:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 144)) {
- HasBitSetters::set_has_py_generic_services(&has_bits);
+ _Internal::set_has_py_generic_services(&has_bits);
py_generic_services_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -8924,7 +8924,7 @@ const char* FileOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID
// optional bool java_generate_equals_and_hash = 20 [deprecated = true];
case 20:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 160)) {
- HasBitSetters::set_has_java_generate_equals_and_hash(&has_bits);
+ _Internal::set_has_java_generate_equals_and_hash(&has_bits);
java_generate_equals_and_hash_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -8932,7 +8932,7 @@ const char* FileOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID
// optional bool deprecated = 23 [default = false];
case 23:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 184)) {
- HasBitSetters::set_has_deprecated(&has_bits);
+ _Internal::set_has_deprecated(&has_bits);
deprecated_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -8940,7 +8940,7 @@ const char* FileOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID
// optional bool java_string_check_utf8 = 27 [default = false];
case 27:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 216)) {
- HasBitSetters::set_has_java_string_check_utf8(&has_bits);
+ _Internal::set_has_java_string_check_utf8(&has_bits);
java_string_check_utf8_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -8948,7 +8948,7 @@ const char* FileOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID
// optional bool cc_enable_arenas = 31 [default = false];
case 31:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 248)) {
- HasBitSetters::set_has_cc_enable_arenas(&has_bits);
+ _Internal::set_has_cc_enable_arenas(&has_bits);
cc_enable_arenas_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -8991,7 +8991,7 @@ const char* FileOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID
// optional bool php_generic_services = 42 [default = false];
case 42:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 80)) {
- HasBitSetters::set_has_php_generic_services(&has_bits);
+ _Internal::set_has_php_generic_services(&has_bits);
php_generic_services_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -9111,7 +9111,7 @@ bool FileOptions::MergePartialFromCodedStream(
// optional bool java_multiple_files = 10 [default = false];
case 10: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (80 & 0xFF)) {
- HasBitSetters::set_has_java_multiple_files(&_has_bits_);
+ _Internal::set_has_java_multiple_files(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
input, &java_multiple_files_)));
@@ -9139,7 +9139,7 @@ bool FileOptions::MergePartialFromCodedStream(
// optional bool cc_generic_services = 16 [default = false];
case 16: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (128 & 0xFF)) {
- HasBitSetters::set_has_cc_generic_services(&_has_bits_);
+ _Internal::set_has_cc_generic_services(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
input, &cc_generic_services_)));
@@ -9152,7 +9152,7 @@ bool FileOptions::MergePartialFromCodedStream(
// optional bool java_generic_services = 17 [default = false];
case 17: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (136 & 0xFF)) {
- HasBitSetters::set_has_java_generic_services(&_has_bits_);
+ _Internal::set_has_java_generic_services(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
input, &java_generic_services_)));
@@ -9165,7 +9165,7 @@ bool FileOptions::MergePartialFromCodedStream(
// optional bool py_generic_services = 18 [default = false];
case 18: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (144 & 0xFF)) {
- HasBitSetters::set_has_py_generic_services(&_has_bits_);
+ _Internal::set_has_py_generic_services(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
input, &py_generic_services_)));
@@ -9178,7 +9178,7 @@ bool FileOptions::MergePartialFromCodedStream(
// optional bool java_generate_equals_and_hash = 20 [deprecated = true];
case 20: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (160 & 0xFF)) {
- HasBitSetters::set_has_java_generate_equals_and_hash(&_has_bits_);
+ _Internal::set_has_java_generate_equals_and_hash(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
input, &java_generate_equals_and_hash_)));
@@ -9191,7 +9191,7 @@ bool FileOptions::MergePartialFromCodedStream(
// optional bool deprecated = 23 [default = false];
case 23: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (184 & 0xFF)) {
- HasBitSetters::set_has_deprecated(&_has_bits_);
+ _Internal::set_has_deprecated(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
input, &deprecated_)));
@@ -9204,7 +9204,7 @@ bool FileOptions::MergePartialFromCodedStream(
// optional bool java_string_check_utf8 = 27 [default = false];
case 27: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (216 & 0xFF)) {
- HasBitSetters::set_has_java_string_check_utf8(&_has_bits_);
+ _Internal::set_has_java_string_check_utf8(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
input, &java_string_check_utf8_)));
@@ -9217,7 +9217,7 @@ bool FileOptions::MergePartialFromCodedStream(
// optional bool cc_enable_arenas = 31 [default = false];
case 31: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (248 & 0xFF)) {
- HasBitSetters::set_has_cc_enable_arenas(&_has_bits_);
+ _Internal::set_has_cc_enable_arenas(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
input, &cc_enable_arenas_)));
@@ -9305,7 +9305,7 @@ bool FileOptions::MergePartialFromCodedStream(
// optional bool php_generic_services = 42 [default = false];
case 42: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (336 & 0xFF)) {
- HasBitSetters::set_has_php_generic_services(&_has_bits_);
+ _Internal::set_has_php_generic_services(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
input, &php_generic_services_)));
@@ -10091,7 +10091,7 @@ void FileOptions::InternalSwap(FileOptions* other) {
void MessageOptions::InitAsDefaultInstance() {
}
-class MessageOptions::HasBitSetters {
+class MessageOptions::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
static void set_has_message_set_wire_format(HasBits* has_bits) {
@@ -10192,7 +10192,7 @@ void MessageOptions::Clear() {
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* MessageOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
- HasBitSetters::HasBits has_bits{};
+ _Internal::HasBits has_bits{};
::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
@@ -10202,7 +10202,7 @@ const char* MessageOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE
// optional bool message_set_wire_format = 1 [default = false];
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
- HasBitSetters::set_has_message_set_wire_format(&has_bits);
+ _Internal::set_has_message_set_wire_format(&has_bits);
message_set_wire_format_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -10210,7 +10210,7 @@ const char* MessageOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE
// optional bool no_standard_descriptor_accessor = 2 [default = false];
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
- HasBitSetters::set_has_no_standard_descriptor_accessor(&has_bits);
+ _Internal::set_has_no_standard_descriptor_accessor(&has_bits);
no_standard_descriptor_accessor_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -10218,7 +10218,7 @@ const char* MessageOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE
// optional bool deprecated = 3 [default = false];
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
- HasBitSetters::set_has_deprecated(&has_bits);
+ _Internal::set_has_deprecated(&has_bits);
deprecated_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -10226,7 +10226,7 @@ const char* MessageOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE
// optional bool map_entry = 7;
case 7:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) {
- HasBitSetters::set_has_map_entry(&has_bits);
+ _Internal::set_has_map_entry(&has_bits);
map_entry_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -10283,7 +10283,7 @@ bool MessageOptions::MergePartialFromCodedStream(
// optional bool message_set_wire_format = 1 [default = false];
case 1: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) {
- HasBitSetters::set_has_message_set_wire_format(&_has_bits_);
+ _Internal::set_has_message_set_wire_format(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
input, &message_set_wire_format_)));
@@ -10296,7 +10296,7 @@ bool MessageOptions::MergePartialFromCodedStream(
// optional bool no_standard_descriptor_accessor = 2 [default = false];
case 2: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) {
- HasBitSetters::set_has_no_standard_descriptor_accessor(&_has_bits_);
+ _Internal::set_has_no_standard_descriptor_accessor(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
input, &no_standard_descriptor_accessor_)));
@@ -10309,7 +10309,7 @@ bool MessageOptions::MergePartialFromCodedStream(
// optional bool deprecated = 3 [default = false];
case 3: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) {
- HasBitSetters::set_has_deprecated(&_has_bits_);
+ _Internal::set_has_deprecated(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
input, &deprecated_)));
@@ -10322,7 +10322,7 @@ bool MessageOptions::MergePartialFromCodedStream(
// optional bool map_entry = 7;
case 7: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (56 & 0xFF)) {
- HasBitSetters::set_has_map_entry(&_has_bits_);
+ _Internal::set_has_map_entry(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
input, &map_entry_)));
@@ -10622,7 +10622,7 @@ void MessageOptions::InternalSwap(MessageOptions* other) {
void FieldOptions::InitAsDefaultInstance() {
}
-class FieldOptions::HasBitSetters {
+class FieldOptions::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
static void set_has_ctype(HasBits* has_bits) {
@@ -10734,7 +10734,7 @@ void FieldOptions::Clear() {
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* FieldOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
- HasBitSetters::HasBits has_bits{};
+ _Internal::HasBits has_bits{};
::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
@@ -10756,7 +10756,7 @@ const char* FieldOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_I
// optional bool packed = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
- HasBitSetters::set_has_packed(&has_bits);
+ _Internal::set_has_packed(&has_bits);
packed_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -10764,7 +10764,7 @@ const char* FieldOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_I
// optional bool deprecated = 3 [default = false];
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
- HasBitSetters::set_has_deprecated(&has_bits);
+ _Internal::set_has_deprecated(&has_bits);
deprecated_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -10772,7 +10772,7 @@ const char* FieldOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_I
// optional bool lazy = 5 [default = false];
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
- HasBitSetters::set_has_lazy(&has_bits);
+ _Internal::set_has_lazy(&has_bits);
lazy_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -10792,7 +10792,7 @@ const char* FieldOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_I
// optional bool weak = 10 [default = false];
case 10:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 80)) {
- HasBitSetters::set_has_weak(&has_bits);
+ _Internal::set_has_weak(&has_bits);
weak_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -10868,7 +10868,7 @@ bool FieldOptions::MergePartialFromCodedStream(
// optional bool packed = 2;
case 2: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) {
- HasBitSetters::set_has_packed(&_has_bits_);
+ _Internal::set_has_packed(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
input, &packed_)));
@@ -10881,7 +10881,7 @@ bool FieldOptions::MergePartialFromCodedStream(
// optional bool deprecated = 3 [default = false];
case 3: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) {
- HasBitSetters::set_has_deprecated(&_has_bits_);
+ _Internal::set_has_deprecated(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
input, &deprecated_)));
@@ -10894,7 +10894,7 @@ bool FieldOptions::MergePartialFromCodedStream(
// optional bool lazy = 5 [default = false];
case 5: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) {
- HasBitSetters::set_has_lazy(&_has_bits_);
+ _Internal::set_has_lazy(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
input, &lazy_)));
@@ -10926,7 +10926,7 @@ bool FieldOptions::MergePartialFromCodedStream(
// optional bool weak = 10 [default = false];
case 10: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (80 & 0xFF)) {
- HasBitSetters::set_has_weak(&_has_bits_);
+ _Internal::set_has_weak(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
input, &weak_)));
@@ -11270,7 +11270,7 @@ void FieldOptions::InternalSwap(FieldOptions* other) {
void OneofOptions::InitAsDefaultInstance() {
}
-class OneofOptions::HasBitSetters {
+class OneofOptions::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
};
@@ -11605,7 +11605,7 @@ void OneofOptions::InternalSwap(OneofOptions* other) {
void EnumOptions::InitAsDefaultInstance() {
}
-class EnumOptions::HasBitSetters {
+class EnumOptions::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
static void set_has_allow_alias(HasBits* has_bits) {
@@ -11698,7 +11698,7 @@ void EnumOptions::Clear() {
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* EnumOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
- HasBitSetters::HasBits has_bits{};
+ _Internal::HasBits has_bits{};
::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
@@ -11708,7 +11708,7 @@ const char* EnumOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID
// optional bool allow_alias = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
- HasBitSetters::set_has_allow_alias(&has_bits);
+ _Internal::set_has_allow_alias(&has_bits);
allow_alias_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -11716,7 +11716,7 @@ const char* EnumOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID
// optional bool deprecated = 3 [default = false];
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
- HasBitSetters::set_has_deprecated(&has_bits);
+ _Internal::set_has_deprecated(&has_bits);
deprecated_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -11773,7 +11773,7 @@ bool EnumOptions::MergePartialFromCodedStream(
// optional bool allow_alias = 2;
case 2: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) {
- HasBitSetters::set_has_allow_alias(&_has_bits_);
+ _Internal::set_has_allow_alias(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
input, &allow_alias_)));
@@ -11786,7 +11786,7 @@ bool EnumOptions::MergePartialFromCodedStream(
// optional bool deprecated = 3 [default = false];
case 3: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) {
- HasBitSetters::set_has_deprecated(&_has_bits_);
+ _Internal::set_has_deprecated(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
input, &deprecated_)));
@@ -12048,7 +12048,7 @@ void EnumOptions::InternalSwap(EnumOptions* other) {
void EnumValueOptions::InitAsDefaultInstance() {
}
-class EnumValueOptions::HasBitSetters {
+class EnumValueOptions::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
static void set_has_deprecated(HasBits* has_bits) {
@@ -12131,7 +12131,7 @@ void EnumValueOptions::Clear() {
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* EnumValueOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
- HasBitSetters::HasBits has_bits{};
+ _Internal::HasBits has_bits{};
::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
@@ -12141,7 +12141,7 @@ const char* EnumValueOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPA
// optional bool deprecated = 1 [default = false];
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
- HasBitSetters::set_has_deprecated(&has_bits);
+ _Internal::set_has_deprecated(&has_bits);
deprecated_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -12198,7 +12198,7 @@ bool EnumValueOptions::MergePartialFromCodedStream(
// optional bool deprecated = 1 [default = false];
case 1: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) {
- HasBitSetters::set_has_deprecated(&_has_bits_);
+ _Internal::set_has_deprecated(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
input, &deprecated_)));
@@ -12435,7 +12435,7 @@ void EnumValueOptions::InternalSwap(EnumValueOptions* other) {
void ServiceOptions::InitAsDefaultInstance() {
}
-class ServiceOptions::HasBitSetters {
+class ServiceOptions::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
static void set_has_deprecated(HasBits* has_bits) {
@@ -12518,7 +12518,7 @@ void ServiceOptions::Clear() {
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* ServiceOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
- HasBitSetters::HasBits has_bits{};
+ _Internal::HasBits has_bits{};
::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
@@ -12528,7 +12528,7 @@ const char* ServiceOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE
// optional bool deprecated = 33 [default = false];
case 33:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
- HasBitSetters::set_has_deprecated(&has_bits);
+ _Internal::set_has_deprecated(&has_bits);
deprecated_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -12585,7 +12585,7 @@ bool ServiceOptions::MergePartialFromCodedStream(
// optional bool deprecated = 33 [default = false];
case 33: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (264 & 0xFF)) {
- HasBitSetters::set_has_deprecated(&_has_bits_);
+ _Internal::set_has_deprecated(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
input, &deprecated_)));
@@ -12822,7 +12822,7 @@ void ServiceOptions::InternalSwap(ServiceOptions* other) {
void MethodOptions::InitAsDefaultInstance() {
}
-class MethodOptions::HasBitSetters {
+class MethodOptions::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
static void set_has_deprecated(HasBits* has_bits) {
@@ -12918,7 +12918,7 @@ void MethodOptions::Clear() {
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* MethodOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
- HasBitSetters::HasBits has_bits{};
+ _Internal::HasBits has_bits{};
::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
@@ -12928,7 +12928,7 @@ const char* MethodOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_
// optional bool deprecated = 33 [default = false];
case 33:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
- HasBitSetters::set_has_deprecated(&has_bits);
+ _Internal::set_has_deprecated(&has_bits);
deprecated_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -12997,7 +12997,7 @@ bool MethodOptions::MergePartialFromCodedStream(
// optional bool deprecated = 33 [default = false];
case 33: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (264 & 0xFF)) {
- HasBitSetters::set_has_deprecated(&_has_bits_);
+ _Internal::set_has_deprecated(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
input, &deprecated_)));
@@ -13281,7 +13281,7 @@ void MethodOptions::InternalSwap(MethodOptions* other) {
void UninterpretedOption_NamePart::InitAsDefaultInstance() {
}
-class UninterpretedOption_NamePart::HasBitSetters {
+class UninterpretedOption_NamePart::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
static void set_has_name_part(HasBits* has_bits) {
@@ -13372,7 +13372,7 @@ void UninterpretedOption_NamePart::Clear() {
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* UninterpretedOption_NamePart::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
- HasBitSetters::HasBits has_bits{};
+ _Internal::HasBits has_bits{};
::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
@@ -13389,7 +13389,7 @@ const char* UninterpretedOption_NamePart::_InternalParse(const char* ptr, ::PROT
// required bool is_extension = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
- HasBitSetters::set_has_is_extension(&has_bits);
+ _Internal::set_has_is_extension(&has_bits);
is_extension_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -13443,7 +13443,7 @@ bool UninterpretedOption_NamePart::MergePartialFromCodedStream(
// required bool is_extension = 2;
case 2: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) {
- HasBitSetters::set_has_is_extension(&_has_bits_);
+ _Internal::set_has_is_extension(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
input, &is_extension_)));
@@ -13672,7 +13672,7 @@ void UninterpretedOption_NamePart::InternalSwap(UninterpretedOption_NamePart* ot
void UninterpretedOption::InitAsDefaultInstance() {
}
-class UninterpretedOption::HasBitSetters {
+class UninterpretedOption::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
static void set_has_identifier_value(HasBits* has_bits) {
@@ -13813,7 +13813,7 @@ void UninterpretedOption::Clear() {
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* UninterpretedOption::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
- HasBitSetters::HasBits has_bits{};
+ _Internal::HasBits has_bits{};
::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
@@ -13842,7 +13842,7 @@ const char* UninterpretedOption::_InternalParse(const char* ptr, ::PROTOBUF_NAME
// optional uint64 positive_int_value = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
- HasBitSetters::set_has_positive_int_value(&has_bits);
+ _Internal::set_has_positive_int_value(&has_bits);
positive_int_value_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -13850,7 +13850,7 @@ const char* UninterpretedOption::_InternalParse(const char* ptr, ::PROTOBUF_NAME
// optional int64 negative_int_value = 5;
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
- HasBitSetters::set_has_negative_int_value(&has_bits);
+ _Internal::set_has_negative_int_value(&has_bits);
negative_int_value_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -13858,7 +13858,7 @@ const char* UninterpretedOption::_InternalParse(const char* ptr, ::PROTOBUF_NAME
// optional double double_value = 6;
case 6:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 49)) {
- HasBitSetters::set_has_double_value(&has_bits);
+ _Internal::set_has_double_value(&has_bits);
double_value_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr);
ptr += sizeof(double);
} else goto handle_unusual;
@@ -13937,7 +13937,7 @@ bool UninterpretedOption::MergePartialFromCodedStream(
// optional uint64 positive_int_value = 4;
case 4: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) {
- HasBitSetters::set_has_positive_int_value(&_has_bits_);
+ _Internal::set_has_positive_int_value(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>(
input, &positive_int_value_)));
@@ -13950,7 +13950,7 @@ bool UninterpretedOption::MergePartialFromCodedStream(
// optional int64 negative_int_value = 5;
case 5: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) {
- HasBitSetters::set_has_negative_int_value(&_has_bits_);
+ _Internal::set_has_negative_int_value(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>(
input, &negative_int_value_)));
@@ -13963,7 +13963,7 @@ bool UninterpretedOption::MergePartialFromCodedStream(
// optional double double_value = 6;
case 6: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (49 & 0xFF)) {
- HasBitSetters::set_has_double_value(&_has_bits_);
+ _Internal::set_has_double_value(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
double, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_DOUBLE>(
input, &double_value_)));
@@ -14333,7 +14333,7 @@ void UninterpretedOption::InternalSwap(UninterpretedOption* other) {
void SourceCodeInfo_Location::InitAsDefaultInstance() {
}
-class SourceCodeInfo_Location::HasBitSetters {
+class SourceCodeInfo_Location::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
static void set_has_leading_comments(HasBits* has_bits) {
@@ -14445,7 +14445,7 @@ void SourceCodeInfo_Location::Clear() {
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* SourceCodeInfo_Location::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
- HasBitSetters::HasBits has_bits{};
+ _Internal::HasBits has_bits{};
::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
@@ -14935,7 +14935,7 @@ void SourceCodeInfo_Location::InternalSwap(SourceCodeInfo_Location* other) {
void SourceCodeInfo::InitAsDefaultInstance() {
}
-class SourceCodeInfo::HasBitSetters {
+class SourceCodeInfo::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
};
@@ -15239,7 +15239,7 @@ void SourceCodeInfo::InternalSwap(SourceCodeInfo* other) {
void GeneratedCodeInfo_Annotation::InitAsDefaultInstance() {
}
-class GeneratedCodeInfo_Annotation::HasBitSetters {
+class GeneratedCodeInfo_Annotation::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
static void set_has_source_file(HasBits* has_bits) {
@@ -15346,7 +15346,7 @@ void GeneratedCodeInfo_Annotation::Clear() {
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* GeneratedCodeInfo_Annotation::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
- HasBitSetters::HasBits has_bits{};
+ _Internal::HasBits has_bits{};
::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
@@ -15373,7 +15373,7 @@ const char* GeneratedCodeInfo_Annotation::_InternalParse(const char* ptr, ::PROT
// optional int32 begin = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
- HasBitSetters::set_has_begin(&has_bits);
+ _Internal::set_has_begin(&has_bits);
begin_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -15381,7 +15381,7 @@ const char* GeneratedCodeInfo_Annotation::_InternalParse(const char* ptr, ::PROT
// optional int32 end = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
- HasBitSetters::set_has_end(&has_bits);
+ _Internal::set_has_end(&has_bits);
end_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr);
} else goto handle_unusual;
@@ -15451,7 +15451,7 @@ bool GeneratedCodeInfo_Annotation::MergePartialFromCodedStream(
// optional int32 begin = 3;
case 3: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) {
- HasBitSetters::set_has_begin(&_has_bits_);
+ _Internal::set_has_begin(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
input, &begin_)));
@@ -15464,7 +15464,7 @@ bool GeneratedCodeInfo_Annotation::MergePartialFromCodedStream(
// optional int32 end = 4;
case 4: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) {
- HasBitSetters::set_has_end(&_has_bits_);
+ _Internal::set_has_end(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
input, &end_)));
@@ -15741,7 +15741,7 @@ void GeneratedCodeInfo_Annotation::InternalSwap(GeneratedCodeInfo_Annotation* ot
void GeneratedCodeInfo::InitAsDefaultInstance() {
}
-class GeneratedCodeInfo::HasBitSetters {
+class GeneratedCodeInfo::_Internal {
public:
using HasBits = decltype(std::declval()._has_bits_);
};
diff --git a/src/google/protobuf/descriptor.pb.h b/src/google/protobuf/descriptor.pb.h
index 0920d4196b..2288666220 100644
--- a/src/google/protobuf/descriptor.pb.h
+++ b/src/google/protobuf/descriptor.pb.h
@@ -472,7 +472,7 @@ class PROTOBUF_EXPORT FileDescriptorSet :
// @@protoc_insertion_point(class_scope:google.protobuf.FileDescriptorSet)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@@ -795,7 +795,7 @@ class PROTOBUF_EXPORT FileDescriptorProto :
// @@protoc_insertion_point(class_scope:google.protobuf.FileDescriptorProto)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@@ -975,7 +975,7 @@ class PROTOBUF_EXPORT DescriptorProto_ExtensionRange :
// @@protoc_insertion_point(class_scope:google.protobuf.DescriptorProto.ExtensionRange)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@@ -1134,7 +1134,7 @@ class PROTOBUF_EXPORT DescriptorProto_ReservedRange :
// @@protoc_insertion_point(class_scope:google.protobuf.DescriptorProto.ReservedRange)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@@ -1417,7 +1417,7 @@ class PROTOBUF_EXPORT DescriptorProto :
// @@protoc_insertion_point(class_scope:google.protobuf.DescriptorProto)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@@ -1582,7 +1582,7 @@ class PROTOBUF_EXPORT ExtensionRangeOptions :
GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(ExtensionRangeOptions)
// @@protoc_insertion_point(class_scope:google.protobuf.ExtensionRangeOptions)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
@@ -1971,7 +1971,7 @@ class PROTOBUF_EXPORT FieldDescriptorProto :
// @@protoc_insertion_point(class_scope:google.protobuf.FieldDescriptorProto)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@@ -2157,7 +2157,7 @@ class PROTOBUF_EXPORT OneofDescriptorProto :
// @@protoc_insertion_point(class_scope:google.protobuf.OneofDescriptorProto)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@@ -2315,7 +2315,7 @@ class PROTOBUF_EXPORT EnumDescriptorProto_EnumReservedRange :
// @@protoc_insertion_point(class_scope:google.protobuf.EnumDescriptorProto.EnumReservedRange)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@@ -2537,7 +2537,7 @@ class PROTOBUF_EXPORT EnumDescriptorProto :
// @@protoc_insertion_point(class_scope:google.protobuf.EnumDescriptorProto)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@@ -2725,7 +2725,7 @@ class PROTOBUF_EXPORT EnumValueDescriptorProto :
// @@protoc_insertion_point(class_scope:google.protobuf.EnumValueDescriptorProto)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@@ -2916,7 +2916,7 @@ class PROTOBUF_EXPORT ServiceDescriptorProto :
// @@protoc_insertion_point(class_scope:google.protobuf.ServiceDescriptorProto)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@@ -3153,7 +3153,7 @@ class PROTOBUF_EXPORT MethodDescriptorProto :
// @@protoc_insertion_point(class_scope:google.protobuf.MethodDescriptorProto)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@@ -3636,7 +3636,7 @@ class PROTOBUF_EXPORT FileOptions :
GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(FileOptions)
// @@protoc_insertion_point(class_scope:google.protobuf.FileOptions)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
@@ -3842,7 +3842,7 @@ class PROTOBUF_EXPORT MessageOptions :
GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(MessageOptions)
// @@protoc_insertion_point(class_scope:google.protobuf.MessageOptions)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
@@ -4110,7 +4110,7 @@ class PROTOBUF_EXPORT FieldOptions :
GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(FieldOptions)
// @@protoc_insertion_point(class_scope:google.protobuf.FieldOptions)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
@@ -4274,7 +4274,7 @@ class PROTOBUF_EXPORT OneofOptions :
GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(OneofOptions)
// @@protoc_insertion_point(class_scope:google.protobuf.OneofOptions)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
@@ -4446,7 +4446,7 @@ class PROTOBUF_EXPORT EnumOptions :
GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(EnumOptions)
// @@protoc_insertion_point(class_scope:google.protobuf.EnumOptions)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
@@ -4613,7 +4613,7 @@ class PROTOBUF_EXPORT EnumValueOptions :
GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(EnumValueOptions)
// @@protoc_insertion_point(class_scope:google.protobuf.EnumValueOptions)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
@@ -4779,7 +4779,7 @@ class PROTOBUF_EXPORT ServiceOptions :
GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(ServiceOptions)
// @@protoc_insertion_point(class_scope:google.protobuf.ServiceOptions)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
@@ -4984,7 +4984,7 @@ class PROTOBUF_EXPORT MethodOptions :
GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(MethodOptions)
// @@protoc_insertion_point(class_scope:google.protobuf.MethodOptions)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
@@ -5160,7 +5160,7 @@ class PROTOBUF_EXPORT UninterpretedOption_NamePart :
// @@protoc_insertion_point(class_scope:google.protobuf.UninterpretedOption.NamePart)
private:
- class HasBitSetters;
+ class _Internal;
// helper for ByteSizeLong()
size_t RequiredFieldsByteSizeFallback() const;
@@ -5408,7 +5408,7 @@ class PROTOBUF_EXPORT UninterpretedOption :
// @@protoc_insertion_point(class_scope:google.protobuf.UninterpretedOption)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@@ -5643,7 +5643,7 @@ class PROTOBUF_EXPORT SourceCodeInfo_Location :
// @@protoc_insertion_point(class_scope:google.protobuf.SourceCodeInfo.Location)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@@ -5806,7 +5806,7 @@ class PROTOBUF_EXPORT SourceCodeInfo :
// @@protoc_insertion_point(class_scope:google.protobuf.SourceCodeInfo)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@@ -5997,7 +5997,7 @@ class PROTOBUF_EXPORT GeneratedCodeInfo_Annotation :
// @@protoc_insertion_point(class_scope:google.protobuf.GeneratedCodeInfo.Annotation)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@@ -6158,7 +6158,7 @@ class PROTOBUF_EXPORT GeneratedCodeInfo :
// @@protoc_insertion_point(class_scope:google.protobuf.GeneratedCodeInfo)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
diff --git a/src/google/protobuf/descriptor.proto b/src/google/protobuf/descriptor.proto
index a7d070ad11..a2102d7aa9 100644
--- a/src/google/protobuf/descriptor.proto
+++ b/src/google/protobuf/descriptor.proto
@@ -428,6 +428,7 @@ message FileOptions {
// determining the ruby package.
optional string ruby_package = 45;
+
// The parser stores options it doesn't recognize here.
// See the documentation for the "Options" section above.
repeated UninterpretedOption uninterpreted_option = 999;
diff --git a/src/google/protobuf/duration.pb.cc b/src/google/protobuf/duration.pb.cc
index 4190f9710d..864a4407e8 100644
--- a/src/google/protobuf/duration.pb.cc
+++ b/src/google/protobuf/duration.pb.cc
@@ -86,7 +86,7 @@ PROTOBUF_NAMESPACE_OPEN
void Duration::InitAsDefaultInstance() {
}
-class Duration::HasBitSetters {
+class Duration::_Internal {
public:
};
diff --git a/src/google/protobuf/duration.pb.h b/src/google/protobuf/duration.pb.h
index 91ac1e18d1..774b1ebd6c 100644
--- a/src/google/protobuf/duration.pb.h
+++ b/src/google/protobuf/duration.pb.h
@@ -201,7 +201,7 @@ class PROTOBUF_EXPORT Duration :
// @@protoc_insertion_point(class_scope:google.protobuf.Duration)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
diff --git a/src/google/protobuf/empty.pb.cc b/src/google/protobuf/empty.pb.cc
index 481cb57abb..835fd5fc12 100644
--- a/src/google/protobuf/empty.pb.cc
+++ b/src/google/protobuf/empty.pb.cc
@@ -83,7 +83,7 @@ PROTOBUF_NAMESPACE_OPEN
void Empty::InitAsDefaultInstance() {
}
-class Empty::HasBitSetters {
+class Empty::_Internal {
public:
};
diff --git a/src/google/protobuf/empty.pb.h b/src/google/protobuf/empty.pb.h
index d65060da80..5ac03a69a5 100644
--- a/src/google/protobuf/empty.pb.h
+++ b/src/google/protobuf/empty.pb.h
@@ -189,7 +189,7 @@ class PROTOBUF_EXPORT Empty :
// @@protoc_insertion_point(class_scope:google.protobuf.Empty)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
diff --git a/src/google/protobuf/field_mask.pb.cc b/src/google/protobuf/field_mask.pb.cc
index 034b44f49c..4f75e4a6a7 100644
--- a/src/google/protobuf/field_mask.pb.cc
+++ b/src/google/protobuf/field_mask.pb.cc
@@ -85,7 +85,7 @@ PROTOBUF_NAMESPACE_OPEN
void FieldMask::InitAsDefaultInstance() {
}
-class FieldMask::HasBitSetters {
+class FieldMask::_Internal {
public:
};
diff --git a/src/google/protobuf/field_mask.pb.h b/src/google/protobuf/field_mask.pb.h
index 57f400c4eb..5bdcd7eb95 100644
--- a/src/google/protobuf/field_mask.pb.h
+++ b/src/google/protobuf/field_mask.pb.h
@@ -207,7 +207,7 @@ class PROTOBUF_EXPORT FieldMask :
// @@protoc_insertion_point(class_scope:google.protobuf.FieldMask)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
diff --git a/src/google/protobuf/map_test.cc b/src/google/protobuf/map_test.cc
index 4f069cd4c0..99a7f67411 100644
--- a/src/google/protobuf/map_test.cc
+++ b/src/google/protobuf/map_test.cc
@@ -3083,11 +3083,13 @@ static std::string DeterministicSerialization(const T& t) {
const int size = t.ByteSize();
std::string result(size, '\0');
io::ArrayOutputStream array_stream(::google::protobuf::string_as_array(&result), size);
- io::CodedOutputStream output_stream(&array_stream);
- output_stream.SetSerializationDeterministic(true);
- t.SerializeWithCachedSizes(&output_stream);
- EXPECT_FALSE(output_stream.HadError());
- EXPECT_EQ(size, output_stream.ByteCount());
+ {
+ io::CodedOutputStream output_stream(&array_stream);
+ output_stream.SetSerializationDeterministic(true);
+ t.SerializeWithCachedSizes(&output_stream);
+ EXPECT_FALSE(output_stream.HadError());
+ EXPECT_EQ(size, output_stream.ByteCount());
+ }
EXPECT_EQ(result, DeterministicSerializationWithSerializeToCodedStream(t));
EXPECT_EQ(result,
DeterministicSerializationWithSerializePartialToCodedStream(t));
diff --git a/src/google/protobuf/source_context.pb.cc b/src/google/protobuf/source_context.pb.cc
index 98add69e05..e7e66aa1e7 100644
--- a/src/google/protobuf/source_context.pb.cc
+++ b/src/google/protobuf/source_context.pb.cc
@@ -86,7 +86,7 @@ PROTOBUF_NAMESPACE_OPEN
void SourceContext::InitAsDefaultInstance() {
}
-class SourceContext::HasBitSetters {
+class SourceContext::_Internal {
public:
};
@@ -104,7 +104,7 @@ SourceContext::SourceContext(const SourceContext& from)
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
file_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- if (from.file_name().size() > 0) {
+ if (!from.file_name().empty()) {
file_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.file_name_);
}
// @@protoc_insertion_point(copy_constructor:google.protobuf.SourceContext)
diff --git a/src/google/protobuf/source_context.pb.h b/src/google/protobuf/source_context.pb.h
index 943c936bf9..01e356bb0e 100644
--- a/src/google/protobuf/source_context.pb.h
+++ b/src/google/protobuf/source_context.pb.h
@@ -189,7 +189,7 @@ class PROTOBUF_EXPORT SourceContext :
// @@protoc_insertion_point(class_scope:google.protobuf.SourceContext)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr file_name_;
diff --git a/src/google/protobuf/struct.pb.cc b/src/google/protobuf/struct.pb.cc
index c4ff59b399..a3de868d53 100644
--- a/src/google/protobuf/struct.pb.cc
+++ b/src/google/protobuf/struct.pb.cc
@@ -195,7 +195,7 @@ void Struct_FieldsEntry_DoNotUse::MergeFrom(
void Struct::InitAsDefaultInstance() {
}
-class Struct::HasBitSetters {
+class Struct::_Internal {
public:
};
@@ -578,18 +578,18 @@ void Value::InitAsDefaultInstance() {
PROTOBUF_NAMESPACE_ID::_Value_default_instance_.list_value_ = const_cast< PROTOBUF_NAMESPACE_ID::ListValue*>(
PROTOBUF_NAMESPACE_ID::ListValue::internal_default_instance());
}
-class Value::HasBitSetters {
+class Value::_Internal {
public:
static const PROTOBUF_NAMESPACE_ID::Struct& struct_value(const Value* msg);
static const PROTOBUF_NAMESPACE_ID::ListValue& list_value(const Value* msg);
};
const PROTOBUF_NAMESPACE_ID::Struct&
-Value::HasBitSetters::struct_value(const Value* msg) {
+Value::_Internal::struct_value(const Value* msg) {
return *msg->kind_.struct_value_;
}
const PROTOBUF_NAMESPACE_ID::ListValue&
-Value::HasBitSetters::list_value(const Value* msg) {
+Value::_Internal::list_value(const Value* msg) {
return *msg->kind_.list_value_;
}
void Value::set_allocated_struct_value(PROTOBUF_NAMESPACE_ID::Struct* struct_value) {
@@ -979,13 +979,13 @@ void Value::SerializeWithCachedSizes(
// .google.protobuf.Struct struct_value = 5;
if (has_struct_value()) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
- 5, HasBitSetters::struct_value(this), output);
+ 5, _Internal::struct_value(this), output);
}
// .google.protobuf.ListValue list_value = 6;
if (has_list_value()) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
- 6, HasBitSetters::list_value(this), output);
+ 6, _Internal::list_value(this), output);
}
if (_internal_metadata_.have_unknown_fields()) {
@@ -1032,14 +1032,14 @@ void Value::SerializeWithCachedSizes(
if (has_struct_value()) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
- 5, HasBitSetters::struct_value(this), target);
+ 5, _Internal::struct_value(this), target);
}
// .google.protobuf.ListValue list_value = 6;
if (has_list_value()) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
- 6, HasBitSetters::list_value(this), target);
+ 6, _Internal::list_value(this), target);
}
if (_internal_metadata_.have_unknown_fields()) {
@@ -1216,7 +1216,7 @@ void Value::InternalSwap(Value* other) {
void ListValue::InitAsDefaultInstance() {
}
-class ListValue::HasBitSetters {
+class ListValue::_Internal {
public:
};
diff --git a/src/google/protobuf/struct.pb.h b/src/google/protobuf/struct.pb.h
index 5dfd8fae16..519b3e7e07 100644
--- a/src/google/protobuf/struct.pb.h
+++ b/src/google/protobuf/struct.pb.h
@@ -271,7 +271,7 @@ class PROTOBUF_EXPORT Struct :
// @@protoc_insertion_point(class_scope:google.protobuf.Struct)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@@ -498,7 +498,7 @@ class PROTOBUF_EXPORT Value :
KindCase kind_case() const;
// @@protoc_insertion_point(class_scope:google.protobuf.Value)
private:
- class HasBitSetters;
+ class _Internal;
void set_has_null_value();
void set_has_number_value();
void set_has_string_value();
@@ -664,7 +664,7 @@ class PROTOBUF_EXPORT ListValue :
// @@protoc_insertion_point(class_scope:google.protobuf.ListValue)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
diff --git a/src/google/protobuf/text_format.cc b/src/google/protobuf/text_format.cc
index 562f4528e8..e04ae3df24 100644
--- a/src/google/protobuf/text_format.cc
+++ b/src/google/protobuf/text_format.cc
@@ -208,6 +208,11 @@ const FieldDescriptor* DefaultFinderFindExtension(Message* message,
name);
}
+const FieldDescriptor* DefaultFinderFindExtensionByNumber(
+ const Descriptor* descriptor, int number) {
+ return descriptor->file()->pool()->FindExtensionByNumber(descriptor, number);
+}
+
const Descriptor* DefaultFinderFindAnyType(const Message& message,
const std::string& prefix,
const std::string& name) {
@@ -459,8 +464,10 @@ class TextFormat::Parser::ParserImpl {
if (allow_field_number_ &&
safe_strto32(field_name, &field_number)) {
if (descriptor->IsExtensionNumber(field_number)) {
- field = descriptor->file()->pool()->FindExtensionByNumber(
- descriptor, field_number);
+ field = finder_
+ ? finder_->FindExtensionByNumber(descriptor, field_number)
+ : DefaultFinderFindExtensionByNumber(descriptor,
+ field_number);
} else if (descriptor->IsReservedNumber(field_number)) {
reserved_field = true;
} else {
@@ -1354,6 +1361,11 @@ const FieldDescriptor* TextFormat::Finder::FindExtension(
return DefaultFinderFindExtension(message, name);
}
+const FieldDescriptor* TextFormat::Finder::FindExtensionByNumber(
+ const Descriptor* descriptor, int number) const {
+ return DefaultFinderFindExtensionByNumber(descriptor, number);
+}
+
const Descriptor* TextFormat::Finder::FindAnyType(
const Message& message, const std::string& prefix,
const std::string& name) const {
diff --git a/src/google/protobuf/text_format.h b/src/google/protobuf/text_format.h
index f999f4727e..4ebab0e4de 100644
--- a/src/google/protobuf/text_format.h
+++ b/src/google/protobuf/text_format.h
@@ -208,6 +208,11 @@ class PROTOBUF_EXPORT TextFormat {
virtual const FieldDescriptor* FindExtension(Message* message,
const std::string& name) const;
+ // Similar to FindExtension, but uses a Descriptor and the extension number
+ // instead of using a Message and the name when doing the look up.
+ virtual const FieldDescriptor* FindExtensionByNumber(
+ const Descriptor* descriptor, int number) const;
+
// Find the message type for an Any proto.
// Returns NULL if no message is known for this name.
// The base implementation only accepts prefixes of type.googleprod.com/ or
diff --git a/src/google/protobuf/timestamp.pb.cc b/src/google/protobuf/timestamp.pb.cc
index 3d56e3a28e..4c26287297 100644
--- a/src/google/protobuf/timestamp.pb.cc
+++ b/src/google/protobuf/timestamp.pb.cc
@@ -86,7 +86,7 @@ PROTOBUF_NAMESPACE_OPEN
void Timestamp::InitAsDefaultInstance() {
}
-class Timestamp::HasBitSetters {
+class Timestamp::_Internal {
public:
};
diff --git a/src/google/protobuf/timestamp.pb.h b/src/google/protobuf/timestamp.pb.h
index f3ede5c1c8..b35ad10aa0 100644
--- a/src/google/protobuf/timestamp.pb.h
+++ b/src/google/protobuf/timestamp.pb.h
@@ -201,7 +201,7 @@ class PROTOBUF_EXPORT Timestamp :
// @@protoc_insertion_point(class_scope:google.protobuf.Timestamp)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
diff --git a/src/google/protobuf/type.pb.cc b/src/google/protobuf/type.pb.cc
index 0631fdd664..28f42d9183 100644
--- a/src/google/protobuf/type.pb.cc
+++ b/src/google/protobuf/type.pb.cc
@@ -360,13 +360,13 @@ void Type::InitAsDefaultInstance() {
PROTOBUF_NAMESPACE_ID::_Type_default_instance_._instance.get_mutable()->source_context_ = const_cast< PROTOBUF_NAMESPACE_ID::SourceContext*>(
PROTOBUF_NAMESPACE_ID::SourceContext::internal_default_instance());
}
-class Type::HasBitSetters {
+class Type::_Internal {
public:
static const PROTOBUF_NAMESPACE_ID::SourceContext& source_context(const Type* msg);
};
const PROTOBUF_NAMESPACE_ID::SourceContext&
-Type::HasBitSetters::source_context(const Type* msg) {
+Type::_Internal::source_context(const Type* msg) {
return *msg->source_context_;
}
void Type::unsafe_arena_set_allocated_source_context(
@@ -420,7 +420,7 @@ Type::Type(const Type& from)
options_(from.options_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- if (from.name().size() > 0) {
+ if (!from.name().empty()) {
name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name(),
GetArenaNoVirtual());
}
@@ -728,7 +728,7 @@ void Type::SerializeWithCachedSizes(
// .google.protobuf.SourceContext source_context = 5;
if (this->has_source_context()) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
- 5, HasBitSetters::source_context(this), output);
+ 5, _Internal::source_context(this), output);
}
// .google.protobuf.Syntax syntax = 6;
@@ -791,7 +791,7 @@ void Type::SerializeWithCachedSizes(
if (this->has_source_context()) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
- 5, HasBitSetters::source_context(this), target);
+ 5, _Internal::source_context(this), target);
}
// .google.protobuf.Syntax syntax = 6;
@@ -970,7 +970,7 @@ void Type::InternalSwap(Type* other) {
void Field::InitAsDefaultInstance() {
}
-class Field::HasBitSetters {
+class Field::_Internal {
public:
};
@@ -1006,22 +1006,22 @@ Field::Field(const Field& from)
options_(from.options_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- if (from.name().size() > 0) {
+ if (!from.name().empty()) {
name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name(),
GetArenaNoVirtual());
}
type_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- if (from.type_url().size() > 0) {
+ if (!from.type_url().empty()) {
type_url_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.type_url(),
GetArenaNoVirtual());
}
json_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- if (from.json_name().size() > 0) {
+ if (!from.json_name().empty()) {
json_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.json_name(),
GetArenaNoVirtual());
}
default_value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- if (from.default_value().size() > 0) {
+ if (!from.default_value().empty()) {
default_value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.default_value(),
GetArenaNoVirtual());
}
@@ -1751,13 +1751,13 @@ void Enum::InitAsDefaultInstance() {
PROTOBUF_NAMESPACE_ID::_Enum_default_instance_._instance.get_mutable()->source_context_ = const_cast< PROTOBUF_NAMESPACE_ID::SourceContext*>(
PROTOBUF_NAMESPACE_ID::SourceContext::internal_default_instance());
}
-class Enum::HasBitSetters {
+class Enum::_Internal {
public:
static const PROTOBUF_NAMESPACE_ID::SourceContext& source_context(const Enum* msg);
};
const PROTOBUF_NAMESPACE_ID::SourceContext&
-Enum::HasBitSetters::source_context(const Enum* msg) {
+Enum::_Internal::source_context(const Enum* msg) {
return *msg->source_context_;
}
void Enum::unsafe_arena_set_allocated_source_context(
@@ -1808,7 +1808,7 @@ Enum::Enum(const Enum& from)
options_(from.options_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- if (from.name().size() > 0) {
+ if (!from.name().empty()) {
name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name(),
GetArenaNoVirtual());
}
@@ -2077,7 +2077,7 @@ void Enum::SerializeWithCachedSizes(
// .google.protobuf.SourceContext source_context = 4;
if (this->has_source_context()) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
- 4, HasBitSetters::source_context(this), output);
+ 4, _Internal::source_context(this), output);
}
// .google.protobuf.Syntax syntax = 5;
@@ -2130,7 +2130,7 @@ void Enum::SerializeWithCachedSizes(
if (this->has_source_context()) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
- 4, HasBitSetters::source_context(this), target);
+ 4, _Internal::source_context(this), target);
}
// .google.protobuf.Syntax syntax = 5;
@@ -2299,7 +2299,7 @@ void Enum::InternalSwap(Enum* other) {
void EnumValue::InitAsDefaultInstance() {
}
-class EnumValue::HasBitSetters {
+class EnumValue::_Internal {
public:
};
@@ -2328,7 +2328,7 @@ EnumValue::EnumValue(const EnumValue& from)
options_(from.options_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- if (from.name().size() > 0) {
+ if (!from.name().empty()) {
name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name(),
GetArenaNoVirtual());
}
@@ -2710,13 +2710,13 @@ void Option::InitAsDefaultInstance() {
PROTOBUF_NAMESPACE_ID::_Option_default_instance_._instance.get_mutable()->value_ = const_cast< PROTOBUF_NAMESPACE_ID::Any*>(
PROTOBUF_NAMESPACE_ID::Any::internal_default_instance());
}
-class Option::HasBitSetters {
+class Option::_Internal {
public:
static const PROTOBUF_NAMESPACE_ID::Any& value(const Option* msg);
};
const PROTOBUF_NAMESPACE_ID::Any&
-Option::HasBitSetters::value(const Option* msg) {
+Option::_Internal::value(const Option* msg) {
return *msg->value_;
}
void Option::unsafe_arena_set_allocated_value(
@@ -2760,7 +2760,7 @@ Option::Option(const Option& from)
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- if (from.name().size() > 0) {
+ if (!from.name().empty()) {
name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name(),
GetArenaNoVirtual());
}
@@ -2937,7 +2937,7 @@ void Option::SerializeWithCachedSizes(
// .google.protobuf.Any value = 2;
if (this->has_value()) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
- 2, HasBitSetters::value(this), output);
+ 2, _Internal::value(this), output);
}
if (_internal_metadata_.have_unknown_fields()) {
@@ -2968,7 +2968,7 @@ void Option::SerializeWithCachedSizes(
if (this->has_value()) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
- 2, HasBitSetters::value(this), target);
+ 2, _Internal::value(this), target);
}
if (_internal_metadata_.have_unknown_fields()) {
diff --git a/src/google/protobuf/type.pb.h b/src/google/protobuf/type.pb.h
index 0ded75db37..6da3d32569 100644
--- a/src/google/protobuf/type.pb.h
+++ b/src/google/protobuf/type.pb.h
@@ -383,7 +383,7 @@ class PROTOBUF_EXPORT Type :
// @@protoc_insertion_point(class_scope:google.protobuf.Type)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@@ -747,7 +747,7 @@ class PROTOBUF_EXPORT Field :
// @@protoc_insertion_point(class_scope:google.protobuf.Field)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@@ -954,7 +954,7 @@ class PROTOBUF_EXPORT Enum :
// @@protoc_insertion_point(class_scope:google.protobuf.Enum)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@@ -1132,7 +1132,7 @@ class PROTOBUF_EXPORT EnumValue :
// @@protoc_insertion_point(class_scope:google.protobuf.EnumValue)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@@ -1302,7 +1302,7 @@ class PROTOBUF_EXPORT Option :
// @@protoc_insertion_point(class_scope:google.protobuf.Option)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
diff --git a/src/google/protobuf/util/internal/json_objectwriter_test.cc b/src/google/protobuf/util/internal/json_objectwriter_test.cc
index 032977feae..4d190b8708 100644
--- a/src/google/protobuf/util/internal/json_objectwriter_test.cc
+++ b/src/google/protobuf/util/internal/json_objectwriter_test.cc
@@ -49,10 +49,12 @@ class JsonObjectWriterTest : public ::testing::Test {
out_stream_(new CodedOutputStream(str_stream_)),
ow_(nullptr) {}
- virtual ~JsonObjectWriterTest() {
- delete ow_;
+ ~JsonObjectWriterTest() override { delete ow_; }
+
+ std::string CloseStreamAndGetString() {
delete out_stream_;
delete str_stream_;
+ return output_;
}
std::string output_;
@@ -64,7 +66,7 @@ class JsonObjectWriterTest : public ::testing::Test {
TEST_F(JsonObjectWriterTest, EmptyRootObject) {
ow_ = new JsonObjectWriter("", out_stream_);
ow_->StartObject("")->EndObject();
- EXPECT_EQ("{}", output_.substr(0, out_stream_->ByteCount()));
+ EXPECT_EQ("{}", CloseStreamAndGetString());
}
TEST_F(JsonObjectWriterTest, EmptyObject) {
@@ -74,14 +76,13 @@ TEST_F(JsonObjectWriterTest, EmptyObject) {
->StartObject("empty")
->EndObject()
->EndObject();
- EXPECT_EQ("{\"test\":\"value\",\"empty\":{}}",
- output_.substr(0, out_stream_->ByteCount()));
+ EXPECT_EQ("{\"test\":\"value\",\"empty\":{}}", CloseStreamAndGetString());
}
TEST_F(JsonObjectWriterTest, EmptyRootList) {
ow_ = new JsonObjectWriter("", out_stream_);
ow_->StartList("")->EndList();
- EXPECT_EQ("[]", output_.substr(0, out_stream_->ByteCount()));
+ EXPECT_EQ("[]", CloseStreamAndGetString());
}
TEST_F(JsonObjectWriterTest, EmptyList) {
@@ -91,14 +92,13 @@ TEST_F(JsonObjectWriterTest, EmptyList) {
->StartList("empty")
->EndList()
->EndObject();
- EXPECT_EQ("{\"test\":\"value\",\"empty\":[]}",
- output_.substr(0, out_stream_->ByteCount()));
+ EXPECT_EQ("{\"test\":\"value\",\"empty\":[]}", CloseStreamAndGetString());
}
TEST_F(JsonObjectWriterTest, EmptyObjectKey) {
ow_ = new JsonObjectWriter("", out_stream_);
ow_->StartObject("")->RenderString("", "value")->EndObject();
- EXPECT_EQ("{\"\":\"value\"}", output_.substr(0, out_stream_->ByteCount()));
+ EXPECT_EQ("{\"\":\"value\"}", CloseStreamAndGetString());
}
TEST_F(JsonObjectWriterTest, ObjectInObject) {
@@ -108,8 +108,7 @@ TEST_F(JsonObjectWriterTest, ObjectInObject) {
->RenderString("field", "value")
->EndObject()
->EndObject();
- EXPECT_EQ("{\"nested\":{\"field\":\"value\"}}",
- output_.substr(0, out_stream_->ByteCount()));
+ EXPECT_EQ("{\"nested\":{\"field\":\"value\"}}", CloseStreamAndGetString());
}
TEST_F(JsonObjectWriterTest, ListInObject) {
@@ -119,8 +118,7 @@ TEST_F(JsonObjectWriterTest, ListInObject) {
->RenderString("", "value")
->EndList()
->EndObject();
- EXPECT_EQ("{\"nested\":[\"value\"]}",
- output_.substr(0, out_stream_->ByteCount()));
+ EXPECT_EQ("{\"nested\":[\"value\"]}", CloseStreamAndGetString());
}
TEST_F(JsonObjectWriterTest, ObjectInList) {
@@ -130,8 +128,7 @@ TEST_F(JsonObjectWriterTest, ObjectInList) {
->RenderString("field", "value")
->EndObject()
->EndList();
- EXPECT_EQ("[{\"field\":\"value\"}]",
- output_.substr(0, out_stream_->ByteCount()));
+ EXPECT_EQ("[{\"field\":\"value\"}]", CloseStreamAndGetString());
}
TEST_F(JsonObjectWriterTest, ListInList) {
@@ -141,7 +138,7 @@ TEST_F(JsonObjectWriterTest, ListInList) {
->RenderString("", "value")
->EndList()
->EndList();
- EXPECT_EQ("[[\"value\"]]", output_.substr(0, out_stream_->ByteCount()));
+ EXPECT_EQ("[[\"value\"]]", CloseStreamAndGetString());
}
TEST_F(JsonObjectWriterTest, RenderPrimitives) {
@@ -171,7 +168,7 @@ TEST_F(JsonObjectWriterTest, RenderPrimitives) {
"\"string\":\"string\","
"\"emptybytes\":\"\","
"\"emptystring\":\"\"}",
- output_.substr(0, out_stream_->ByteCount()));
+ CloseStreamAndGetString());
}
TEST_F(JsonObjectWriterTest, BytesEncodesAsNonWebSafeBase64) {
@@ -181,8 +178,7 @@ TEST_F(JsonObjectWriterTest, BytesEncodesAsNonWebSafeBase64) {
ow_ = new JsonObjectWriter("", out_stream_);
ow_->StartObject("")->RenderBytes("bytes", s)->EndObject();
// Non-web-safe would encode this as "/+8="
- EXPECT_EQ("{\"bytes\":\"/+8=\"}",
- output_.substr(0, out_stream_->ByteCount()));
+ EXPECT_EQ("{\"bytes\":\"/+8=\"}", CloseStreamAndGetString());
}
TEST_F(JsonObjectWriterTest, PrettyPrintList) {
@@ -205,7 +201,7 @@ TEST_F(JsonObjectWriterTest, PrettyPrintList) {
" ],\n"
" \"empty\": []\n"
"}\n",
- output_.substr(0, out_stream_->ByteCount()));
+ CloseStreamAndGetString());
}
TEST_F(JsonObjectWriterTest, PrettyPrintObject) {
@@ -228,7 +224,7 @@ TEST_F(JsonObjectWriterTest, PrettyPrintObject) {
" },\n"
" \"empty\": {}\n"
"}\n",
- output_.substr(0, out_stream_->ByteCount()));
+ CloseStreamAndGetString());
}
TEST_F(JsonObjectWriterTest, PrettyPrintEmptyObjectInEmptyList) {
@@ -245,7 +241,7 @@ TEST_F(JsonObjectWriterTest, PrettyPrintEmptyObjectInEmptyList) {
" {}\n"
" ]\n"
"}\n",
- output_.substr(0, out_stream_->ByteCount()));
+ CloseStreamAndGetString());
}
TEST_F(JsonObjectWriterTest, PrettyPrintDoubleIndent) {
@@ -259,14 +255,14 @@ TEST_F(JsonObjectWriterTest, PrettyPrintDoubleIndent) {
" \"bool\": true,\n"
" \"int\": 42\n"
"}\n",
- output_.substr(0, out_stream_->ByteCount()));
+ CloseStreamAndGetString());
}
TEST_F(JsonObjectWriterTest, StringsEscapedAndEnclosedInDoubleQuotes) {
ow_ = new JsonObjectWriter("", out_stream_);
ow_->StartObject("")->RenderString("string", "'<>&\\\"\r\n")->EndObject();
EXPECT_EQ("{\"string\":\"'\\u003c\\u003e&\\\\\\\"\\r\\n\"}",
- output_.substr(0, out_stream_->ByteCount()));
+ CloseStreamAndGetString());
}
TEST_F(JsonObjectWriterTest, Stringification) {
@@ -286,7 +282,7 @@ TEST_F(JsonObjectWriterTest, Stringification) {
"\"float_pos\":\"Infinity\","
"\"double_neg\":\"-Infinity\","
"\"float_neg\":\"-Infinity\"}",
- output_.substr(0, out_stream_->ByteCount()));
+ CloseStreamAndGetString());
}
TEST_F(JsonObjectWriterTest, TestRegularByteEncoding) {
@@ -297,8 +293,7 @@ TEST_F(JsonObjectWriterTest, TestRegularByteEncoding) {
// Test that we get regular (non websafe) base64 encoding on byte fields by
// default.
- EXPECT_EQ("{\"bytes\":\"A+/A\"}",
- output_.substr(0, out_stream_->ByteCount()));
+ EXPECT_EQ("{\"bytes\":\"A+/A\"}", CloseStreamAndGetString());
}
TEST_F(JsonObjectWriterTest, TestWebsafeByteEncoding) {
@@ -309,8 +304,7 @@ TEST_F(JsonObjectWriterTest, TestWebsafeByteEncoding) {
->EndObject();
// Test that we get websafe base64 encoding when explicitly asked.
- EXPECT_EQ("{\"bytes\":\"A-_AEA==\"}",
- output_.substr(0, out_stream_->ByteCount()));
+ EXPECT_EQ("{\"bytes\":\"A-_AEA==\"}", CloseStreamAndGetString());
}
} // namespace converter
diff --git a/src/google/protobuf/wrappers.pb.cc b/src/google/protobuf/wrappers.pb.cc
index e8100d9222..a4846613e7 100644
--- a/src/google/protobuf/wrappers.pb.cc
+++ b/src/google/protobuf/wrappers.pb.cc
@@ -307,7 +307,7 @@ PROTOBUF_NAMESPACE_OPEN
void DoubleValue::InitAsDefaultInstance() {
}
-class DoubleValue::HasBitSetters {
+class DoubleValue::_Internal {
public:
};
@@ -592,7 +592,7 @@ void DoubleValue::InternalSwap(DoubleValue* other) {
void FloatValue::InitAsDefaultInstance() {
}
-class FloatValue::HasBitSetters {
+class FloatValue::_Internal {
public:
};
@@ -877,7 +877,7 @@ void FloatValue::InternalSwap(FloatValue* other) {
void Int64Value::InitAsDefaultInstance() {
}
-class Int64Value::HasBitSetters {
+class Int64Value::_Internal {
public:
};
@@ -1164,7 +1164,7 @@ void Int64Value::InternalSwap(Int64Value* other) {
void UInt64Value::InitAsDefaultInstance() {
}
-class UInt64Value::HasBitSetters {
+class UInt64Value::_Internal {
public:
};
@@ -1451,7 +1451,7 @@ void UInt64Value::InternalSwap(UInt64Value* other) {
void Int32Value::InitAsDefaultInstance() {
}
-class Int32Value::HasBitSetters {
+class Int32Value::_Internal {
public:
};
@@ -1738,7 +1738,7 @@ void Int32Value::InternalSwap(Int32Value* other) {
void UInt32Value::InitAsDefaultInstance() {
}
-class UInt32Value::HasBitSetters {
+class UInt32Value::_Internal {
public:
};
@@ -2025,7 +2025,7 @@ void UInt32Value::InternalSwap(UInt32Value* other) {
void BoolValue::InitAsDefaultInstance() {
}
-class BoolValue::HasBitSetters {
+class BoolValue::_Internal {
public:
};
@@ -2310,7 +2310,7 @@ void BoolValue::InternalSwap(BoolValue* other) {
void StringValue::InitAsDefaultInstance() {
}
-class StringValue::HasBitSetters {
+class StringValue::_Internal {
public:
};
@@ -2335,7 +2335,7 @@ StringValue::StringValue(const StringValue& from)
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- if (from.value().size() > 0) {
+ if (!from.value().empty()) {
value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.value(),
GetArenaNoVirtual());
}
@@ -2617,7 +2617,7 @@ void StringValue::InternalSwap(StringValue* other) {
void BytesValue::InitAsDefaultInstance() {
}
-class BytesValue::HasBitSetters {
+class BytesValue::_Internal {
public:
};
@@ -2642,7 +2642,7 @@ BytesValue::BytesValue(const BytesValue& from)
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- if (from.value().size() > 0) {
+ if (!from.value().empty()) {
value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.value(),
GetArenaNoVirtual());
}
diff --git a/src/google/protobuf/wrappers.pb.h b/src/google/protobuf/wrappers.pb.h
index b5ded2a08c..5deb4ecc47 100644
--- a/src/google/protobuf/wrappers.pb.h
+++ b/src/google/protobuf/wrappers.pb.h
@@ -227,7 +227,7 @@ class PROTOBUF_EXPORT DoubleValue :
// @@protoc_insertion_point(class_scope:google.protobuf.DoubleValue)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@@ -368,7 +368,7 @@ class PROTOBUF_EXPORT FloatValue :
// @@protoc_insertion_point(class_scope:google.protobuf.FloatValue)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@@ -509,7 +509,7 @@ class PROTOBUF_EXPORT Int64Value :
// @@protoc_insertion_point(class_scope:google.protobuf.Int64Value)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@@ -650,7 +650,7 @@ class PROTOBUF_EXPORT UInt64Value :
// @@protoc_insertion_point(class_scope:google.protobuf.UInt64Value)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@@ -791,7 +791,7 @@ class PROTOBUF_EXPORT Int32Value :
// @@protoc_insertion_point(class_scope:google.protobuf.Int32Value)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@@ -932,7 +932,7 @@ class PROTOBUF_EXPORT UInt32Value :
// @@protoc_insertion_point(class_scope:google.protobuf.UInt32Value)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@@ -1073,7 +1073,7 @@ class PROTOBUF_EXPORT BoolValue :
// @@protoc_insertion_point(class_scope:google.protobuf.BoolValue)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@@ -1229,7 +1229,7 @@ class PROTOBUF_EXPORT StringValue :
// @@protoc_insertion_point(class_scope:google.protobuf.StringValue)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@@ -1385,7 +1385,7 @@ class PROTOBUF_EXPORT BytesValue :
// @@protoc_insertion_point(class_scope:google.protobuf.BytesValue)
private:
- class HasBitSetters;
+ class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;