();
- for (int i = 0; i < dependencies.length; i++) {
- try {
- Class> clazz = descriptorOuterClass.getClassLoader().loadClass(dependencies[i]);
- descriptors.add((FileDescriptor) clazz.getField("descriptor").get(null));
- } catch (Exception e) {
- // We allow unknown dependencies by default. If a dependency cannot
- // be found we only generate a warning.
- logger.warning("Descriptors for \"" + dependencyFileNames[i] + "\" can not be found.");
- }
- }
- FileDescriptor[] descriptorArray = new FileDescriptor[descriptors.size()];
- descriptors.toArray(descriptorArray);
- internalBuildGeneratedFileFrom(descriptorDataParts, descriptorArray, descriptorAssigner);
+ FileDescriptor[] dependencies = findDescriptors(
+ descriptorOuterClass, dependencyClassNames, dependencyFileNames);
+ internalBuildGeneratedFileFrom(
+ descriptorDataParts, dependencies, descriptorAssigner);
+ }
+
+ /**
+ * This method is to be called by generated code only. It uses Java reflection to load the
+ * dependencies' descriptors.
+ */
+ public static FileDescriptor internalBuildGeneratedFileFrom(
+ final String[] descriptorDataParts,
+ final Class> descriptorOuterClass,
+ final String[] dependencyClassNames,
+ final String[] dependencyFileNames) {
+ FileDescriptor[] dependencies = findDescriptors(
+ descriptorOuterClass, dependencyClassNames, dependencyFileNames);
+ return internalBuildGeneratedFileFrom(descriptorDataParts, dependencies);
}
/**
@@ -427,7 +481,10 @@ public final class Descriptors {
* extensions which might be used in the descriptor -- that is, extensions of the various
* "Options" messages defined in descriptor.proto. The callback may also return null to indicate
* that no extensions are used in the descriptor.
+ *
+ * This interface is deprecated. Use the return value of internalBuildGeneratedFrom() instead.
*/
+ @Deprecated
public interface InternalDescriptorAssigner {
ExtensionRegistry assignDescriptors(FileDescriptor root);
}
diff --git a/java/core/src/main/java/com/google/protobuf/MessageReflection.java b/java/core/src/main/java/com/google/protobuf/MessageReflection.java
index cbcf938164..6741e1cb9c 100644
--- a/java/core/src/main/java/com/google/protobuf/MessageReflection.java
+++ b/java/core/src/main/java/com/google/protobuf/MessageReflection.java
@@ -804,12 +804,15 @@ class MessageReflection {
field, field.getEnumType().findValueByNumberCreatingIfUnknown(rawValue));
} else {
final Object value = field.getEnumType().findValueByNumber(rawValue);
+ // If the number isn't recognized as a valid value for this enum,
+ // add it to the unknown fields.
if (value == null) {
- // If the number isn't recognized as a valid value for this
- // enum, drop it (don't even add it to unknownFields).
- return true;
+ if (unknownFields != null) {
+ unknownFields.mergeVarintField(fieldNumber, rawValue);
+ }
+ } else {
+ target.addRepeatedField(field, value);
}
- target.addRepeatedField(field, value);
}
}
} else {
@@ -841,7 +844,7 @@ class MessageReflection {
} else {
value = field.getEnumType().findValueByNumber(rawValue);
// If the number isn't recognized as a valid value for this enum,
- // drop it.
+ // add it to the unknown fields.
if (value == null) {
if (unknownFields != null) {
unknownFields.mergeVarintField(fieldNumber, rawValue);
diff --git a/java/core/src/main/java/com/google/protobuf/RopeByteString.java b/java/core/src/main/java/com/google/protobuf/RopeByteString.java
index 140cbe45af..c3bec7b1a1 100644
--- a/java/core/src/main/java/com/google/protobuf/RopeByteString.java
+++ b/java/core/src/main/java/com/google/protobuf/RopeByteString.java
@@ -77,36 +77,58 @@ final class RopeByteString extends ByteString {
* in deeper binary trees.
*
* For 32-bit integers, this array has length 46.
+ *
+ *
The correctness of this constant array is validated in tests.
*/
- private static final int[] minLengthByDepth;
-
- static {
- // Dynamically generate the list of Fibonacci numbers the first time this
- // class is accessed.
- List numbers = new ArrayList();
-
- // we skip the first Fibonacci number (1). So instead of: 1 1 2 3 5 8 ...
- // we have: 1 2 3 5 8 ...
- int f1 = 1;
- int f2 = 1;
-
- // get all the values until we roll over.
- while (f2 > 0) {
- numbers.add(f2);
- int temp = f1 + f2;
- f1 = f2;
- f2 = temp;
- }
-
- // we include this here so that we can index this array to [x + 1] in the
- // loops below.
- numbers.add(Integer.MAX_VALUE);
- minLengthByDepth = new int[numbers.size()];
- for (int i = 0; i < minLengthByDepth.length; i++) {
- // unbox all the values
- minLengthByDepth[i] = numbers.get(i);
- }
- }
+ static final int[] minLengthByDepth = {
+ 1,
+ 1,
+ 2,
+ 3,
+ 5,
+ 8,
+ 13,
+ 21,
+ 34,
+ 55,
+ 89,
+ 144,
+ 233,
+ 377,
+ 610,
+ 987,
+ 1597,
+ 2584,
+ 4181,
+ 6765,
+ 10946,
+ 17711,
+ 28657,
+ 46368,
+ 75025,
+ 121393,
+ 196418,
+ 317811,
+ 514229,
+ 832040,
+ 1346269,
+ 2178309,
+ 3524578,
+ 5702887,
+ 9227465,
+ 14930352,
+ 24157817,
+ 39088169,
+ 63245986,
+ 102334155,
+ 165580141,
+ 267914296,
+ 433494437,
+ 701408733,
+ 1134903170,
+ 1836311903,
+ Integer.MAX_VALUE
+ };
private final int totalLength;
private final ByteString left;
@@ -686,11 +708,19 @@ final class RopeByteString extends ByteString {
* This iterator is used to implement {@link RopeByteString#equalsFragments(ByteString)}.
*/
private static final class PieceIterator implements Iterator {
- private final ArrayDeque breadCrumbs = new ArrayDeque<>();
+ private final ArrayDeque breadCrumbs;
private LeafByteString next;
private PieceIterator(ByteString root) {
- next = getLeafByLeft(root);
+ if (root instanceof RopeByteString) {
+ RopeByteString rbs = (RopeByteString) root;
+ breadCrumbs = new ArrayDeque<>(rbs.getTreeDepth());
+ breadCrumbs.push(rbs);
+ next = getLeafByLeft(rbs.left);
+ } else {
+ breadCrumbs = null;
+ next = (LeafByteString) root;
+ }
}
private LeafByteString getLeafByLeft(ByteString root) {
@@ -707,7 +737,7 @@ final class RopeByteString extends ByteString {
while (true) {
// Almost always, we go through this loop exactly once. However, if
// we discover an empty string in the rope, we toss it and try again.
- if (breadCrumbs.isEmpty()) {
+ if (breadCrumbs == null || breadCrumbs.isEmpty()) {
return null;
} else {
LeafByteString result = getLeafByLeft(breadCrumbs.pop().right);
diff --git a/java/core/src/main/java/com/google/protobuf/UnsafeUtil.java b/java/core/src/main/java/com/google/protobuf/UnsafeUtil.java
index ddd358564b..74c2012749 100644
--- a/java/core/src/main/java/com/google/protobuf/UnsafeUtil.java
+++ b/java/core/src/main/java/com/google/protobuf/UnsafeUtil.java
@@ -48,7 +48,7 @@ final class UnsafeUtil {
supportsUnsafeByteBufferOperations();
private static final boolean HAS_UNSAFE_ARRAY_OPERATIONS = supportsUnsafeArrayOperations();
- private static final long BYTE_ARRAY_BASE_OFFSET = arrayBaseOffset(byte[].class);
+ static final long BYTE_ARRAY_BASE_OFFSET = arrayBaseOffset(byte[].class);
// Micro-optimization: we can assume a scale of 1 and skip the multiply
// private static final long BYTE_ARRAY_INDEX_SCALE = 1;
@@ -72,6 +72,13 @@ final class UnsafeUtil {
private static final long BUFFER_ADDRESS_OFFSET = fieldOffset(bufferAddressField());
+ private static final int STRIDE = 8;
+ private static final int STRIDE_ALIGNMENT_MASK = STRIDE - 1;
+ private static final int BYTE_ARRAY_ALIGNMENT =
+ (int) (BYTE_ARRAY_BASE_OFFSET & STRIDE_ALIGNMENT_MASK);
+
+ static final boolean IS_BIG_ENDIAN = ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN;
+
private UnsafeUtil() {}
static boolean hasUnsafeArrayOperations() {
@@ -382,6 +389,80 @@ final class UnsafeUtil {
return field != null && field.getType() == long.class ? field : null;
}
+ /**
+ * Returns the index of the first byte where left and right differ, in the range [0, 8]. If {@code
+ * left == right}, the result will be 8, otherwise less than 8.
+ *
+ * This counts from the *first* byte, which may be the most or least significant byte depending
+ * on the system endianness.
+ */
+ private static int firstDifferingByteIndexNativeEndian(long left, long right) {
+ int n =
+ IS_BIG_ENDIAN
+ ? Long.numberOfLeadingZeros(left ^ right)
+ : Long.numberOfTrailingZeros(left ^ right);
+ return n >> 3;
+ }
+
+ /**
+ * Returns the lowest {@code index} such that {@code 0 <= index < length} and {@code left[leftOff
+ * + index] != right[rightOff + index]}. If no such value exists -- if {@code left} and {@code
+ * right} match up to {@code length} bytes from their respective offsets -- returns -1.
+ *
+ *
{@code leftOff + length} must be less than or equal to {@code left.length}, and the same for
+ * {@code right}.
+ */
+ static int mismatch(byte[] left, int leftOff, byte[] right, int rightOff, int length) {
+ if (leftOff < 0
+ || rightOff < 0
+ || length < 0
+ || leftOff + length > left.length
+ || rightOff + length > right.length) {
+ throw new IndexOutOfBoundsException();
+ }
+
+ int index = 0;
+ if (HAS_UNSAFE_ARRAY_OPERATIONS) {
+ int leftAlignment = (BYTE_ARRAY_ALIGNMENT + leftOff) & STRIDE_ALIGNMENT_MASK;
+
+ // Most CPUs handle getting chunks of bytes better on addresses that are a multiple of 4
+ // or 8.
+ // We walk one byte at a time until the left address, at least, is a multiple of 8.
+ // If the right address is, too, so much the better.
+ for (;
+ index < length && (leftAlignment & STRIDE_ALIGNMENT_MASK) != 0;
+ index++, leftAlignment++) {
+ if (left[leftOff + index] != right[rightOff + index]) {
+ return index;
+ }
+ }
+
+ // Stride! Grab eight bytes at a time from left and right and check them for equality.
+
+ int strideLength = ((length - index) & ~STRIDE_ALIGNMENT_MASK) + index;
+ // strideLength is the point where we want to stop striding: it differs from index by
+ // a multiple of STRIDE, and it's the largest such number <= length.
+
+ for (; index < strideLength; index += STRIDE) {
+ long leftLongWord = getLong(left, BYTE_ARRAY_BASE_OFFSET + leftOff + index);
+ long rightLongWord = getLong(right, BYTE_ARRAY_BASE_OFFSET + rightOff + index);
+ if (leftLongWord != rightLongWord) {
+ // one of these eight bytes differ! use a helper to find out which one
+ return index + firstDifferingByteIndexNativeEndian(leftLongWord, rightLongWord);
+ }
+ }
+ }
+
+ // If we were able to stride, there are at most STRIDE - 1 bytes left to compare.
+ // If we weren't, then this loop covers the whole thing.
+ for (; index < length; index++) {
+ if (left[leftOff + index] != right[rightOff + index]) {
+ return index;
+ }
+ }
+ return -1;
+ }
+
/**
* Returns the offset of the provided field, or {@code -1} if {@code sun.misc.Unsafe} is not
* available.
diff --git a/java/core/src/test/java/com/google/protobuf/RopeByteStringTest.java b/java/core/src/test/java/com/google/protobuf/RopeByteStringTest.java
index 59e8ede1db..9299267212 100644
--- a/java/core/src/test/java/com/google/protobuf/RopeByteStringTest.java
+++ b/java/core/src/test/java/com/google/protobuf/RopeByteStringTest.java
@@ -62,6 +62,21 @@ public class RopeByteStringTest extends LiteralByteStringTest {
expectedHashCode = -1214197238;
}
+ public void testMinLengthByDepth() {
+ // minLengthByDepth should match the Fibonacci sequence
+ int a = 1;
+ int b = 1;
+ int i;
+ for (i = 0; a > 0; i++) {
+ assertEquals(a, RopeByteString.minLengthByDepth[i]);
+ int c = a + b;
+ a = b;
+ b = c;
+ }
+ assertEquals(Integer.MAX_VALUE, RopeByteString.minLengthByDepth[i]);
+ assertEquals(i + 1, RopeByteString.minLengthByDepth.length);
+ }
+
@Override
public void testGetTreeDepth() {
assertEquals(
diff --git a/java/core/src/test/java/com/google/protobuf/ServiceTest.java b/java/core/src/test/java/com/google/protobuf/ServiceTest.java
index d9a6d7ce5c..1592433c2f 100644
--- a/java/core/src/test/java/com/google/protobuf/ServiceTest.java
+++ b/java/core/src/test/java/com/google/protobuf/ServiceTest.java
@@ -32,7 +32,6 @@ package com.google.protobuf;
import com.google.protobuf.Descriptors.FileDescriptor;
import com.google.protobuf.Descriptors.MethodDescriptor;
-import google.protobuf.no_generic_services_test.UnittestNoGenericServices;
import protobuf_unittest.MessageWithNoOuter;
import protobuf_unittest.ServiceWithNoOuter;
import protobuf_unittest.UnittestProto.BarRequest;
@@ -41,6 +40,7 @@ import protobuf_unittest.UnittestProto.FooRequest;
import protobuf_unittest.UnittestProto.FooResponse;
import protobuf_unittest.UnittestProto.TestAllTypes;
import protobuf_unittest.UnittestProto.TestService;
+import protobuf_unittest.no_generic_services_test.UnittestNoGenericServices;
import java.util.HashSet;
import java.util.Set;
import junit.framework.TestCase;
@@ -227,7 +227,7 @@ public class ServiceTest extends TestCase {
// Build a list of the class names nested in UnittestNoGenericServices.
String outerName =
- "google.protobuf.no_generic_services_test.UnittestNoGenericServices";
+ "protobuf_unittest.no_generic_services_test.UnittestNoGenericServices";
Class> outerClass = Class.forName(outerName);
Set innerClassNames = new HashSet();
diff --git a/java/core/src/test/java/com/google/protobuf/UnknownEnumValueTest.java b/java/core/src/test/java/com/google/protobuf/UnknownEnumValueTest.java
index cc18547bb3..ae4e086ee1 100644
--- a/java/core/src/test/java/com/google/protobuf/UnknownEnumValueTest.java
+++ b/java/core/src/test/java/com/google/protobuf/UnknownEnumValueTest.java
@@ -35,6 +35,10 @@ import com.google.protobuf.Descriptors.EnumDescriptor;
import com.google.protobuf.Descriptors.EnumValueDescriptor;
import com.google.protobuf.Descriptors.FieldDescriptor;
import com.google.protobuf.FieldPresenceTestProto.TestAllTypes;
+import com.google.protobuf.Proto2UnknownEnumValuesTestProto.Proto2EnumMessage;
+import com.google.protobuf.Proto2UnknownEnumValuesTestProto.Proto2EnumMessageWithEnumSubset;
+import com.google.protobuf.Proto2UnknownEnumValuesTestProto.Proto2TestEnum;
+import com.google.protobuf.Proto2UnknownEnumValuesTestProto.Proto2TestEnumSubset;
import com.google.protobuf.TextFormat.ParseException;
import junit.framework.TestCase;
@@ -42,6 +46,7 @@ import junit.framework.TestCase;
* Unit tests for protos that keep unknown enum values rather than discard them as unknown fields.
*/
public class UnknownEnumValueTest extends TestCase {
+
public void testUnknownEnumValues() throws Exception {
TestAllTypes.Builder builder = TestAllTypes.newBuilder();
builder.setOptionalNestedEnumValue(4321);
@@ -245,4 +250,61 @@ public class UnknownEnumValueTest extends TestCase {
// expected.
}
}
+
+ public void testUnknownEnumValuesInProto2() throws Exception {
+ Proto2EnumMessage.Builder sourceMessage = Proto2EnumMessage.newBuilder();
+ sourceMessage
+ .addRepeatedPackedEnum(Proto2TestEnum.ZERO)
+ .addRepeatedPackedEnum(Proto2TestEnum.TWO) // Unknown in parsed proto
+ .addRepeatedPackedEnum(Proto2TestEnum.ONE);
+
+ Proto2EnumMessageWithEnumSubset destMessage =
+ Proto2EnumMessageWithEnumSubset.parseFrom(sourceMessage.build().toByteArray());
+
+ // Known enum values should be preserved.
+ assertEquals(2, destMessage.getRepeatedPackedEnumCount());
+ assertEquals(Proto2TestEnumSubset.TESTENUM_SUBSET_ZERO, destMessage.getRepeatedPackedEnum(0));
+ assertEquals(Proto2TestEnumSubset.TESTENUM_SUBSET_ONE, destMessage.getRepeatedPackedEnum(1));
+
+ // Unknown enum values should be found in UnknownFieldSet.
+ UnknownFieldSet unknown = destMessage.getUnknownFields();
+ assertEquals(
+ Proto2TestEnum.TWO_VALUE,
+ unknown
+ .getField(Proto2EnumMessageWithEnumSubset.REPEATED_PACKED_ENUM_FIELD_NUMBER)
+ .getVarintList()
+ .get(0)
+ .longValue());
+ }
+
+ public void testUnknownEnumValuesInProto2WithDynamicMessage() throws Exception {
+ Descriptor descriptor = Proto2EnumMessageWithEnumSubset.getDescriptor();
+ FieldDescriptor repeatedPackedField = descriptor.findFieldByName("repeated_packed_enum");
+
+ Proto2EnumMessage.Builder sourceMessage = Proto2EnumMessage.newBuilder();
+ sourceMessage
+ .addRepeatedPackedEnum(Proto2TestEnum.ZERO)
+ .addRepeatedPackedEnum(Proto2TestEnum.TWO) // Unknown in parsed proto
+ .addRepeatedPackedEnum(Proto2TestEnum.ONE);
+
+ DynamicMessage message =
+ DynamicMessage.parseFrom(
+ Proto2EnumMessageWithEnumSubset.getDescriptor(), sourceMessage.build().toByteArray());
+
+ // Known enum values should be preserved.
+ assertEquals(2, message.getRepeatedFieldCount(repeatedPackedField));
+ EnumValueDescriptor enumValue0 =
+ (EnumValueDescriptor) message.getRepeatedField(repeatedPackedField, 0);
+ EnumValueDescriptor enumValue1 =
+ (EnumValueDescriptor) message.getRepeatedField(repeatedPackedField, 1);
+
+ assertEquals(Proto2TestEnumSubset.TESTENUM_SUBSET_ZERO_VALUE, enumValue0.getNumber());
+ assertEquals(Proto2TestEnumSubset.TESTENUM_SUBSET_ONE_VALUE, enumValue1.getNumber());
+
+ // Unknown enum values should be found in UnknownFieldSet.
+ UnknownFieldSet unknown = message.getUnknownFields();
+ assertEquals(
+ Proto2TestEnum.TWO_VALUE,
+ unknown.getField(repeatedPackedField.getNumber()).getVarintList().get(0).longValue());
+ }
}
diff --git a/conformance/binary_json_conformance_main.cc b/java/core/src/test/proto/com/google/protobuf/proto2_unknown_enum_values.proto
similarity index 67%
rename from conformance/binary_json_conformance_main.cc
rename to java/core/src/test/proto/com/google/protobuf/proto2_unknown_enum_values.proto
index 3e8df7343f..5d470ac0e3 100644
--- a/conformance/binary_json_conformance_main.cc
+++ b/java/core/src/test/proto/com/google/protobuf/proto2_unknown_enum_values.proto
@@ -28,10 +28,33 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "binary_json_conformance_suite.h"
-#include "conformance_test.h"
+syntax = "proto2";
-int main(int argc, char *argv[]) {
- google::protobuf::BinaryAndJsonConformanceSuite suite;
- return google::protobuf::ForkPipeRunner::Run(argc, argv, &suite);
+package proto2_unknown_enum_values;
+
+option java_package = "com.google.protobuf";
+option java_outer_classname = "Proto2UnknownEnumValuesTestProto";
+
+enum Proto2TestEnum {
+ ZERO = 0;
+ ONE = 1;
+ TWO = 2;
+}
+
+message Proto2EnumMessage {
+ repeated Proto2TestEnum repeated_packed_enum = 1 [packed = true];
+}
+
+// An enum containing a subset of the values of Proto2TestEnum, to test
+// parsing unknown packed enum values
+enum Proto2TestEnumSubset {
+ TESTENUM_SUBSET_ZERO = 0;
+ TESTENUM_SUBSET_ONE = 1;
+ // No enum value with number 2.
+}
+
+// Test messages for packed enum, with identical field number as
+// Proto2Message, to test parsing unknown packed enums.
+message Proto2EnumMessageWithEnumSubset {
+ repeated Proto2TestEnumSubset repeated_packed_enum = 1 [packed = true];
}
diff --git a/js/compatibility_tests/v3.1.0/message_test.js b/js/compatibility_tests/v3.1.0/message_test.js
index c1023784fa..d5c73742b6 100644
--- a/js/compatibility_tests/v3.1.0/message_test.js
+++ b/js/compatibility_tests/v3.1.0/message_test.js
@@ -102,14 +102,14 @@ describe('Message test suite', function() {
});
it('testComplexConversion', function() {
- var data1 = ['a',,, [, 11], [[, 22], [, 33]],, ['s1', 's2'],, 1];
- var data2 = ['a',,, [, 11], [[, 22], [, 33]],, ['s1', 's2'],, 1];
+ var data1 = ['a',,, [, 11], [[, 22], [, 33]],, ['s1', 's2'],, true];
+ var data2 = ['a',,, [, 11], [[, 22], [, 33]],, ['s1', 's2'],, true];
var foo = new proto.jspb.test.Complex(data1);
var bar = new proto.jspb.test.Complex(data2);
var result = foo.toObject();
assertObjectEquals({
aString: 'a',
- anOutOfOrderBool: 1,
+ anOutOfOrderBool: true,
aNestedMessage: {
anInt: 11
},
@@ -121,7 +121,7 @@ describe('Message test suite', function() {
result = foo.toObject(true /* opt_includeInstance */);
assertObjectEquals({
aString: 'a',
- anOutOfOrderBool: 1,
+ anOutOfOrderBool: true,
aNestedMessage: {
anInt: 11,
$jspbMessageInstance: foo.getANestedMessage()
diff --git a/js/message.js b/js/message.js
index eb546784a0..7adcc25d1a 100644
--- a/js/message.js
+++ b/js/message.js
@@ -268,12 +268,12 @@ jspb.Message.prototype.messageId_;
/**
- * Repeated float or double fields which have been converted to include only
- * numbers and not strings holding "NaN", "Infinity" and "-Infinity".
+ * Repeated fields that have been converted to their proper type. This is used
+ * for numbers stored as strings (typically "NaN", "Infinity" and "-Infinity")
+ * and for booleans stored as numbers (0 or 1).
* @private {!Object|undefined}
*/
-jspb.Message.prototype.convertedFloatingPointFields_;
-
+jspb.Message.prototype.convertedPrimitiveFields_;
/**
* Repeated fields numbers.
@@ -368,7 +368,7 @@ jspb.Message.initialize = function(
msg.arrayIndexOffset_ = messageId === 0 ? -1 : 0;
msg.array = data;
jspb.Message.initPivotAndExtensionObject_(msg, suggestedPivot);
- msg.convertedFloatingPointFields_ = {};
+ msg.convertedPrimitiveFields_ = {};
if (!jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS) {
// TODO(jakubvrana): This is same for all instances, move to prototype.
@@ -718,6 +718,20 @@ jspb.Message.getOptionalFloatingPointField = function(msg, fieldNumber) {
};
+/**
+ * Gets the value of an optional boolean field.
+ * @param {!jspb.Message} msg A jspb proto.
+ * @param {number} fieldNumber The field number.
+ * @return {?boolean|undefined} The field's value.
+ * @protected
+ */
+jspb.Message.getBooleanField = function(msg, fieldNumber) {
+ var value = jspb.Message.getField(msg, fieldNumber);
+ // TODO(b/122673075): always return null when the value is null-ish.
+ return value == null ? (value) : !!value;
+};
+
+
/**
* Gets the value of a repeated float or double field.
* @param {!jspb.Message} msg A jspb proto.
@@ -727,20 +741,42 @@ jspb.Message.getOptionalFloatingPointField = function(msg, fieldNumber) {
*/
jspb.Message.getRepeatedFloatingPointField = function(msg, fieldNumber) {
var values = jspb.Message.getRepeatedField(msg, fieldNumber);
- if (!msg.convertedFloatingPointFields_) {
- msg.convertedFloatingPointFields_ = {};
+ if (!msg.convertedPrimitiveFields_) {
+ msg.convertedPrimitiveFields_ = {};
}
- if (!msg.convertedFloatingPointFields_[fieldNumber]) {
+ if (!msg.convertedPrimitiveFields_[fieldNumber]) {
for (var i = 0; i < values.length; i++) {
// Converts "NaN", "Infinity" and "-Infinity" to their corresponding
// numbers.
values[i] = +values[i];
}
- msg.convertedFloatingPointFields_[fieldNumber] = true;
+ msg.convertedPrimitiveFields_[fieldNumber] = true;
}
return /** @type {!Array} */ (values);
};
+/**
+ * Gets the value of a repeated boolean field.
+ * @param {!jspb.Message} msg A jspb proto.
+ * @param {number} fieldNumber The field number.
+ * @return {!Array} The field's value.
+ * @protected
+ */
+jspb.Message.getRepeatedBooleanField = function(msg, fieldNumber) {
+ var values = jspb.Message.getRepeatedField(msg, fieldNumber);
+ if (!msg.convertedPrimitiveFields_) {
+ msg.convertedPrimitiveFields_ = {};
+ }
+ if (!msg.convertedPrimitiveFields_[fieldNumber]) {
+ for (var i = 0; i < values.length; i++) {
+ // Converts 0 and 1 to their corresponding booleans.
+ values[i] = !!values[i];
+ }
+ msg.convertedPrimitiveFields_[fieldNumber] = true;
+ }
+ return /** @type {!Array} */ (values);
+};
+
/**
* Coerce a 'bytes' field to a base 64 string.
@@ -849,6 +885,49 @@ jspb.Message.getFieldWithDefault = function(msg, fieldNumber, defaultValue) {
};
+/**
+ * Gets the value of a boolean field, with proto3 (non-nullable primitives)
+ * semantics. Returns `defaultValue` if the field is not otherwise set.
+ * @template T
+ * @param {!jspb.Message} msg A jspb proto.
+ * @param {number} fieldNumber The field number.
+ * @param {boolean} defaultValue The default value.
+ * @return {boolean} The field's value.
+ * @protected
+ */
+jspb.Message.getBooleanFieldWithDefault = function(
+ msg, fieldNumber, defaultValue) {
+ var value = jspb.Message.getBooleanField(msg, fieldNumber);
+ if (value == null) {
+ return defaultValue;
+ } else {
+ return value;
+ }
+};
+
+
+/**
+ * Gets the value of a floating point field, with proto3 (non-nullable
+ * primitives) semantics. Returns `defaultValue` if the field is not otherwise
+ * set.
+ * @template T
+ * @param {!jspb.Message} msg A jspb proto.
+ * @param {number} fieldNumber The field number.
+ * @param {number} defaultValue The default value.
+ * @return {number} The field's value.
+ * @protected
+ */
+jspb.Message.getFloatingPointFieldWithDefault = function(
+ msg, fieldNumber, defaultValue) {
+ var value = jspb.Message.getOptionalFloatingPointField(msg, fieldNumber);
+ if (value == null) {
+ return defaultValue;
+ } else {
+ return value;
+ }
+};
+
+
/**
* Alias for getFieldWithDefault used by older generated code.
* @template T
diff --git a/js/message_test.js b/js/message_test.js
index 7d2cdbae80..a9fc64a98f 100644
--- a/js/message_test.js
+++ b/js/message_test.js
@@ -86,6 +86,7 @@ goog.require('proto.jspb.exttest.floatingMsgField');
goog.require('proto.jspb.exttest.floatingMsgFieldTwo');
// CommonJS-LoadFromFile: test_pb proto.jspb.test
+goog.require('proto.jspb.test.BooleanFields');
goog.require('proto.jspb.test.CloneExtension');
goog.require('proto.jspb.test.Complex');
goog.require('proto.jspb.test.DefaultValues');
@@ -157,10 +158,11 @@ describe('Message test suite', function() {
assertObjectEquals(
{
aString: 'a',
- anOutOfOrderBool: 1,
+ anOutOfOrderBool: true,
aNestedMessage: {anInt: 11},
aRepeatedMessageList: [{anInt: 22}, {anInt: 33}],
- aRepeatedStringList: ['s1', 's2']
+ aRepeatedStringList: ['s1', 's2'],
+ aFloatingPointField: undefined,
},
result);
@@ -169,7 +171,7 @@ describe('Message test suite', function() {
assertObjectEquals(
{
aString: 'a',
- anOutOfOrderBool: 1,
+ anOutOfOrderBool: true,
aNestedMessage:
{anInt: 11, $jspbMessageInstance: foo.getANestedMessage()},
aRepeatedMessageList: [
@@ -177,6 +179,7 @@ describe('Message test suite', function() {
{anInt: 33, $jspbMessageInstance: foo.getARepeatedMessageList()[1]}
],
aRepeatedStringList: ['s1', 's2'],
+ aFloatingPointField: undefined,
$jspbMessageInstance: foo
},
result);
@@ -200,7 +203,8 @@ describe('Message test suite', function() {
aNestedMessage: {anInt: undefined},
// Note: JsPb converts undefined repeated fields to empty arrays.
aRepeatedMessageList: [],
- aRepeatedStringList: []
+ aRepeatedStringList: [],
+ aFloatingPointField: undefined,
},
result);
@@ -869,6 +873,53 @@ describe('Message test suite', function() {
assertNan(message.getDefaultDoubleField());
});
+ it('testFloatingPointsAreConvertedFromStringInput', function() {
+ var assertInf = function(x) {
+ assertTrue(
+ 'Expected ' + x + ' (' + goog.typeOf(x) + ') to be Infinity.',
+ x === Infinity);
+ };
+ var message = new proto.jspb.test.FloatingPointFields([
+ Infinity, 'Infinity', ['Infinity', Infinity], 'Infinity', 'Infinity',
+ 'Infinity', ['Infinity', Infinity], 'Infinity'
+ ]);
+ assertInf(message.getOptionalFloatField());
+ assertInf(message.getRequiredFloatField());
+ assertInf(message.getRepeatedFloatFieldList()[0]);
+ assertInf(message.getRepeatedFloatFieldList()[1]);
+ assertInf(message.getDefaultFloatField());
+ assertInf(message.getOptionalDoubleField());
+ assertInf(message.getRequiredDoubleField());
+ assertInf(message.getRepeatedDoubleFieldList()[0]);
+ assertInf(message.getRepeatedDoubleFieldList()[1]);
+ assertInf(message.getDefaultDoubleField());
+ });
+
+ it('testBooleansAreConvertedFromNumberInput', function() {
+ var assertBooleanFieldTrue = function(x) {
+ assertTrue(
+ 'Expected ' + x + ' (' + goog.typeOf(x) + ') to be True.',
+ x === true);
+ };
+ var message = new proto.jspb.test.BooleanFields([1, 1, [true, 1]]);
+ assertBooleanFieldTrue(message.getOptionalBooleanField());
+ assertBooleanFieldTrue(message.getRequiredBooleanField());
+ assertBooleanFieldTrue(message.getRepeatedBooleanFieldList()[0]);
+ assertBooleanFieldTrue(message.getRepeatedBooleanFieldList()[1]);
+ assertBooleanFieldTrue(message.getDefaultBooleanField());
+
+ var assertBooleanFieldFalse = function(x) {
+ assertTrue(
+ 'Expected ' + x + ' (' + goog.typeOf(x) + ') to be False.',
+ x === false);
+ };
+ message = new proto.jspb.test.BooleanFields([0, 0, [0, 0]]);
+ assertBooleanFieldFalse(message.getOptionalBooleanField());
+ assertBooleanFieldFalse(message.getRequiredBooleanField());
+ assertBooleanFieldFalse(message.getRepeatedBooleanFieldList()[0]);
+ assertBooleanFieldFalse(message.getRepeatedBooleanFieldList()[1]);
+ });
+
it('testExtensionReverseOrder', function() {
var message2 =
new proto.jspb.exttest.reverse.TestExtensionReverseOrderMessage2;
diff --git a/js/test.proto b/js/test.proto
index 1c0d255f80..7c2a4699a2 100644
--- a/js/test.proto
+++ b/js/test.proto
@@ -93,10 +93,11 @@ message Complex {
required int32 an_int = 2;
}
required string a_string = 1;
- required bool an_out_of_order_bool = 9;
+ optional bool an_out_of_order_bool = 9;
optional Nested a_nested_message = 4;
repeated Nested a_repeated_message = 5;
repeated string a_repeated_string = 7;
+ optional double a_floating_point_field = 10;
}
message OuterMessage {
@@ -163,6 +164,13 @@ message FloatingPointFields {
optional double default_double_field = 8 [default = 2.0];
}
+message BooleanFields {
+ optional bool optional_boolean_field = 1;
+ required bool required_boolean_field = 2;
+ repeated bool repeated_boolean_field = 3;
+ optional bool default_boolean_field = 4 [default = true];
+}
+
message TestClone {
optional string str = 1;
optional Simple1 simple1 = 3;
diff --git a/python/google/protobuf/internal/enum_type_wrapper.py b/python/google/protobuf/internal/enum_type_wrapper.py
index cc9e95daa0..b4d30e2c94 100644
--- a/python/google/protobuf/internal/enum_type_wrapper.py
+++ b/python/google/protobuf/internal/enum_type_wrapper.py
@@ -89,7 +89,7 @@ class EnumTypeWrapper(object):
for value_descriptor in self._enum_type.values]
def __getattr__(self, name):
- """Returns the value coresponding to the given enum name."""
+ """Returns the value corresponding to the given enum name."""
if name in self._enum_type.values_by_name:
return self._enum_type.values_by_name[name].number
raise AttributeError
diff --git a/python/google/protobuf/internal/json_format_test.py b/python/google/protobuf/internal/json_format_test.py
index 2695635808..f4271b9dfd 100644
--- a/python/google/protobuf/internal/json_format_test.py
+++ b/python/google/protobuf/internal/json_format_test.py
@@ -794,6 +794,13 @@ class JsonFormatTest(JsonFormatBase):
json_format.Parse(text, parsed_message)
self.assertTrue(math.isnan(parsed_message.float_value))
+ def testParseDoubleToFloat(self):
+ message = json_format_proto3_pb2.TestMessage()
+ text = ('{"repeatedFloatValue": [3.4028235e+39, 1.4028235e-39]\n}')
+ json_format.Parse(text, message)
+ self.assertEqual(message.repeated_float_value[0], float('inf'))
+ self.assertAlmostEqual(message.repeated_float_value[1], 1.4028235e-39)
+
def testParseEmptyText(self):
self.CheckError('',
r'Failed to load JSON: (Expecting value)|(No JSON).')
diff --git a/python/google/protobuf/internal/message_test.py b/python/google/protobuf/internal/message_test.py
index cff31407ab..c3bb066f50 100755
--- a/python/google/protobuf/internal/message_test.py
+++ b/python/google/protobuf/internal/message_test.py
@@ -346,6 +346,27 @@ class MessageTest(BaseTestCase):
message.ParseFromString(message.SerializeToString())
self.assertTrue(message.optional_float == -kMostNegExponentOneSigBit)
+ # Max 4 bytes float value
+ max_float = float.fromhex('0x1.fffffep+127')
+ message.optional_float = max_float
+ self.assertAlmostEqual(message.optional_float, max_float)
+ serialized_data = message.SerializeToString()
+ message.ParseFromString(serialized_data)
+ self.assertAlmostEqual(message.optional_float, max_float)
+
+ # Test set double to float field.
+ message.optional_float = 3.4028235e+39
+ self.assertEqual(message.optional_float, float('inf'))
+ serialized_data = message.SerializeToString()
+ message.ParseFromString(serialized_data)
+ self.assertEqual(message.optional_float, float('inf'))
+
+ message.optional_float = -3.4028235e+39
+ self.assertEqual(message.optional_float, float('-inf'))
+
+ message.optional_float = 1.4028235e-39
+ self.assertAlmostEqual(message.optional_float, 1.4028235e-39)
+
def testExtremeDoubleValues(self, message_module):
message = message_module.TestAllTypes()
diff --git a/python/google/protobuf/internal/text_format_test.py b/python/google/protobuf/internal/text_format_test.py
index 16a3f534e9..15f3a19fbd 100755
--- a/python/google/protobuf/internal/text_format_test.py
+++ b/python/google/protobuf/internal/text_format_test.py
@@ -497,6 +497,14 @@ class TextFormatParserTests(TextFormatBase):
text_format.Parse(text, msg2)
self.assertEqual(msg2.optional_string, u'café')
+ def testParseDoubleToFloat(self, message_module):
+ message = message_module.TestAllTypes()
+ text = ('repeated_float: 3.4028235e+39\n'
+ 'repeated_float: 1.4028235e-39\n')
+ text_format.Parse(text, message)
+ self.assertEqual(message.repeated_float[0], float('inf'))
+ self.assertAlmostEqual(message.repeated_float[1], 1.4028235e-39)
+
def testParseExotic(self, message_module):
message = message_module.TestAllTypes()
text = ('repeated_int64: -9223372036854775808\n'
diff --git a/python/google/protobuf/internal/type_checkers.py b/python/google/protobuf/internal/type_checkers.py
index df8306aa92..ac1fbbf8e1 100755
--- a/python/google/protobuf/internal/type_checkers.py
+++ b/python/google/protobuf/internal/type_checkers.py
@@ -230,6 +230,41 @@ class Uint64ValueChecker(IntValueChecker):
_TYPE = long
+# The max 4 bytes float is about 3.4028234663852886e+38
+_FLOAT_MAX = float.fromhex('0x1.fffffep+127')
+_FLOAT_MIN = -_FLOAT_MAX
+_INF = float('inf')
+_NEG_INF = float('-inf')
+
+
+class FloatValueChecker(object):
+
+ """Checker used for float fields. Performs type-check and range check.
+
+ Values exceeding a 32-bit float will be converted to inf/-inf.
+ """
+
+ def CheckValue(self, proposed_value):
+ """Check and convert proposed_value to float."""
+ if not isinstance(proposed_value, numbers.Real):
+ message = ('%.1024r has type %s, but expected one of: numbers.Real' %
+ (proposed_value, type(proposed_value)))
+ raise TypeError(message)
+ converted_value = float(proposed_value)
+ # This inf rounding matches the C++ proto SafeDoubleToFloat logic.
+ if converted_value > _FLOAT_MAX:
+ return _INF
+ if converted_value < _FLOAT_MIN:
+ return _NEG_INF
+
+ return converted_value
+ # TODO(jieluo): convert to 4 bytes float (c style float) at setters:
+ # return struct.unpack('f', struct.pack('f', converted_value))
+
+ def DefaultValue(self):
+ return 0.0
+
+
# Type-checkers for all scalar CPPTYPEs.
_VALUE_CHECKERS = {
_FieldDescriptor.CPPTYPE_INT32: Int32ValueChecker(),
@@ -238,8 +273,7 @@ _VALUE_CHECKERS = {
_FieldDescriptor.CPPTYPE_UINT64: Uint64ValueChecker(),
_FieldDescriptor.CPPTYPE_DOUBLE: TypeCheckerWithDefault(
0.0, float, numbers.Real),
- _FieldDescriptor.CPPTYPE_FLOAT: TypeCheckerWithDefault(
- 0.0, float, numbers.Real),
+ _FieldDescriptor.CPPTYPE_FLOAT: FloatValueChecker(),
_FieldDescriptor.CPPTYPE_BOOL: TypeCheckerWithDefault(
False, bool, numbers.Integral),
_FieldDescriptor.CPPTYPE_STRING: TypeCheckerWithDefault(b'', bytes),
diff --git a/python/google/protobuf/pyext/descriptor_database.h b/python/google/protobuf/pyext/descriptor_database.h
index 30aa1b73ed..daf25e0ba6 100644
--- a/python/google/protobuf/pyext/descriptor_database.h
+++ b/python/google/protobuf/pyext/descriptor_database.h
@@ -48,18 +48,18 @@ class PyDescriptorDatabase : public DescriptorDatabase {
// with a copy of FileDescriptorProto.
// Find a file by file name.
- bool FindFileByName(const std::string& filename,
+ bool FindFileByName(const string& filename,
FileDescriptorProto* output);
// Find the file that declares the given fully-qualified symbol name.
- bool FindFileContainingSymbol(const std::string& symbol_name,
+ bool FindFileContainingSymbol(const string& symbol_name,
FileDescriptorProto* output);
// Find the file which defines an extension extending the given message type
// with the given field number.
// Containing_type must be a fully-qualified type name.
// Python objects are not required to implement this method.
- bool FindFileContainingExtension(const std::string& containing_type,
+ bool FindFileContainingExtension(const string& containing_type,
int field_number,
FileDescriptorProto* output);
@@ -67,7 +67,7 @@ class PyDescriptorDatabase : public DescriptorDatabase {
// containing_type, and appends them to output in an undefined
// order.
// Python objects are not required to implement this method.
- bool FindAllExtensionNumbers(const std::string& containing_type,
+ bool FindAllExtensionNumbers(const string& containing_type,
std::vector* output);
private:
diff --git a/python/google/protobuf/pyext/descriptor_pool.h b/python/google/protobuf/pyext/descriptor_pool.h
index 8e7b4d6b98..8289daeaa7 100644
--- a/python/google/protobuf/pyext/descriptor_pool.h
+++ b/python/google/protobuf/pyext/descriptor_pool.h
@@ -89,7 +89,7 @@ namespace cdescriptor_pool {
// Looks up a message by name.
// Returns a message Descriptor, or NULL if not found.
const Descriptor* FindMessageTypeByName(PyDescriptorPool* self,
- const std::string& name);
+ const string& name);
// The functions below are also exposed as methods of the DescriptorPool type.
diff --git a/python/google/protobuf/pyext/message.cc b/python/google/protobuf/pyext/message.cc
index f458fed540..b4dba6e918 100644
--- a/python/google/protobuf/pyext/message.cc
+++ b/python/google/protobuf/pyext/message.cc
@@ -47,6 +47,7 @@
#endif
#include
#include
+#include
#include
#include
#include
@@ -756,7 +757,7 @@ bool CheckAndGetFloat(PyObject* arg, float* value) {
if (!CheckAndGetDouble(arg, &double_value)) {
return false;
}
- *value = static_cast(double_value);
+ *value = io::SafeDoubleToFloat(double_value);
return true;
}
diff --git a/python/google/protobuf/pyext/message.h b/python/google/protobuf/pyext/message.h
index c112a88fea..1b0effae73 100644
--- a/python/google/protobuf/pyext/message.h
+++ b/python/google/protobuf/pyext/message.h
@@ -332,7 +332,7 @@ bool CheckAndSetString(
bool append,
int index);
PyObject* ToStringObject(const FieldDescriptor* descriptor,
- const std::string& value);
+ const string& value);
// Check if the passed field descriptor belongs to the given message.
// If not, return false and set a Python exception (a KeyError)
@@ -346,14 +346,12 @@ Message* PyMessage_GetMutableMessagePointer(PyObject* msg);
bool InitProto2MessageModule(PyObject *m);
-#if LANG_CXX11
// These are referenced by repeated_scalar_container, and must
// be explicitly instantiated.
extern template bool CheckAndGetInteger(PyObject*, int32*);
extern template bool CheckAndGetInteger(PyObject*, int64*);
extern template bool CheckAndGetInteger(PyObject*, uint32*);
extern template bool CheckAndGetInteger(PyObject*, uint64*);
-#endif
} // namespace python
} // namespace protobuf
diff --git a/python/google/protobuf/pyext/proto2_api_test.proto b/python/google/protobuf/pyext/proto2_api_test.proto
index 18aecfb7d6..1fd78e8402 100644
--- a/python/google/protobuf/pyext/proto2_api_test.proto
+++ b/python/google/protobuf/pyext/proto2_api_test.proto
@@ -30,10 +30,10 @@
syntax = "proto2";
-import "google/protobuf/internal/cpp/proto1_api_test.proto";
-
package google.protobuf.python.internal;
+import "google/protobuf/internal/cpp/proto1_api_test.proto";
+
message TestNestedProto1APIMessage {
optional int32 a = 1;
optional TestMessage.NestedMessage b = 2;
diff --git a/src/google/protobuf/any.cc b/src/google/protobuf/any.cc
index 9d6d5cdaec..4b3cce622c 100644
--- a/src/google/protobuf/any.cc
+++ b/src/google/protobuf/any.cc
@@ -35,6 +35,8 @@
#include
#include
+#include
+
namespace google {
namespace protobuf {
namespace internal {
@@ -44,12 +46,12 @@ void AnyMetadata::PackFrom(const Message& message) {
}
void AnyMetadata::PackFrom(const Message& message,
- const string& type_url_prefix) {
+ const std::string& type_url_prefix) {
type_url_->SetNoArena(
- &::google::protobuf::internal::GetEmptyString(),
+ &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString(),
GetTypeUrl(message.GetDescriptor()->full_name(), type_url_prefix));
message.SerializeToString(value_->MutableNoArena(
- &::google::protobuf::internal::GetEmptyStringAlreadyInited()));
+ &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()));
}
bool AnyMetadata::UnpackTo(Message* message) const {
diff --git a/src/google/protobuf/any.h b/src/google/protobuf/any.h
index f5428c8ac3..d7d43966e4 100644
--- a/src/google/protobuf/any.h
+++ b/src/google/protobuf/any.h
@@ -52,7 +52,7 @@ extern const char kTypeGoogleApisComPrefix[]; // "type.googleapis.com/".
extern const char kTypeGoogleProdComPrefix[]; // "type.googleprod.com/".
std::string GetTypeUrl(StringPiece message_name,
- StringPiece type_url_prefix);
+ StringPiece type_url_prefix);
// Helper class used to implement google::protobuf::Any.
class PROTOBUF_EXPORT AnyMetadata {
diff --git a/src/google/protobuf/any.pb.cc b/src/google/protobuf/any.pb.cc
index 8bd80e1fb9..fac9ebaaff 100644
--- a/src/google/protobuf/any.pb.cc
+++ b/src/google/protobuf/any.pb.cc
@@ -8,7 +8,7 @@
#include
#include
#include
-#include
+#include
#include
#include
#include
@@ -16,54 +16,52 @@
// @@protoc_insertion_point(includes)
#include
-namespace google {
-namespace protobuf {
+PROTOBUF_NAMESPACE_OPEN
class AnyDefaultTypeInternal {
public:
- ::google::protobuf::internal::ExplicitlyConstructed _instance;
+ ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance;
} _Any_default_instance_;
-} // namespace protobuf
-} // namespace google
+PROTOBUF_NAMESPACE_CLOSE
static void InitDefaultsAny_google_2fprotobuf_2fany_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
- void* ptr = &::google::protobuf::_Any_default_instance_;
- new (ptr) ::google::protobuf::Any();
- ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
+ void* ptr = &PROTOBUF_NAMESPACE_ID::_Any_default_instance_;
+ new (ptr) PROTOBUF_NAMESPACE_ID::Any();
+ ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
- ::google::protobuf::Any::InitAsDefaultInstance();
+ PROTOBUF_NAMESPACE_ID::Any::InitAsDefaultInstance();
}
-PROTOBUF_EXPORT ::google::protobuf::internal::SCCInfo<0> scc_info_Any_google_2fprotobuf_2fany_2eproto =
- {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsAny_google_2fprotobuf_2fany_2eproto}, {}};
+PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Any_google_2fprotobuf_2fany_2eproto =
+ {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsAny_google_2fprotobuf_2fany_2eproto}, {}};
void InitDefaults_google_2fprotobuf_2fany_2eproto() {
- ::google::protobuf::internal::InitSCC(&scc_info_Any_google_2fprotobuf_2fany_2eproto.base);
+ ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Any_google_2fprotobuf_2fany_2eproto.base);
}
-static ::google::protobuf::Metadata file_level_metadata_google_2fprotobuf_2fany_2eproto[1];
-static constexpr ::google::protobuf::EnumDescriptor const** file_level_enum_descriptors_google_2fprotobuf_2fany_2eproto = nullptr;
-static constexpr ::google::protobuf::ServiceDescriptor const** file_level_service_descriptors_google_2fprotobuf_2fany_2eproto = nullptr;
+static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_google_2fprotobuf_2fany_2eproto[1];
+static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_google_2fprotobuf_2fany_2eproto = nullptr;
+static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_google_2fprotobuf_2fany_2eproto = nullptr;
-const ::google::protobuf::uint32 TableStruct_google_2fprotobuf_2fany_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
+const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_google_2fprotobuf_2fany_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
~0u, // no _has_bits_
- PROTOBUF_FIELD_OFFSET(::google::protobuf::Any, _internal_metadata_),
+ PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Any, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
- PROTOBUF_FIELD_OFFSET(::google::protobuf::Any, type_url_),
- PROTOBUF_FIELD_OFFSET(::google::protobuf::Any, value_),
+ PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Any, type_url_),
+ PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Any, value_),
};
-static const ::google::protobuf::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
- { 0, -1, sizeof(::google::protobuf::Any)},
+static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
+ { 0, -1, sizeof(PROTOBUF_NAMESPACE_ID::Any)},
};
-static ::google::protobuf::Message const * const file_default_instances[] = {
- reinterpret_cast(&::google::protobuf::_Any_default_instance_),
+static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
+ reinterpret_cast(&PROTOBUF_NAMESPACE_ID::_Any_default_instance_),
};
-static ::google::protobuf::internal::AssignDescriptorsTable assign_descriptors_table_google_2fprotobuf_2fany_2eproto = {
+static ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptorsTable assign_descriptors_table_google_2fprotobuf_2fany_2eproto = {
{}, AddDescriptors_google_2fprotobuf_2fany_2eproto, "google/protobuf/any.proto", schemas,
file_default_instances, TableStruct_google_2fprotobuf_2fany_2eproto::offsets,
file_level_metadata_google_2fprotobuf_2fany_2eproto, 1, file_level_enum_descriptors_google_2fprotobuf_2fany_2eproto, file_level_service_descriptors_google_2fprotobuf_2fany_2eproto,
@@ -77,50 +75,49 @@ const char descriptor_table_protodef_google_2fprotobuf_2fany_2eproto[] =
"\003GPB\252\002\036Google.Protobuf.WellKnownTypesb\006p"
"roto3"
;
-static ::google::protobuf::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fany_2eproto = {
+static ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fany_2eproto = {
false, InitDefaults_google_2fprotobuf_2fany_2eproto,
descriptor_table_protodef_google_2fprotobuf_2fany_2eproto,
"google/protobuf/any.proto", &assign_descriptors_table_google_2fprotobuf_2fany_2eproto, 205,
};
void AddDescriptors_google_2fprotobuf_2fany_2eproto() {
- static constexpr ::google::protobuf::internal::InitFunc deps[1] =
+ static constexpr ::PROTOBUF_NAMESPACE_ID::internal::InitFunc deps[1] =
{
};
- ::google::protobuf::internal::AddDescriptors(&descriptor_table_google_2fprotobuf_2fany_2eproto, deps, 0);
+ ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_google_2fprotobuf_2fany_2eproto, deps, 0);
}
// Force running AddDescriptors() at dynamic initialization time.
static bool dynamic_init_dummy_google_2fprotobuf_2fany_2eproto = []() { AddDescriptors_google_2fprotobuf_2fany_2eproto(); return true; }();
-namespace google {
-namespace protobuf {
+PROTOBUF_NAMESPACE_OPEN
// ===================================================================
void Any::InitAsDefaultInstance() {
}
-void Any::PackFrom(const ::google::protobuf::Message& message) {
+void Any::PackFrom(const ::PROTOBUF_NAMESPACE_ID::Message& message) {
_any_metadata_.PackFrom(message);
}
-void Any::PackFrom(const ::google::protobuf::Message& message,
- const ::std::string& type_url_prefix) {
+void Any::PackFrom(const ::PROTOBUF_NAMESPACE_ID::Message& message,
+ const std::string& type_url_prefix) {
_any_metadata_.PackFrom(message, type_url_prefix);
}
-bool Any::UnpackTo(::google::protobuf::Message* message) const {
+bool Any::UnpackTo(::PROTOBUF_NAMESPACE_ID::Message* message) const {
return _any_metadata_.UnpackTo(message);
}
bool Any::GetAnyFieldDescriptors(
- const ::google::protobuf::Message& message,
- const ::google::protobuf::FieldDescriptor** type_url_field,
- const ::google::protobuf::FieldDescriptor** value_field) {
- return ::google::protobuf::internal::GetAnyFieldDescriptors(
+ const ::PROTOBUF_NAMESPACE_ID::Message& message,
+ const ::PROTOBUF_NAMESPACE_ID::FieldDescriptor** type_url_field,
+ const ::PROTOBUF_NAMESPACE_ID::FieldDescriptor** value_field) {
+ return ::PROTOBUF_NAMESPACE_ID::internal::GetAnyFieldDescriptors(
message, type_url_field, value_field);
}
bool Any::ParseAnyTypeUrl(const string& type_url,
- string* full_type_name) {
- return ::google::protobuf::internal::ParseAnyTypeUrl(type_url,
+ std::string* full_type_name) {
+ return ::PROTOBUF_NAMESPACE_ID::internal::ParseAnyTypeUrl(type_url,
full_type_name);
}
@@ -134,31 +131,31 @@ const int Any::kValueFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
Any::Any()
- : ::google::protobuf::Message(), _internal_metadata_(nullptr), _any_metadata_(&type_url_, &value_) {
+ : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr), _any_metadata_(&type_url_, &value_) {
SharedCtor();
// @@protoc_insertion_point(constructor:google.protobuf.Any)
}
Any::Any(const Any& from)
- : ::google::protobuf::Message(),
+ : ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
_any_metadata_(&type_url_, &value_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
- type_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ type_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from.type_url().size() > 0) {
- type_url_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_url_);
+ type_url_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.type_url_);
}
- value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from.value().size() > 0) {
- value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.value_);
+ value_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.value_);
}
// @@protoc_insertion_point(copy_constructor:google.protobuf.Any)
}
void Any::SharedCtor() {
- ::google::protobuf::internal::InitSCC(
+ ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(
&scc_info_Any_google_2fprotobuf_2fany_2eproto.base);
- type_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
- value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ type_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
Any::~Any() {
@@ -167,48 +164,49 @@ Any::~Any() {
}
void Any::SharedDtor() {
- type_url_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
- value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ type_url_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ value_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
void Any::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const Any& Any::default_instance() {
- ::google::protobuf::internal::InitSCC(&::scc_info_Any_google_2fprotobuf_2fany_2eproto.base);
+ ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Any_google_2fprotobuf_2fany_2eproto.base);
return *internal_default_instance();
}
void Any::Clear() {
// @@protoc_insertion_point(message_clear_start:google.protobuf.Any)
- ::google::protobuf::uint32 cached_has_bits = 0;
+ ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
- type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
- value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ type_url_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ value_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
_internal_metadata_.Clear();
}
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
-const char* Any::_InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) {
+const char* Any::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+ ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena;
while (!ctx->Done(&ptr)) {
- ::google::protobuf::uint32 tag;
- ptr = ::google::protobuf::internal::ReadTag(ptr, &tag);
+ ::PROTOBUF_NAMESPACE_ID::uint32 tag;
+ ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
switch (tag >> 3) {
// string type_url = 1;
case 1: {
- if (static_cast<::google::protobuf::uint8>(tag) != 10) goto handle_unusual;
- ptr = ::google::protobuf::internal::InlineGreedyStringParserUTF8(mutable_type_url(), ptr, ctx, "google.protobuf.Any.type_url");
+ if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) != 10) goto handle_unusual;
+ ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_type_url(), ptr, ctx, "google.protobuf.Any.type_url");
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
break;
}
// bytes value = 2;
case 2: {
- if (static_cast<::google::protobuf::uint8>(tag) != 18) goto handle_unusual;
- ptr = ::google::protobuf::internal::InlineGreedyStringParser(mutable_value(), ptr, ctx);
+ if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) != 18) goto handle_unusual;
+ ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_value(), ptr, ctx);
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
break;
}
@@ -229,23 +227,23 @@ const char* Any::_InternalParse(const char* ptr, ::google::protobuf::internal::P
}
#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
bool Any::MergePartialFromCodedStream(
- ::google::protobuf::io::CodedInputStream* input) {
+ ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
- ::google::protobuf::uint32 tag;
+ ::PROTOBUF_NAMESPACE_ID::uint32 tag;
// @@protoc_insertion_point(parse_start:google.protobuf.Any)
for (;;) {
- ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
+ ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
tag = p.first;
if (!p.second) goto handle_unusual;
- switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+ switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// string type_url = 1;
case 1: {
- if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) {
- DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+ if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) {
+ DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
input, this->mutable_type_url()));
- DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+ DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->type_url().data(), static_cast(this->type_url().length()),
- ::google::protobuf::internal::WireFormatLite::PARSE,
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
"google.protobuf.Any.type_url"));
} else {
goto handle_unusual;
@@ -255,8 +253,8 @@ bool Any::MergePartialFromCodedStream(
// bytes value = 2;
case 2: {
- if (static_cast< ::google::protobuf::uint8>(tag) == (18 & 0xFF)) {
- DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
+ if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) {
+ DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes(
input, this->mutable_value()));
} else {
goto handle_unusual;
@@ -269,7 +267,7 @@ bool Any::MergePartialFromCodedStream(
if (tag == 0) {
goto success;
}
- DO_(::google::protobuf::internal::WireFormat::SkipField(
+ DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
input, tag, _internal_metadata_.mutable_unknown_fields()));
break;
}
@@ -286,60 +284,60 @@ failure:
#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
void Any::SerializeWithCachedSizes(
- ::google::protobuf::io::CodedOutputStream* output) const {
+ ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:google.protobuf.Any)
- ::google::protobuf::uint32 cached_has_bits = 0;
+ ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// string type_url = 1;
if (this->type_url().size() > 0) {
- ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->type_url().data(), static_cast(this->type_url().length()),
- ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"google.protobuf.Any.type_url");
- ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
1, this->type_url(), output);
}
// bytes value = 2;
if (this->value().size() > 0) {
- ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased(
2, this->value(), output);
}
if (_internal_metadata_.have_unknown_fields()) {
- ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
_internal_metadata_.unknown_fields(), output);
}
// @@protoc_insertion_point(serialize_end:google.protobuf.Any)
}
-::google::protobuf::uint8* Any::InternalSerializeWithCachedSizesToArray(
- ::google::protobuf::uint8* target) const {
+::PROTOBUF_NAMESPACE_ID::uint8* Any::InternalSerializeWithCachedSizesToArray(
+ ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Any)
- ::google::protobuf::uint32 cached_has_bits = 0;
+ ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// string type_url = 1;
if (this->type_url().size() > 0) {
- ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->type_url().data(), static_cast(this->type_url().length()),
- ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"google.protobuf.Any.type_url");
target =
- ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
1, this->type_url(), target);
}
// bytes value = 2;
if (this->value().size() > 0) {
target =
- ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray(
2, this->value(), target);
}
if (_internal_metadata_.have_unknown_fields()) {
- target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
+ target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target);
}
// @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Any)
@@ -352,41 +350,41 @@ size_t Any::ByteSizeLong() const {
if (_internal_metadata_.have_unknown_fields()) {
total_size +=
- ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
_internal_metadata_.unknown_fields());
}
- ::google::protobuf::uint32 cached_has_bits = 0;
+ ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// string type_url = 1;
if (this->type_url().size() > 0) {
total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::StringSize(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->type_url());
}
// bytes value = 2;
if (this->value().size() > 0) {
total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::BytesSize(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->value());
}
- int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
+ int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
-void Any::MergeFrom(const ::google::protobuf::Message& from) {
+void Any::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Any)
GOOGLE_DCHECK_NE(&from, this);
const Any* source =
- ::google::protobuf::DynamicCastToGenerated(
+ ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Any)
- ::google::protobuf::internal::ReflectionOps::Merge(from, this);
+ ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Any)
MergeFrom(*source);
@@ -397,20 +395,20 @@ void Any::MergeFrom(const Any& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Any)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
- ::google::protobuf::uint32 cached_has_bits = 0;
+ ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.type_url().size() > 0) {
- type_url_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_url_);
+ type_url_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.type_url_);
}
if (from.value().size() > 0) {
- value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.value_);
+ value_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.value_);
}
}
-void Any::CopyFrom(const ::google::protobuf::Message& from) {
+void Any::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Any)
if (&from == this) return;
Clear();
@@ -435,28 +433,25 @@ void Any::Swap(Any* other) {
void Any::InternalSwap(Any* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
- type_url_.Swap(&other->type_url_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ type_url_.Swap(&other->type_url_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
- value_.Swap(&other->value_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ value_.Swap(&other->value_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
}
-::google::protobuf::Metadata Any::GetMetadata() const {
- ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fany_2eproto);
+::PROTOBUF_NAMESPACE_ID::Metadata Any::GetMetadata() const {
+ ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fany_2eproto);
return ::file_level_metadata_google_2fprotobuf_2fany_2eproto[kIndexInFileMessages];
}
// @@protoc_insertion_point(namespace_scope)
-} // namespace protobuf
-} // namespace google
-namespace google {
-namespace protobuf {
-template<> PROTOBUF_NOINLINE ::google::protobuf::Any* Arena::CreateMaybeMessage< ::google::protobuf::Any >(Arena* arena) {
- return Arena::CreateInternal< ::google::protobuf::Any >(arena);
+PROTOBUF_NAMESPACE_CLOSE
+PROTOBUF_NAMESPACE_OPEN
+template<> PROTOBUF_NOINLINE PROTOBUF_NAMESPACE_ID::Any* Arena::CreateMaybeMessage< PROTOBUF_NAMESPACE_ID::Any >(Arena* arena) {
+ return Arena::CreateInternal< PROTOBUF_NAMESPACE_ID::Any >(arena);
}
-} // namespace protobuf
-} // namespace google
+PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include
diff --git a/src/google/protobuf/any.pb.h b/src/google/protobuf/any.pb.h
index 95c7f03061..de8ceeb023 100644
--- a/src/google/protobuf/any.pb.h
+++ b/src/google/protobuf/any.pb.h
@@ -1,8 +1,8 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/any.proto
-#ifndef PROTOBUF_INCLUDED_google_2fprotobuf_2fany_2eproto
-#define PROTOBUF_INCLUDED_google_2fprotobuf_2fany_2eproto
+#ifndef GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fany_2eproto
+#define GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fany_2eproto
#include
#include
@@ -35,51 +35,53 @@
// @@protoc_insertion_point(includes)
#include
#define PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fany_2eproto PROTOBUF_EXPORT
+PROTOBUF_NAMESPACE_OPEN
+namespace internal {
+class AnyMetadata;
+} // namespace internal
+PROTOBUF_NAMESPACE_CLOSE
// Internal implementation detail -- do not use these members.
struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2fany_2eproto {
- static const ::google::protobuf::internal::ParseTableField entries[]
+ static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
- static const ::google::protobuf::internal::AuxillaryParseTableField aux[]
+ static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
- static const ::google::protobuf::internal::ParseTable schema[1]
+ static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[1]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
- static const ::google::protobuf::internal::FieldMetadata field_metadata[];
- static const ::google::protobuf::internal::SerializationTable serialization_table[];
- static const ::google::protobuf::uint32 offsets[];
+ static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[];
+ static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[];
+ static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[];
};
void PROTOBUF_EXPORT AddDescriptors_google_2fprotobuf_2fany_2eproto();
-namespace google {
-namespace protobuf {
+PROTOBUF_NAMESPACE_OPEN
class Any;
class AnyDefaultTypeInternal;
PROTOBUF_EXPORT extern AnyDefaultTypeInternal _Any_default_instance_;
-template<> PROTOBUF_EXPORT ::google::protobuf::Any* Arena::CreateMaybeMessage<::google::protobuf::Any>(Arena*);
-} // namespace protobuf
-} // namespace google
-namespace google {
-namespace protobuf {
+PROTOBUF_NAMESPACE_CLOSE
+PROTOBUF_NAMESPACE_OPEN
+template<> PROTOBUF_EXPORT PROTOBUF_NAMESPACE_ID::Any* Arena::CreateMaybeMessage(Arena*);
+PROTOBUF_NAMESPACE_CLOSE
+PROTOBUF_NAMESPACE_OPEN
// ===================================================================
class PROTOBUF_EXPORT Any final :
- public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Any) */ {
+ public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Any) */ {
public:
Any();
virtual ~Any();
Any(const Any& from);
-
- inline Any& operator=(const Any& from) {
- CopyFrom(from);
- return *this;
- }
- #if LANG_CXX11
Any(Any&& from) noexcept
: Any() {
*this = ::std::move(from);
}
+ inline Any& operator=(const Any& from) {
+ CopyFrom(from);
+ return *this;
+ }
inline Any& operator=(Any&& from) noexcept {
if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
if (this != &from) InternalSwap(&from);
@@ -88,8 +90,8 @@ class PROTOBUF_EXPORT Any final :
}
return *this;
}
- #endif
- static const ::google::protobuf::Descriptor* descriptor() {
+
+ static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
return default_instance().GetDescriptor();
}
static const Any& default_instance();
@@ -104,19 +106,19 @@ class PROTOBUF_EXPORT Any final :
// implements Any -----------------------------------------------
- void PackFrom(const ::google::protobuf::Message& message);
- void PackFrom(const ::google::protobuf::Message& message,
- const ::std::string& type_url_prefix);
- bool UnpackTo(::google::protobuf::Message* message) const;
+ void PackFrom(const ::PROTOBUF_NAMESPACE_ID::Message& message);
+ void PackFrom(const ::PROTOBUF_NAMESPACE_ID::Message& message,
+ const std::string& type_url_prefix);
+ bool UnpackTo(::PROTOBUF_NAMESPACE_ID::Message* message) const;
static bool GetAnyFieldDescriptors(
- const ::google::protobuf::Message& message,
- const ::google::protobuf::FieldDescriptor** type_url_field,
- const ::google::protobuf::FieldDescriptor** value_field);
+ const ::PROTOBUF_NAMESPACE_ID::Message& message,
+ const ::PROTOBUF_NAMESPACE_ID::FieldDescriptor** type_url_field,
+ const ::PROTOBUF_NAMESPACE_ID::FieldDescriptor** value_field);
template bool Is() const {
return _any_metadata_.Is();
}
static bool ParseAnyTypeUrl(const string& type_url,
- string* full_type_name);
+ std::string* full_type_name);
void Swap(Any* other);
friend void swap(Any& a, Any& b) {
a.Swap(&b);
@@ -128,11 +130,11 @@ class PROTOBUF_EXPORT Any final :
return CreateMaybeMessage(nullptr);
}
- Any* New(::google::protobuf::Arena* arena) const final {
+ Any* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
return CreateMaybeMessage(arena);
}
- void CopyFrom(const ::google::protobuf::Message& from) final;
- void MergeFrom(const ::google::protobuf::Message& from) final;
+ void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
+ void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void CopyFrom(const Any& from);
void MergeFrom(const Any& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
@@ -140,15 +142,15 @@ class PROTOBUF_EXPORT Any final :
size_t ByteSizeLong() const final;
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
- const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final;
+ const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
#else
bool MergePartialFromCodedStream(
- ::google::protobuf::io::CodedInputStream* input) final;
+ ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final;
#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
void SerializeWithCachedSizes(
- ::google::protobuf::io::CodedOutputStream* output) const final;
- ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
- ::google::protobuf::uint8* target) const final;
+ ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final;
+ ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray(
+ ::PROTOBUF_NAMESPACE_ID::uint8* target) const final;
int GetCachedSize() const final { return _cached_size_.Get(); }
private:
@@ -156,12 +158,12 @@ class PROTOBUF_EXPORT Any final :
inline void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Any* other);
- friend class ::google::protobuf::internal::AnyMetadata;
- static ::google::protobuf::StringPiece FullMessageName() {
+ friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+ static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "google.protobuf.Any";
}
private:
- inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
+ inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const {
return nullptr;
}
inline void* MaybeArenaPtr() const {
@@ -169,7 +171,7 @@ class PROTOBUF_EXPORT Any final :
}
public:
- ::google::protobuf::Metadata GetMetadata() const final;
+ ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
// nested types ----------------------------------------------------
@@ -178,40 +180,36 @@ class PROTOBUF_EXPORT Any final :
// string type_url = 1;
void clear_type_url();
static const int kTypeUrlFieldNumber = 1;
- const ::std::string& type_url() const;
- void set_type_url(const ::std::string& value);
- #if LANG_CXX11
- void set_type_url(::std::string&& value);
- #endif
+ const std::string& type_url() const;
+ void set_type_url(const std::string& value);
+ void set_type_url(std::string&& value);
void set_type_url(const char* value);
void set_type_url(const char* value, size_t size);
- ::std::string* mutable_type_url();
- ::std::string* release_type_url();
- void set_allocated_type_url(::std::string* type_url);
+ std::string* mutable_type_url();
+ std::string* release_type_url();
+ void set_allocated_type_url(std::string* type_url);
// bytes value = 2;
void clear_value();
static const int kValueFieldNumber = 2;
- const ::std::string& value() const;
- void set_value(const ::std::string& value);
- #if LANG_CXX11
- void set_value(::std::string&& value);
- #endif
+ const std::string& value() const;
+ void set_value(const std::string& value);
+ void set_value(std::string&& value);
void set_value(const char* value);
void set_value(const void* value, size_t size);
- ::std::string* mutable_value();
- ::std::string* release_value();
- void set_allocated_value(::std::string* value);
+ std::string* mutable_value();
+ std::string* release_value();
+ void set_allocated_value(std::string* value);
// @@protoc_insertion_point(class_scope:google.protobuf.Any)
private:
class HasBitSetters;
- ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
- ::google::protobuf::internal::ArenaStringPtr type_url_;
- ::google::protobuf::internal::ArenaStringPtr value_;
- mutable ::google::protobuf::internal::CachedSize _cached_size_;
- ::google::protobuf::internal::AnyMetadata _any_metadata_;
+ ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr type_url_;
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr value_;
+ mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+ ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata _any_metadata_;
friend struct ::TableStruct_google_2fprotobuf_2fany_2eproto;
};
// ===================================================================
@@ -227,107 +225,103 @@ class PROTOBUF_EXPORT Any final :
// string type_url = 1;
inline void Any::clear_type_url() {
- type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ type_url_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
-inline const ::std::string& Any::type_url() const {
+inline const std::string& Any::type_url() const {
// @@protoc_insertion_point(field_get:google.protobuf.Any.type_url)
return type_url_.GetNoArena();
}
-inline void Any::set_type_url(const ::std::string& value) {
+inline void Any::set_type_url(const std::string& value) {
- type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+ type_url_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value);
// @@protoc_insertion_point(field_set:google.protobuf.Any.type_url)
}
-#if LANG_CXX11
-inline void Any::set_type_url(::std::string&& value) {
+inline void Any::set_type_url(std::string&& value) {
type_url_.SetNoArena(
- &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
+ &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
// @@protoc_insertion_point(field_set_rvalue:google.protobuf.Any.type_url)
}
-#endif
inline void Any::set_type_url(const char* value) {
GOOGLE_DCHECK(value != nullptr);
- type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
+ type_url_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
// @@protoc_insertion_point(field_set_char:google.protobuf.Any.type_url)
}
inline void Any::set_type_url(const char* value, size_t size) {
- type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ type_url_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
::std::string(reinterpret_cast(value), size));
// @@protoc_insertion_point(field_set_pointer:google.protobuf.Any.type_url)
}
-inline ::std::string* Any::mutable_type_url() {
+inline std::string* Any::mutable_type_url() {
// @@protoc_insertion_point(field_mutable:google.protobuf.Any.type_url)
- return type_url_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ return type_url_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
-inline ::std::string* Any::release_type_url() {
+inline std::string* Any::release_type_url() {
// @@protoc_insertion_point(field_release:google.protobuf.Any.type_url)
- return type_url_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ return type_url_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
-inline void Any::set_allocated_type_url(::std::string* type_url) {
+inline void Any::set_allocated_type_url(std::string* type_url) {
if (type_url != nullptr) {
} else {
}
- type_url_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type_url);
+ type_url_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), type_url);
// @@protoc_insertion_point(field_set_allocated:google.protobuf.Any.type_url)
}
// bytes value = 2;
inline void Any::clear_value() {
- value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ value_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
-inline const ::std::string& Any::value() const {
+inline const std::string& Any::value() const {
// @@protoc_insertion_point(field_get:google.protobuf.Any.value)
return value_.GetNoArena();
}
-inline void Any::set_value(const ::std::string& value) {
+inline void Any::set_value(const std::string& value) {
- value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+ value_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value);
// @@protoc_insertion_point(field_set:google.protobuf.Any.value)
}
-#if LANG_CXX11
-inline void Any::set_value(::std::string&& value) {
+inline void Any::set_value(std::string&& value) {
value_.SetNoArena(
- &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
+ &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
// @@protoc_insertion_point(field_set_rvalue:google.protobuf.Any.value)
}
-#endif
inline void Any::set_value(const char* value) {
GOOGLE_DCHECK(value != nullptr);
- value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
+ value_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
// @@protoc_insertion_point(field_set_char:google.protobuf.Any.value)
}
inline void Any::set_value(const void* value, size_t size) {
- value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ value_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
::std::string(reinterpret_cast(value), size));
// @@protoc_insertion_point(field_set_pointer:google.protobuf.Any.value)
}
-inline ::std::string* Any::mutable_value() {
+inline std::string* Any::mutable_value() {
// @@protoc_insertion_point(field_mutable:google.protobuf.Any.value)
- return value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ return value_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
-inline ::std::string* Any::release_value() {
+inline std::string* Any::release_value() {
// @@protoc_insertion_point(field_release:google.protobuf.Any.value)
- return value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ return value_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
-inline void Any::set_allocated_value(::std::string* value) {
+inline void Any::set_allocated_value(std::string* value) {
if (value != nullptr) {
} else {
}
- value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+ value_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value);
// @@protoc_insertion_point(field_set_allocated:google.protobuf.Any.value)
}
@@ -337,10 +331,9 @@ inline void Any::set_allocated_value(::std::string* value) {
// @@protoc_insertion_point(namespace_scope)
-} // namespace protobuf
-} // namespace google
+PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include
-#endif // PROTOBUF_INCLUDED_google_2fprotobuf_2fany_2eproto
+#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fany_2eproto
diff --git a/src/google/protobuf/any_lite.cc b/src/google/protobuf/any_lite.cc
index 9356514126..7403ed3fda 100644
--- a/src/google/protobuf/any_lite.cc
+++ b/src/google/protobuf/any_lite.cc
@@ -40,8 +40,8 @@ namespace google {
namespace protobuf {
namespace internal {
-string GetTypeUrl(StringPiece message_name,
- StringPiece type_url_prefix) {
+std::string GetTypeUrl(StringPiece message_name,
+ StringPiece type_url_prefix) {
if (!type_url_prefix.empty() &&
type_url_prefix[type_url_prefix.size() - 1] == '/') {
return StrCat(type_url_prefix, message_name);
@@ -101,10 +101,10 @@ bool AnyMetadata::InternalIs(StringPiece type_name) const {
HasSuffixString(type_url, type_name);
}
-bool ParseAnyTypeUrl(const string& type_url, string* url_prefix,
- string* full_type_name) {
+bool ParseAnyTypeUrl(const std::string& type_url, std::string* url_prefix,
+ std::string* full_type_name) {
size_t pos = type_url.find_last_of("/");
- if (pos == string::npos || pos + 1 == type_url.size()) {
+ if (pos == std::string::npos || pos + 1 == type_url.size()) {
return false;
}
if (url_prefix) {
@@ -114,7 +114,7 @@ bool ParseAnyTypeUrl(const string& type_url, string* url_prefix,
return true;
}
-bool ParseAnyTypeUrl(const string& type_url, string* full_type_name) {
+bool ParseAnyTypeUrl(const std::string& type_url, std::string* full_type_name) {
return ParseAnyTypeUrl(type_url, nullptr, full_type_name);
}
diff --git a/src/google/protobuf/any_test.cc b/src/google/protobuf/any_test.cc
index 378981ce12..72bd5e0d19 100644
--- a/src/google/protobuf/any_test.cc
+++ b/src/google/protobuf/any_test.cc
@@ -44,7 +44,7 @@ TEST(AnyTest, TestPackAndUnpack) {
protobuf_unittest::TestAny message;
message.mutable_any_value()->PackFrom(submessage);
- string data = message.SerializeAsString();
+ std::string data = message.SerializeAsString();
ASSERT_TRUE(message.ParseFromString(data));
EXPECT_TRUE(message.has_any_value());
@@ -73,7 +73,7 @@ TEST(AnyTest, TestPackAndUnpackAny) {
protobuf_unittest::TestAny message;
message.mutable_any_value()->PackFrom(any);
- string data = message.SerializeAsString();
+ std::string data = message.SerializeAsString();
ASSERT_TRUE(message.ParseFromString(data));
EXPECT_TRUE(message.has_any_value());
diff --git a/src/google/protobuf/api.pb.cc b/src/google/protobuf/api.pb.cc
index 8fe730129c..5a8bb22d26 100644
--- a/src/google/protobuf/api.pb.cc
+++ b/src/google/protobuf/api.pb.cc
@@ -8,7 +8,7 @@
#include
#include
#include
-#include
+#include
#include
#include
#include
@@ -16,39 +16,37 @@
// @@protoc_insertion_point(includes)
#include
-extern PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fapi_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Mixin_google_2fprotobuf_2fapi_2eproto;
-extern PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fapi_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Method_google_2fprotobuf_2fapi_2eproto;
-extern PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fsource_5fcontext_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_SourceContext_google_2fprotobuf_2fsource_5fcontext_2eproto;
-extern PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2ftype_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Option_google_2fprotobuf_2ftype_2eproto;
-namespace google {
-namespace protobuf {
+extern PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fapi_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Mixin_google_2fprotobuf_2fapi_2eproto;
+extern PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fapi_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Method_google_2fprotobuf_2fapi_2eproto;
+extern PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fsource_5fcontext_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_SourceContext_google_2fprotobuf_2fsource_5fcontext_2eproto;
+extern PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2ftype_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Option_google_2fprotobuf_2ftype_2eproto;
+PROTOBUF_NAMESPACE_OPEN
class ApiDefaultTypeInternal {
public:
- ::google::protobuf::internal::ExplicitlyConstructed _instance;
+ ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance;
} _Api_default_instance_;
class MethodDefaultTypeInternal {
public:
- ::google::protobuf::internal::ExplicitlyConstructed _instance;
+ ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance;
} _Method_default_instance_;
class MixinDefaultTypeInternal {
public:
- ::google::protobuf::internal::ExplicitlyConstructed _instance;
+ ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance;
} _Mixin_default_instance_;
-} // namespace protobuf
-} // namespace google
+PROTOBUF_NAMESPACE_CLOSE
static void InitDefaultsApi_google_2fprotobuf_2fapi_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
- void* ptr = &::google::protobuf::_Api_default_instance_;
- new (ptr) ::google::protobuf::Api();
- ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
+ void* ptr = &PROTOBUF_NAMESPACE_ID::_Api_default_instance_;
+ new (ptr) PROTOBUF_NAMESPACE_ID::Api();
+ ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
- ::google::protobuf::Api::InitAsDefaultInstance();
+ PROTOBUF_NAMESPACE_ID::Api::InitAsDefaultInstance();
}
-PROTOBUF_EXPORT ::google::protobuf::internal::SCCInfo<4> scc_info_Api_google_2fprotobuf_2fapi_2eproto =
- {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 4, InitDefaultsApi_google_2fprotobuf_2fapi_2eproto}, {
+PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<4> scc_info_Api_google_2fprotobuf_2fapi_2eproto =
+ {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 4, InitDefaultsApi_google_2fprotobuf_2fapi_2eproto}, {
&scc_info_Method_google_2fprotobuf_2fapi_2eproto.base,
&scc_info_Option_google_2fprotobuf_2ftype_2eproto.base,
&scc_info_SourceContext_google_2fprotobuf_2fsource_5fcontext_2eproto.base,
@@ -58,87 +56,87 @@ static void InitDefaultsMethod_google_2fprotobuf_2fapi_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
- void* ptr = &::google::protobuf::_Method_default_instance_;
- new (ptr) ::google::protobuf::Method();
- ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
+ void* ptr = &PROTOBUF_NAMESPACE_ID::_Method_default_instance_;
+ new (ptr) PROTOBUF_NAMESPACE_ID::Method();
+ ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
- ::google::protobuf::Method::InitAsDefaultInstance();
+ PROTOBUF_NAMESPACE_ID::Method::InitAsDefaultInstance();
}
-PROTOBUF_EXPORT ::google::protobuf::internal::SCCInfo<1> scc_info_Method_google_2fprotobuf_2fapi_2eproto =
- {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsMethod_google_2fprotobuf_2fapi_2eproto}, {
+PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Method_google_2fprotobuf_2fapi_2eproto =
+ {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsMethod_google_2fprotobuf_2fapi_2eproto}, {
&scc_info_Option_google_2fprotobuf_2ftype_2eproto.base,}};
static void InitDefaultsMixin_google_2fprotobuf_2fapi_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
- void* ptr = &::google::protobuf::_Mixin_default_instance_;
- new (ptr) ::google::protobuf::Mixin();
- ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
+ void* ptr = &PROTOBUF_NAMESPACE_ID::_Mixin_default_instance_;
+ new (ptr) PROTOBUF_NAMESPACE_ID::Mixin();
+ ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
- ::google::protobuf::Mixin::InitAsDefaultInstance();
+ PROTOBUF_NAMESPACE_ID::Mixin::InitAsDefaultInstance();
}
-PROTOBUF_EXPORT ::google::protobuf::internal::SCCInfo<0> scc_info_Mixin_google_2fprotobuf_2fapi_2eproto =
- {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsMixin_google_2fprotobuf_2fapi_2eproto}, {}};
+PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Mixin_google_2fprotobuf_2fapi_2eproto =
+ {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsMixin_google_2fprotobuf_2fapi_2eproto}, {}};
void InitDefaults_google_2fprotobuf_2fapi_2eproto() {
- ::google::protobuf::internal::InitSCC(&scc_info_Api_google_2fprotobuf_2fapi_2eproto.base);
- ::google::protobuf::internal::InitSCC(&scc_info_Method_google_2fprotobuf_2fapi_2eproto.base);
- ::google::protobuf::internal::InitSCC(&scc_info_Mixin_google_2fprotobuf_2fapi_2eproto.base);
+ ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Api_google_2fprotobuf_2fapi_2eproto.base);
+ ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Method_google_2fprotobuf_2fapi_2eproto.base);
+ ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Mixin_google_2fprotobuf_2fapi_2eproto.base);
}
-static ::google::protobuf::Metadata file_level_metadata_google_2fprotobuf_2fapi_2eproto[3];
-static constexpr ::google::protobuf::EnumDescriptor const** file_level_enum_descriptors_google_2fprotobuf_2fapi_2eproto = nullptr;
-static constexpr ::google::protobuf::ServiceDescriptor const** file_level_service_descriptors_google_2fprotobuf_2fapi_2eproto = nullptr;
+static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_google_2fprotobuf_2fapi_2eproto[3];
+static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_google_2fprotobuf_2fapi_2eproto = nullptr;
+static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_google_2fprotobuf_2fapi_2eproto = nullptr;
-const ::google::protobuf::uint32 TableStruct_google_2fprotobuf_2fapi_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
+const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_google_2fprotobuf_2fapi_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
~0u, // no _has_bits_
- PROTOBUF_FIELD_OFFSET(::google::protobuf::Api, _internal_metadata_),
+ PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Api, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
- PROTOBUF_FIELD_OFFSET(::google::protobuf::Api, name_),
- PROTOBUF_FIELD_OFFSET(::google::protobuf::Api, methods_),
- PROTOBUF_FIELD_OFFSET(::google::protobuf::Api, options_),
- PROTOBUF_FIELD_OFFSET(::google::protobuf::Api, version_),
- PROTOBUF_FIELD_OFFSET(::google::protobuf::Api, source_context_),
- PROTOBUF_FIELD_OFFSET(::google::protobuf::Api, mixins_),
- PROTOBUF_FIELD_OFFSET(::google::protobuf::Api, syntax_),
+ PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Api, name_),
+ PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Api, methods_),
+ PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Api, options_),
+ PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Api, version_),
+ PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Api, source_context_),
+ PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Api, mixins_),
+ PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Api, syntax_),
~0u, // no _has_bits_
- PROTOBUF_FIELD_OFFSET(::google::protobuf::Method, _internal_metadata_),
+ PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Method, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
- PROTOBUF_FIELD_OFFSET(::google::protobuf::Method, name_),
- PROTOBUF_FIELD_OFFSET(::google::protobuf::Method, request_type_url_),
- PROTOBUF_FIELD_OFFSET(::google::protobuf::Method, request_streaming_),
- PROTOBUF_FIELD_OFFSET(::google::protobuf::Method, response_type_url_),
- PROTOBUF_FIELD_OFFSET(::google::protobuf::Method, response_streaming_),
- PROTOBUF_FIELD_OFFSET(::google::protobuf::Method, options_),
- PROTOBUF_FIELD_OFFSET(::google::protobuf::Method, syntax_),
+ PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Method, name_),
+ PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Method, request_type_url_),
+ PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Method, request_streaming_),
+ PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Method, response_type_url_),
+ PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Method, response_streaming_),
+ PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Method, options_),
+ PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Method, syntax_),
~0u, // no _has_bits_
- PROTOBUF_FIELD_OFFSET(::google::protobuf::Mixin, _internal_metadata_),
+ PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Mixin, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
- PROTOBUF_FIELD_OFFSET(::google::protobuf::Mixin, name_),
- PROTOBUF_FIELD_OFFSET(::google::protobuf::Mixin, root_),
+ PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Mixin, name_),
+ PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Mixin, root_),
};
-static const ::google::protobuf::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
- { 0, -1, sizeof(::google::protobuf::Api)},
- { 12, -1, sizeof(::google::protobuf::Method)},
- { 24, -1, sizeof(::google::protobuf::Mixin)},
+static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
+ { 0, -1, sizeof(PROTOBUF_NAMESPACE_ID::Api)},
+ { 12, -1, sizeof(PROTOBUF_NAMESPACE_ID::Method)},
+ { 24, -1, sizeof(PROTOBUF_NAMESPACE_ID::Mixin)},
};
-static ::google::protobuf::Message const * const file_default_instances[] = {
- reinterpret_cast(&::google::protobuf::_Api_default_instance_),
- reinterpret_cast(&::google::protobuf::_Method_default_instance_),
- reinterpret_cast(&::google::protobuf::_Mixin_default_instance_),
+static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
+ reinterpret_cast(&PROTOBUF_NAMESPACE_ID::_Api_default_instance_),
+ reinterpret_cast(&PROTOBUF_NAMESPACE_ID::_Method_default_instance_),
+ reinterpret_cast(&PROTOBUF_NAMESPACE_ID::_Mixin_default_instance_),
};
-static ::google::protobuf::internal::AssignDescriptorsTable assign_descriptors_table_google_2fprotobuf_2fapi_2eproto = {
+static ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptorsTable assign_descriptors_table_google_2fprotobuf_2fapi_2eproto = {
{}, AddDescriptors_google_2fprotobuf_2fapi_2eproto, "google/protobuf/api.proto", schemas,
file_default_instances, TableStruct_google_2fprotobuf_2fapi_2eproto::offsets,
file_level_metadata_google_2fprotobuf_2fapi_2eproto, 3, file_level_enum_descriptors_google_2fprotobuf_2fapi_2eproto, file_level_service_descriptors_google_2fprotobuf_2fapi_2eproto,
@@ -165,38 +163,37 @@ const char descriptor_table_protodef_google_2fprotobuf_2fapi_2eproto[] =
"nproto/protobuf/api;api\242\002\003GPB\252\002\036Google.P"
"rotobuf.WellKnownTypesb\006proto3"
;
-static ::google::protobuf::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fapi_2eproto = {
+static ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fapi_2eproto = {
false, InitDefaults_google_2fprotobuf_2fapi_2eproto,
descriptor_table_protodef_google_2fprotobuf_2fapi_2eproto,
"google/protobuf/api.proto", &assign_descriptors_table_google_2fprotobuf_2fapi_2eproto, 750,
};
void AddDescriptors_google_2fprotobuf_2fapi_2eproto() {
- static constexpr ::google::protobuf::internal::InitFunc deps[2] =
+ static constexpr ::PROTOBUF_NAMESPACE_ID::internal::InitFunc deps[2] =
{
::AddDescriptors_google_2fprotobuf_2fsource_5fcontext_2eproto,
::AddDescriptors_google_2fprotobuf_2ftype_2eproto,
};
- ::google::protobuf::internal::AddDescriptors(&descriptor_table_google_2fprotobuf_2fapi_2eproto, deps, 2);
+ ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_google_2fprotobuf_2fapi_2eproto, deps, 2);
}
// Force running AddDescriptors() at dynamic initialization time.
static bool dynamic_init_dummy_google_2fprotobuf_2fapi_2eproto = []() { AddDescriptors_google_2fprotobuf_2fapi_2eproto(); return true; }();
-namespace google {
-namespace protobuf {
+PROTOBUF_NAMESPACE_OPEN
// ===================================================================
void Api::InitAsDefaultInstance() {
- ::google::protobuf::_Api_default_instance_._instance.get_mutable()->source_context_ = const_cast< ::google::protobuf::SourceContext*>(
- ::google::protobuf::SourceContext::internal_default_instance());
+ 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 {
public:
- static const ::google::protobuf::SourceContext& source_context(const Api* msg);
+ static const PROTOBUF_NAMESPACE_ID::SourceContext& source_context(const Api* msg);
};
-const ::google::protobuf::SourceContext&
+const PROTOBUF_NAMESPACE_ID::SourceContext&
Api::HasBitSetters::source_context(const Api* msg) {
return *msg->source_context_;
}
@@ -220,27 +217,27 @@ const int Api::kSyntaxFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
Api::Api()
- : ::google::protobuf::Message(), _internal_metadata_(nullptr) {
+ : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:google.protobuf.Api)
}
Api::Api(const Api& from)
- : ::google::protobuf::Message(),
+ : ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
methods_(from.methods_),
options_(from.options_),
mixins_(from.mixins_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
- name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from.name().size() > 0) {
- name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
+ name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
}
- version_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ version_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from.version().size() > 0) {
- version_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.version_);
+ version_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.version_);
}
if (from.has_source_context()) {
- source_context_ = new ::google::protobuf::SourceContext(*from.source_context_);
+ source_context_ = new PROTOBUF_NAMESPACE_ID::SourceContext(*from.source_context_);
} else {
source_context_ = nullptr;
}
@@ -249,10 +246,10 @@ Api::Api(const Api& from)
}
void Api::SharedCtor() {
- ::google::protobuf::internal::InitSCC(
+ ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(
&scc_info_Api_google_2fprotobuf_2fapi_2eproto.base);
- name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
- version_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ version_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
::memset(&source_context_, 0, static_cast(
reinterpret_cast(&syntax_) -
reinterpret_cast(&source_context_)) + sizeof(syntax_));
@@ -264,8 +261,8 @@ Api::~Api() {
}
void Api::SharedDtor() {
- name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
- version_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ version_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (this != internal_default_instance()) delete source_context_;
}
@@ -273,22 +270,22 @@ void Api::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const Api& Api::default_instance() {
- ::google::protobuf::internal::InitSCC(&::scc_info_Api_google_2fprotobuf_2fapi_2eproto.base);
+ ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Api_google_2fprotobuf_2fapi_2eproto.base);
return *internal_default_instance();
}
void Api::Clear() {
// @@protoc_insertion_point(message_clear_start:google.protobuf.Api)
- ::google::protobuf::uint32 cached_has_bits = 0;
+ ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
methods_.Clear();
options_.Clear();
mixins_.Clear();
- name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
- version_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ version_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (GetArenaNoVirtual() == nullptr && source_context_ != nullptr) {
delete source_context_;
}
@@ -298,69 +295,70 @@ void Api::Clear() {
}
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
-const char* Api::_InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) {
+const char* Api::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+ ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena;
while (!ctx->Done(&ptr)) {
- ::google::protobuf::uint32 tag;
- ptr = ::google::protobuf::internal::ReadTag(ptr, &tag);
+ ::PROTOBUF_NAMESPACE_ID::uint32 tag;
+ ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
switch (tag >> 3) {
// string name = 1;
case 1: {
- if (static_cast<::google::protobuf::uint8>(tag) != 10) goto handle_unusual;
- ptr = ::google::protobuf::internal::InlineGreedyStringParserUTF8(mutable_name(), ptr, ctx, "google.protobuf.Api.name");
+ if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) != 10) goto handle_unusual;
+ ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_name(), ptr, ctx, "google.protobuf.Api.name");
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
break;
}
// repeated .google.protobuf.Method methods = 2;
case 2: {
- if (static_cast<::google::protobuf::uint8>(tag) != 18) goto handle_unusual;
+ if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) != 18) goto handle_unusual;
do {
ptr = ctx->ParseMessage(add_methods(), ptr);
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
if (ctx->Done(&ptr)) return ptr;
- } while ((::google::protobuf::internal::UnalignedLoad<::google::protobuf::uint64>(ptr) & 255) == 18 && (ptr += 1));
+ } while ((::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint64>(ptr) & 255) == 18 && (ptr += 1));
break;
}
// repeated .google.protobuf.Option options = 3;
case 3: {
- if (static_cast<::google::protobuf::uint8>(tag) != 26) goto handle_unusual;
+ if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) != 26) goto handle_unusual;
do {
ptr = ctx->ParseMessage(add_options(), ptr);
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
if (ctx->Done(&ptr)) return ptr;
- } while ((::google::protobuf::internal::UnalignedLoad<::google::protobuf::uint64>(ptr) & 255) == 26 && (ptr += 1));
+ } while ((::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint64>(ptr) & 255) == 26 && (ptr += 1));
break;
}
// string version = 4;
case 4: {
- if (static_cast<::google::protobuf::uint8>(tag) != 34) goto handle_unusual;
- ptr = ::google::protobuf::internal::InlineGreedyStringParserUTF8(mutable_version(), ptr, ctx, "google.protobuf.Api.version");
+ if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) != 34) goto handle_unusual;
+ ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_version(), ptr, ctx, "google.protobuf.Api.version");
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
break;
}
// .google.protobuf.SourceContext source_context = 5;
case 5: {
- if (static_cast<::google::protobuf::uint8>(tag) != 42) goto handle_unusual;
+ if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) != 42) goto handle_unusual;
ptr = ctx->ParseMessage(mutable_source_context(), ptr);
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
break;
}
// repeated .google.protobuf.Mixin mixins = 6;
case 6: {
- if (static_cast<::google::protobuf::uint8>(tag) != 50) goto handle_unusual;
+ if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) != 50) goto handle_unusual;
do {
ptr = ctx->ParseMessage(add_mixins(), ptr);
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
if (ctx->Done(&ptr)) return ptr;
- } while ((::google::protobuf::internal::UnalignedLoad<::google::protobuf::uint64>(ptr) & 255) == 50 && (ptr += 1));
+ } while ((::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint64>(ptr) & 255) == 50 && (ptr += 1));
break;
}
// .google.protobuf.Syntax syntax = 7;
case 7: {
- if (static_cast<::google::protobuf::uint8>(tag) != 56) goto handle_unusual;
- ::google::protobuf::uint64 val = ::google::protobuf::internal::ReadVarint(&ptr);
+ if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) != 56) goto handle_unusual;
+ ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
- set_syntax(static_cast<::google::protobuf::Syntax>(val));
+ set_syntax(static_cast(val));
break;
}
default: {
@@ -380,23 +378,23 @@ const char* Api::_InternalParse(const char* ptr, ::google::protobuf::internal::P
}
#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
bool Api::MergePartialFromCodedStream(
- ::google::protobuf::io::CodedInputStream* input) {
+ ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
- ::google::protobuf::uint32 tag;
+ ::PROTOBUF_NAMESPACE_ID::uint32 tag;
// @@protoc_insertion_point(parse_start:google.protobuf.Api)
for (;;) {
- ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
+ ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
tag = p.first;
if (!p.second) goto handle_unusual;
- switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+ switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// string name = 1;
case 1: {
- if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) {
- DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+ if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) {
+ DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
input, this->mutable_name()));
- DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+ DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->name().data(), static_cast(this->name().length()),
- ::google::protobuf::internal::WireFormatLite::PARSE,
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
"google.protobuf.Api.name"));
} else {
goto handle_unusual;
@@ -406,8 +404,8 @@ bool Api::MergePartialFromCodedStream(
// repeated .google.protobuf.Method methods = 2;
case 2: {
- if (static_cast< ::google::protobuf::uint8>(tag) == (18 & 0xFF)) {
- DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
+ if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) {
+ DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
input, add_methods()));
} else {
goto handle_unusual;
@@ -417,8 +415,8 @@ bool Api::MergePartialFromCodedStream(
// repeated .google.protobuf.Option options = 3;
case 3: {
- if (static_cast< ::google::protobuf::uint8>(tag) == (26 & 0xFF)) {
- DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
+ if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) {
+ DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
input, add_options()));
} else {
goto handle_unusual;
@@ -428,12 +426,12 @@ bool Api::MergePartialFromCodedStream(
// string version = 4;
case 4: {
- if (static_cast< ::google::protobuf::uint8>(tag) == (34 & 0xFF)) {
- DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+ if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (34 & 0xFF)) {
+ DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
input, this->mutable_version()));
- DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+ DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->version().data(), static_cast(this->version().length()),
- ::google::protobuf::internal::WireFormatLite::PARSE,
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
"google.protobuf.Api.version"));
} else {
goto handle_unusual;
@@ -443,8 +441,8 @@ bool Api::MergePartialFromCodedStream(
// .google.protobuf.SourceContext source_context = 5;
case 5: {
- if (static_cast< ::google::protobuf::uint8>(tag) == (42 & 0xFF)) {
- DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
+ if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (42 & 0xFF)) {
+ DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
input, mutable_source_context()));
} else {
goto handle_unusual;
@@ -454,8 +452,8 @@ bool Api::MergePartialFromCodedStream(
// repeated .google.protobuf.Mixin mixins = 6;
case 6: {
- if (static_cast< ::google::protobuf::uint8>(tag) == (50 & 0xFF)) {
- DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
+ if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (50 & 0xFF)) {
+ DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
input, add_mixins()));
} else {
goto handle_unusual;
@@ -465,12 +463,12 @@ bool Api::MergePartialFromCodedStream(
// .google.protobuf.Syntax syntax = 7;
case 7: {
- if (static_cast< ::google::protobuf::uint8>(tag) == (56 & 0xFF)) {
+ if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (56 & 0xFF)) {
int value = 0;
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
+ DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
+ int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
input, &value)));
- set_syntax(static_cast< ::google::protobuf::Syntax >(value));
+ set_syntax(static_cast< PROTOBUF_NAMESPACE_ID::Syntax >(value));
} else {
goto handle_unusual;
}
@@ -482,7 +480,7 @@ bool Api::MergePartialFromCodedStream(
if (tag == 0) {
goto success;
}
- DO_(::google::protobuf::internal::WireFormat::SkipField(
+ DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
input, tag, _internal_metadata_.mutable_unknown_fields()));
break;
}
@@ -499,25 +497,25 @@ failure:
#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
void Api::SerializeWithCachedSizes(
- ::google::protobuf::io::CodedOutputStream* output) const {
+ ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:google.protobuf.Api)
- ::google::protobuf::uint32 cached_has_bits = 0;
+ ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// string name = 1;
if (this->name().size() > 0) {
- ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->name().data(), static_cast(this->name().length()),
- ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"google.protobuf.Api.name");
- ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
1, this->name(), output);
}
// repeated .google.protobuf.Method methods = 2;
for (unsigned int i = 0,
n = static_cast(this->methods_size()); i < n; i++) {
- ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
2,
this->methods(static_cast(i)),
output);
@@ -526,7 +524,7 @@ void Api::SerializeWithCachedSizes(
// repeated .google.protobuf.Option options = 3;
for (unsigned int i = 0,
n = static_cast(this->options_size()); i < n; i++) {
- ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
3,
this->options(static_cast(i)),
output);
@@ -534,24 +532,24 @@ void Api::SerializeWithCachedSizes(
// string version = 4;
if (this->version().size() > 0) {
- ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->version().data(), static_cast(this->version().length()),
- ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"google.protobuf.Api.version");
- ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
4, this->version(), output);
}
// .google.protobuf.SourceContext source_context = 5;
if (this->has_source_context()) {
- ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
5, HasBitSetters::source_context(this), output);
}
// repeated .google.protobuf.Mixin mixins = 6;
for (unsigned int i = 0,
n = static_cast(this->mixins_size()); i < n; i++) {
- ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
6,
this->mixins(static_cast(i)),
output);
@@ -559,38 +557,38 @@ void Api::SerializeWithCachedSizes(
// .google.protobuf.Syntax syntax = 7;
if (this->syntax() != 0) {
- ::google::protobuf::internal::WireFormatLite::WriteEnum(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
7, this->syntax(), output);
}
if (_internal_metadata_.have_unknown_fields()) {
- ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
_internal_metadata_.unknown_fields(), output);
}
// @@protoc_insertion_point(serialize_end:google.protobuf.Api)
}
-::google::protobuf::uint8* Api::InternalSerializeWithCachedSizesToArray(
- ::google::protobuf::uint8* target) const {
+::PROTOBUF_NAMESPACE_ID::uint8* Api::InternalSerializeWithCachedSizesToArray(
+ ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Api)
- ::google::protobuf::uint32 cached_has_bits = 0;
+ ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// string name = 1;
if (this->name().size() > 0) {
- ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->name().data(), static_cast(this->name().length()),
- ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"google.protobuf.Api.name");
target =
- ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
1, this->name(), target);
}
// repeated .google.protobuf.Method methods = 2;
for (unsigned int i = 0,
n = static_cast(this->methods_size()); i < n; i++) {
- target = ::google::protobuf::internal::WireFormatLite::
+ target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
2, this->methods(static_cast(i)), target);
}
@@ -598,25 +596,25 @@ void Api::SerializeWithCachedSizes(
// repeated .google.protobuf.Option options = 3;
for (unsigned int i = 0,
n = static_cast(this->options_size()); i < n; i++) {
- target = ::google::protobuf::internal::WireFormatLite::
+ target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
3, this->options(static_cast(i)), target);
}
// string version = 4;
if (this->version().size() > 0) {
- ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->version().data(), static_cast(this->version().length()),
- ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"google.protobuf.Api.version");
target =
- ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
4, this->version(), target);
}
// .google.protobuf.SourceContext source_context = 5;
if (this->has_source_context()) {
- target = ::google::protobuf::internal::WireFormatLite::
+ target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
5, HasBitSetters::source_context(this), target);
}
@@ -624,19 +622,19 @@ void Api::SerializeWithCachedSizes(
// repeated .google.protobuf.Mixin mixins = 6;
for (unsigned int i = 0,
n = static_cast(this->mixins_size()); i < n; i++) {
- target = ::google::protobuf::internal::WireFormatLite::
+ target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
6, this->mixins(static_cast(i)), target);
}
// .google.protobuf.Syntax syntax = 7;
if (this->syntax() != 0) {
- target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
+ target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
7, this->syntax(), target);
}
if (_internal_metadata_.have_unknown_fields()) {
- target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
+ target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target);
}
// @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Api)
@@ -649,10 +647,10 @@ size_t Api::ByteSizeLong() const {
if (_internal_metadata_.have_unknown_fields()) {
total_size +=
- ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
_internal_metadata_.unknown_fields());
}
- ::google::protobuf::uint32 cached_has_bits = 0;
+ ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
@@ -662,7 +660,7 @@ size_t Api::ByteSizeLong() const {
total_size += 1UL * count;
for (unsigned int i = 0; i < count; i++) {
total_size +=
- ::google::protobuf::internal::WireFormatLite::MessageSize(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
this->methods(static_cast(i)));
}
}
@@ -673,7 +671,7 @@ size_t Api::ByteSizeLong() const {
total_size += 1UL * count;
for (unsigned int i = 0; i < count; i++) {
total_size +=
- ::google::protobuf::internal::WireFormatLite::MessageSize(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
this->options(static_cast(i)));
}
}
@@ -684,7 +682,7 @@ size_t Api::ByteSizeLong() const {
total_size += 1UL * count;
for (unsigned int i = 0; i < count; i++) {
total_size +=
- ::google::protobuf::internal::WireFormatLite::MessageSize(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
this->mixins(static_cast(i)));
}
}
@@ -692,44 +690,44 @@ size_t Api::ByteSizeLong() const {
// string name = 1;
if (this->name().size() > 0) {
total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::StringSize(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->name());
}
// string version = 4;
if (this->version().size() > 0) {
total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::StringSize(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->version());
}
// .google.protobuf.SourceContext source_context = 5;
if (this->has_source_context()) {
total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::MessageSize(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*source_context_);
}
// .google.protobuf.Syntax syntax = 7;
if (this->syntax() != 0) {
total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::EnumSize(this->syntax());
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->syntax());
}
- int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
+ int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
-void Api::MergeFrom(const ::google::protobuf::Message& from) {
+void Api::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Api)
GOOGLE_DCHECK_NE(&from, this);
const Api* source =
- ::google::protobuf::DynamicCastToGenerated(
+ ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Api)
- ::google::protobuf::internal::ReflectionOps::Merge(from, this);
+ ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Api)
MergeFrom(*source);
@@ -740,7 +738,7 @@ void Api::MergeFrom(const Api& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Api)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
- ::google::protobuf::uint32 cached_has_bits = 0;
+ ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
methods_.MergeFrom(from.methods_);
@@ -748,21 +746,21 @@ void Api::MergeFrom(const Api& from) {
mixins_.MergeFrom(from.mixins_);
if (from.name().size() > 0) {
- name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
+ name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
}
if (from.version().size() > 0) {
- version_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.version_);
+ version_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.version_);
}
if (from.has_source_context()) {
- mutable_source_context()->::google::protobuf::SourceContext::MergeFrom(from.source_context());
+ mutable_source_context()->PROTOBUF_NAMESPACE_ID::SourceContext::MergeFrom(from.source_context());
}
if (from.syntax() != 0) {
set_syntax(from.syntax());
}
}
-void Api::CopyFrom(const ::google::protobuf::Message& from) {
+void Api::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Api)
if (&from == this) return;
Clear();
@@ -790,16 +788,16 @@ void Api::InternalSwap(Api* other) {
CastToBase(&methods_)->InternalSwap(CastToBase(&other->methods_));
CastToBase(&options_)->InternalSwap(CastToBase(&other->options_));
CastToBase(&mixins_)->InternalSwap(CastToBase(&other->mixins_));
- name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
- version_.Swap(&other->version_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ version_.Swap(&other->version_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
swap(source_context_, other->source_context_);
swap(syntax_, other->syntax_);
}
-::google::protobuf::Metadata Api::GetMetadata() const {
- ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fapi_2eproto);
+::PROTOBUF_NAMESPACE_ID::Metadata Api::GetMetadata() const {
+ ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fapi_2eproto);
return ::file_level_metadata_google_2fprotobuf_2fapi_2eproto[kIndexInFileMessages];
}
@@ -826,26 +824,26 @@ const int Method::kSyntaxFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
Method::Method()
- : ::google::protobuf::Message(), _internal_metadata_(nullptr) {
+ : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:google.protobuf.Method)
}
Method::Method(const Method& from)
- : ::google::protobuf::Message(),
+ : ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr),
options_(from.options_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
- name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from.name().size() > 0) {
- name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
+ name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
}
- request_type_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ request_type_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from.request_type_url().size() > 0) {
- request_type_url_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.request_type_url_);
+ request_type_url_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.request_type_url_);
}
- response_type_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ response_type_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from.response_type_url().size() > 0) {
- response_type_url_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.response_type_url_);
+ response_type_url_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.response_type_url_);
}
::memcpy(&request_streaming_, &from.request_streaming_,
static_cast(reinterpret_cast(&syntax_) -
@@ -854,11 +852,11 @@ Method::Method(const Method& from)
}
void Method::SharedCtor() {
- ::google::protobuf::internal::InitSCC(
+ ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(
&scc_info_Method_google_2fprotobuf_2fapi_2eproto.base);
- name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
- request_type_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
- response_type_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ request_type_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ response_type_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
::memset(&request_streaming_, 0, static_cast(
reinterpret_cast(&syntax_) -
reinterpret_cast(&request_streaming_)) + sizeof(syntax_));
@@ -870,30 +868,30 @@ Method::~Method() {
}
void Method::SharedDtor() {
- name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
- request_type_url_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
- response_type_url_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ request_type_url_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ response_type_url_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
void Method::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const Method& Method::default_instance() {
- ::google::protobuf::internal::InitSCC(&::scc_info_Method_google_2fprotobuf_2fapi_2eproto.base);
+ ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Method_google_2fprotobuf_2fapi_2eproto.base);
return *internal_default_instance();
}
void Method::Clear() {
// @@protoc_insertion_point(message_clear_start:google.protobuf.Method)
- ::google::protobuf::uint32 cached_has_bits = 0;
+ ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
options_.Clear();
- name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
- request_type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
- response_type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ request_type_url_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ response_type_url_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
::memset(&request_streaming_, 0, static_cast(
reinterpret_cast(&syntax_) -
reinterpret_cast(&request_streaming_)) + sizeof(syntax_));
@@ -901,63 +899,64 @@ void Method::Clear() {
}
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
-const char* Method::_InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) {
+const char* Method::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+ ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena;
while (!ctx->Done(&ptr)) {
- ::google::protobuf::uint32 tag;
- ptr = ::google::protobuf::internal::ReadTag(ptr, &tag);
+ ::PROTOBUF_NAMESPACE_ID::uint32 tag;
+ ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
switch (tag >> 3) {
// string name = 1;
case 1: {
- if (static_cast<::google::protobuf::uint8>(tag) != 10) goto handle_unusual;
- ptr = ::google::protobuf::internal::InlineGreedyStringParserUTF8(mutable_name(), ptr, ctx, "google.protobuf.Method.name");
+ if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) != 10) goto handle_unusual;
+ ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_name(), ptr, ctx, "google.protobuf.Method.name");
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
break;
}
// string request_type_url = 2;
case 2: {
- if (static_cast<::google::protobuf::uint8>(tag) != 18) goto handle_unusual;
- ptr = ::google::protobuf::internal::InlineGreedyStringParserUTF8(mutable_request_type_url(), ptr, ctx, "google.protobuf.Method.request_type_url");
+ if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) != 18) goto handle_unusual;
+ ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_request_type_url(), ptr, ctx, "google.protobuf.Method.request_type_url");
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
break;
}
// bool request_streaming = 3;
case 3: {
- if (static_cast<::google::protobuf::uint8>(tag) != 24) goto handle_unusual;
- set_request_streaming(::google::protobuf::internal::ReadVarint(&ptr));
+ if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) != 24) goto handle_unusual;
+ set_request_streaming(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr));
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
break;
}
// string response_type_url = 4;
case 4: {
- if (static_cast<::google::protobuf::uint8>(tag) != 34) goto handle_unusual;
- ptr = ::google::protobuf::internal::InlineGreedyStringParserUTF8(mutable_response_type_url(), ptr, ctx, "google.protobuf.Method.response_type_url");
+ if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) != 34) goto handle_unusual;
+ ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_response_type_url(), ptr, ctx, "google.protobuf.Method.response_type_url");
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
break;
}
// bool response_streaming = 5;
case 5: {
- if (static_cast<::google::protobuf::uint8>(tag) != 40) goto handle_unusual;
- set_response_streaming(::google::protobuf::internal::ReadVarint(&ptr));
+ if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) != 40) goto handle_unusual;
+ set_response_streaming(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr));
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
break;
}
// repeated .google.protobuf.Option options = 6;
case 6: {
- if (static_cast<::google::protobuf::uint8>(tag) != 50) goto handle_unusual;
+ if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) != 50) goto handle_unusual;
do {
ptr = ctx->ParseMessage(add_options(), ptr);
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
if (ctx->Done(&ptr)) return ptr;
- } while ((::google::protobuf::internal::UnalignedLoad<::google::protobuf::uint64>(ptr) & 255) == 50 && (ptr += 1));
+ } while ((::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint64>(ptr) & 255) == 50 && (ptr += 1));
break;
}
// .google.protobuf.Syntax syntax = 7;
case 7: {
- if (static_cast<::google::protobuf::uint8>(tag) != 56) goto handle_unusual;
- ::google::protobuf::uint64 val = ::google::protobuf::internal::ReadVarint(&ptr);
+ if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) != 56) goto handle_unusual;
+ ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
- set_syntax(static_cast<::google::protobuf::Syntax>(val));
+ set_syntax(static_cast(val));
break;
}
default: {
@@ -977,23 +976,23 @@ const char* Method::_InternalParse(const char* ptr, ::google::protobuf::internal
}
#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
bool Method::MergePartialFromCodedStream(
- ::google::protobuf::io::CodedInputStream* input) {
+ ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
- ::google::protobuf::uint32 tag;
+ ::PROTOBUF_NAMESPACE_ID::uint32 tag;
// @@protoc_insertion_point(parse_start:google.protobuf.Method)
for (;;) {
- ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
+ ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
tag = p.first;
if (!p.second) goto handle_unusual;
- switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+ switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// string name = 1;
case 1: {
- if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) {
- DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+ if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) {
+ DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
input, this->mutable_name()));
- DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+ DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->name().data(), static_cast(this->name().length()),
- ::google::protobuf::internal::WireFormatLite::PARSE,
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
"google.protobuf.Method.name"));
} else {
goto handle_unusual;
@@ -1003,12 +1002,12 @@ bool Method::MergePartialFromCodedStream(
// string request_type_url = 2;
case 2: {
- if (static_cast< ::google::protobuf::uint8>(tag) == (18 & 0xFF)) {
- DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+ if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) {
+ DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
input, this->mutable_request_type_url()));
- DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+ DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->request_type_url().data(), static_cast(this->request_type_url().length()),
- ::google::protobuf::internal::WireFormatLite::PARSE,
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
"google.protobuf.Method.request_type_url"));
} else {
goto handle_unusual;
@@ -1018,10 +1017,10 @@ bool Method::MergePartialFromCodedStream(
// bool request_streaming = 3;
case 3: {
- if (static_cast< ::google::protobuf::uint8>(tag) == (24 & 0xFF)) {
+ if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) {
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
+ DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
+ bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
input, &request_streaming_)));
} else {
goto handle_unusual;
@@ -1031,12 +1030,12 @@ bool Method::MergePartialFromCodedStream(
// string response_type_url = 4;
case 4: {
- if (static_cast< ::google::protobuf::uint8>(tag) == (34 & 0xFF)) {
- DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+ if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (34 & 0xFF)) {
+ DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
input, this->mutable_response_type_url()));
- DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+ DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->response_type_url().data(), static_cast(this->response_type_url().length()),
- ::google::protobuf::internal::WireFormatLite::PARSE,
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
"google.protobuf.Method.response_type_url"));
} else {
goto handle_unusual;
@@ -1046,10 +1045,10 @@ bool Method::MergePartialFromCodedStream(
// bool response_streaming = 5;
case 5: {
- if (static_cast< ::google::protobuf::uint8>(tag) == (40 & 0xFF)) {
+ if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) {
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
+ DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
+ bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
input, &response_streaming_)));
} else {
goto handle_unusual;
@@ -1059,8 +1058,8 @@ bool Method::MergePartialFromCodedStream(
// repeated .google.protobuf.Option options = 6;
case 6: {
- if (static_cast< ::google::protobuf::uint8>(tag) == (50 & 0xFF)) {
- DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
+ if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (50 & 0xFF)) {
+ DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
input, add_options()));
} else {
goto handle_unusual;
@@ -1070,12 +1069,12 @@ bool Method::MergePartialFromCodedStream(
// .google.protobuf.Syntax syntax = 7;
case 7: {
- if (static_cast< ::google::protobuf::uint8>(tag) == (56 & 0xFF)) {
+ if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (56 & 0xFF)) {
int value = 0;
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
+ DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
+ int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
input, &value)));
- set_syntax(static_cast< ::google::protobuf::Syntax >(value));
+ set_syntax(static_cast< PROTOBUF_NAMESPACE_ID::Syntax >(value));
} else {
goto handle_unusual;
}
@@ -1087,7 +1086,7 @@ bool Method::MergePartialFromCodedStream(
if (tag == 0) {
goto success;
}
- DO_(::google::protobuf::internal::WireFormat::SkipField(
+ DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
input, tag, _internal_metadata_.mutable_unknown_fields()));
break;
}
@@ -1104,55 +1103,55 @@ failure:
#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
void Method::SerializeWithCachedSizes(
- ::google::protobuf::io::CodedOutputStream* output) const {
+ ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:google.protobuf.Method)
- ::google::protobuf::uint32 cached_has_bits = 0;
+ ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// string name = 1;
if (this->name().size() > 0) {
- ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->name().data(), static_cast(this->name().length()),
- ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"google.protobuf.Method.name");
- ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
1, this->name(), output);
}
// string request_type_url = 2;
if (this->request_type_url().size() > 0) {
- ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->request_type_url().data(), static_cast(this->request_type_url().length()),
- ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"google.protobuf.Method.request_type_url");
- ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
2, this->request_type_url(), output);
}
// bool request_streaming = 3;
if (this->request_streaming() != 0) {
- ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->request_streaming(), output);
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(3, this->request_streaming(), output);
}
// string response_type_url = 4;
if (this->response_type_url().size() > 0) {
- ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->response_type_url().data(), static_cast(this->response_type_url().length()),
- ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"google.protobuf.Method.response_type_url");
- ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
4, this->response_type_url(), output);
}
// bool response_streaming = 5;
if (this->response_streaming() != 0) {
- ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->response_streaming(), output);
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(5, this->response_streaming(), output);
}
// repeated .google.protobuf.Option options = 6;
for (unsigned int i = 0,
n = static_cast(this->options_size()); i < n; i++) {
- ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
6,
this->options(static_cast(i)),
output);
@@ -1160,82 +1159,82 @@ void Method::SerializeWithCachedSizes(
// .google.protobuf.Syntax syntax = 7;
if (this->syntax() != 0) {
- ::google::protobuf::internal::WireFormatLite::WriteEnum(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
7, this->syntax(), output);
}
if (_internal_metadata_.have_unknown_fields()) {
- ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
_internal_metadata_.unknown_fields(), output);
}
// @@protoc_insertion_point(serialize_end:google.protobuf.Method)
}
-::google::protobuf::uint8* Method::InternalSerializeWithCachedSizesToArray(
- ::google::protobuf::uint8* target) const {
+::PROTOBUF_NAMESPACE_ID::uint8* Method::InternalSerializeWithCachedSizesToArray(
+ ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Method)
- ::google::protobuf::uint32 cached_has_bits = 0;
+ ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// string name = 1;
if (this->name().size() > 0) {
- ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->name().data(), static_cast(this->name().length()),
- ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"google.protobuf.Method.name");
target =
- ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
1, this->name(), target);
}
// string request_type_url = 2;
if (this->request_type_url().size() > 0) {
- ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->request_type_url().data(), static_cast(this->request_type_url().length()),
- ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"google.protobuf.Method.request_type_url");
target =
- ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
2, this->request_type_url(), target);
}
// bool request_streaming = 3;
if (this->request_streaming() != 0) {
- target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->request_streaming(), target);
+ target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->request_streaming(), target);
}
// string response_type_url = 4;
if (this->response_type_url().size() > 0) {
- ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->response_type_url().data(), static_cast(this->response_type_url().length()),
- ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"google.protobuf.Method.response_type_url");
target =
- ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
4, this->response_type_url(), target);
}
// bool response_streaming = 5;
if (this->response_streaming() != 0) {
- target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->response_streaming(), target);
+ target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(5, this->response_streaming(), target);
}
// repeated .google.protobuf.Option options = 6;
for (unsigned int i = 0,
n = static_cast(this->options_size()); i < n; i++) {
- target = ::google::protobuf::internal::WireFormatLite::
+ target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray(
6, this->options(static_cast(i)), target);
}
// .google.protobuf.Syntax syntax = 7;
if (this->syntax() != 0) {
- target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
+ target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
7, this->syntax(), target);
}
if (_internal_metadata_.have_unknown_fields()) {
- target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
+ target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target);
}
// @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Method)
@@ -1248,10 +1247,10 @@ size_t Method::ByteSizeLong() const {
if (_internal_metadata_.have_unknown_fields()) {
total_size +=
- ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
_internal_metadata_.unknown_fields());
}
- ::google::protobuf::uint32 cached_has_bits = 0;
+ ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
@@ -1261,7 +1260,7 @@ size_t Method::ByteSizeLong() const {
total_size += 1UL * count;
for (unsigned int i = 0; i < count; i++) {
total_size +=
- ::google::protobuf::internal::WireFormatLite::MessageSize(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
this->options(static_cast(i)));
}
}
@@ -1269,21 +1268,21 @@ size_t Method::ByteSizeLong() const {
// string name = 1;
if (this->name().size() > 0) {
total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::StringSize(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->name());
}
// string request_type_url = 2;
if (this->request_type_url().size() > 0) {
total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::StringSize(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->request_type_url());
}
// string response_type_url = 4;
if (this->response_type_url().size() > 0) {
total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::StringSize(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->response_type_url());
}
@@ -1300,23 +1299,23 @@ size_t Method::ByteSizeLong() const {
// .google.protobuf.Syntax syntax = 7;
if (this->syntax() != 0) {
total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::EnumSize(this->syntax());
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->syntax());
}
- int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
+ int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
-void Method::MergeFrom(const ::google::protobuf::Message& from) {
+void Method::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Method)
GOOGLE_DCHECK_NE(&from, this);
const Method* source =
- ::google::protobuf::DynamicCastToGenerated(
+ ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Method)
- ::google::protobuf::internal::ReflectionOps::Merge(from, this);
+ ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Method)
MergeFrom(*source);
@@ -1327,21 +1326,21 @@ void Method::MergeFrom(const Method& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Method)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
- ::google::protobuf::uint32 cached_has_bits = 0;
+ ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
options_.MergeFrom(from.options_);
if (from.name().size() > 0) {
- name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
+ name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
}
if (from.request_type_url().size() > 0) {
- request_type_url_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.request_type_url_);
+ request_type_url_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.request_type_url_);
}
if (from.response_type_url().size() > 0) {
- response_type_url_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.response_type_url_);
+ response_type_url_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.response_type_url_);
}
if (from.request_streaming() != 0) {
set_request_streaming(from.request_streaming());
@@ -1354,7 +1353,7 @@ void Method::MergeFrom(const Method& from) {
}
}
-void Method::CopyFrom(const ::google::protobuf::Message& from) {
+void Method::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Method)
if (&from == this) return;
Clear();
@@ -1380,19 +1379,19 @@ void Method::InternalSwap(Method* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
CastToBase(&options_)->InternalSwap(CastToBase(&other->options_));
- name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
- request_type_url_.Swap(&other->request_type_url_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ request_type_url_.Swap(&other->request_type_url_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
- response_type_url_.Swap(&other->response_type_url_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ response_type_url_.Swap(&other->response_type_url_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
swap(request_streaming_, other->request_streaming_);
swap(response_streaming_, other->response_streaming_);
swap(syntax_, other->syntax_);
}
-::google::protobuf::Metadata Method::GetMetadata() const {
- ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fapi_2eproto);
+::PROTOBUF_NAMESPACE_ID::Metadata Method::GetMetadata() const {
+ ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fapi_2eproto);
return ::file_level_metadata_google_2fprotobuf_2fapi_2eproto[kIndexInFileMessages];
}
@@ -1411,30 +1410,30 @@ const int Mixin::kRootFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
Mixin::Mixin()
- : ::google::protobuf::Message(), _internal_metadata_(nullptr) {
+ : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
// @@protoc_insertion_point(constructor:google.protobuf.Mixin)
}
Mixin::Mixin(const Mixin& from)
- : ::google::protobuf::Message(),
+ : ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
- name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from.name().size() > 0) {
- name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
+ name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
}
- root_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ root_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from.root().size() > 0) {
- root_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.root_);
+ root_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.root_);
}
// @@protoc_insertion_point(copy_constructor:google.protobuf.Mixin)
}
void Mixin::SharedCtor() {
- ::google::protobuf::internal::InitSCC(
+ ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(
&scc_info_Mixin_google_2fprotobuf_2fapi_2eproto.base);
- name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
- root_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ root_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
Mixin::~Mixin() {
@@ -1443,48 +1442,49 @@ Mixin::~Mixin() {
}
void Mixin::SharedDtor() {
- name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
- root_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ root_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
void Mixin::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const Mixin& Mixin::default_instance() {
- ::google::protobuf::internal::InitSCC(&::scc_info_Mixin_google_2fprotobuf_2fapi_2eproto.base);
+ ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Mixin_google_2fprotobuf_2fapi_2eproto.base);
return *internal_default_instance();
}
void Mixin::Clear() {
// @@protoc_insertion_point(message_clear_start:google.protobuf.Mixin)
- ::google::protobuf::uint32 cached_has_bits = 0;
+ ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
- name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
- root_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ root_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
_internal_metadata_.Clear();
}
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
-const char* Mixin::_InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) {
+const char* Mixin::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+ ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena;
while (!ctx->Done(&ptr)) {
- ::google::protobuf::uint32 tag;
- ptr = ::google::protobuf::internal::ReadTag(ptr, &tag);
+ ::PROTOBUF_NAMESPACE_ID::uint32 tag;
+ ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
switch (tag >> 3) {
// string name = 1;
case 1: {
- if (static_cast<::google::protobuf::uint8>(tag) != 10) goto handle_unusual;
- ptr = ::google::protobuf::internal::InlineGreedyStringParserUTF8(mutable_name(), ptr, ctx, "google.protobuf.Mixin.name");
+ if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) != 10) goto handle_unusual;
+ ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_name(), ptr, ctx, "google.protobuf.Mixin.name");
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
break;
}
// string root = 2;
case 2: {
- if (static_cast<::google::protobuf::uint8>(tag) != 18) goto handle_unusual;
- ptr = ::google::protobuf::internal::InlineGreedyStringParserUTF8(mutable_root(), ptr, ctx, "google.protobuf.Mixin.root");
+ if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) != 18) goto handle_unusual;
+ ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_root(), ptr, ctx, "google.protobuf.Mixin.root");
GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
break;
}
@@ -1505,23 +1505,23 @@ const char* Mixin::_InternalParse(const char* ptr, ::google::protobuf::internal:
}
#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
bool Mixin::MergePartialFromCodedStream(
- ::google::protobuf::io::CodedInputStream* input) {
+ ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
- ::google::protobuf::uint32 tag;
+ ::PROTOBUF_NAMESPACE_ID::uint32 tag;
// @@protoc_insertion_point(parse_start:google.protobuf.Mixin)
for (;;) {
- ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
+ ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
tag = p.first;
if (!p.second) goto handle_unusual;
- switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+ switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// string name = 1;
case 1: {
- if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) {
- DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+ if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) {
+ DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
input, this->mutable_name()));
- DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+ DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->name().data(), static_cast(this->name().length()),
- ::google::protobuf::internal::WireFormatLite::PARSE,
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
"google.protobuf.Mixin.name"));
} else {
goto handle_unusual;
@@ -1531,12 +1531,12 @@ bool Mixin::MergePartialFromCodedStream(
// string root = 2;
case 2: {
- if (static_cast< ::google::protobuf::uint8>(tag) == (18 & 0xFF)) {
- DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+ if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) {
+ DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
input, this->mutable_root()));
- DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+ DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->root().data(), static_cast(this->root().length()),
- ::google::protobuf::internal::WireFormatLite::PARSE,
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
"google.protobuf.Mixin.root"));
} else {
goto handle_unusual;
@@ -1549,7 +1549,7 @@ bool Mixin::MergePartialFromCodedStream(
if (tag == 0) {
goto success;
}
- DO_(::google::protobuf::internal::WireFormat::SkipField(
+ DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
input, tag, _internal_metadata_.mutable_unknown_fields()));
break;
}
@@ -1566,68 +1566,68 @@ failure:
#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
void Mixin::SerializeWithCachedSizes(
- ::google::protobuf::io::CodedOutputStream* output) const {
+ ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:google.protobuf.Mixin)
- ::google::protobuf::uint32 cached_has_bits = 0;
+ ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// string name = 1;
if (this->name().size() > 0) {
- ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->name().data(), static_cast(this->name().length()),
- ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"google.protobuf.Mixin.name");
- ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
1, this->name(), output);
}
// string root = 2;
if (this->root().size() > 0) {
- ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->root().data(), static_cast(this->root().length()),
- ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"google.protobuf.Mixin.root");
- ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
2, this->root(), output);
}
if (_internal_metadata_.have_unknown_fields()) {
- ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
_internal_metadata_.unknown_fields(), output);
}
// @@protoc_insertion_point(serialize_end:google.protobuf.Mixin)
}
-::google::protobuf::uint8* Mixin::InternalSerializeWithCachedSizesToArray(
- ::google::protobuf::uint8* target) const {
+::PROTOBUF_NAMESPACE_ID::uint8* Mixin::InternalSerializeWithCachedSizesToArray(
+ ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Mixin)
- ::google::protobuf::uint32 cached_has_bits = 0;
+ ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// string name = 1;
if (this->name().size() > 0) {
- ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->name().data(), static_cast(this->name().length()),
- ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"google.protobuf.Mixin.name");
target =
- ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
1, this->name(), target);
}
// string root = 2;
if (this->root().size() > 0) {
- ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->root().data(), static_cast(this->root().length()),
- ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"google.protobuf.Mixin.root");
target =
- ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
2, this->root(), target);
}
if (_internal_metadata_.have_unknown_fields()) {
- target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
+ target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target);
}
// @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Mixin)
@@ -1640,41 +1640,41 @@ size_t Mixin::ByteSizeLong() const {
if (_internal_metadata_.have_unknown_fields()) {
total_size +=
- ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
_internal_metadata_.unknown_fields());
}
- ::google::protobuf::uint32 cached_has_bits = 0;
+ ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// string name = 1;
if (this->name().size() > 0) {
total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::StringSize(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->name());
}
// string root = 2;
if (this->root().size() > 0) {
total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::StringSize(
+ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->root());
}
- int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
+ int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
-void Mixin::MergeFrom(const ::google::protobuf::Message& from) {
+void Mixin::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Mixin)
GOOGLE_DCHECK_NE(&from, this);
const Mixin* source =
- ::google::protobuf::DynamicCastToGenerated(
+ ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Mixin)
- ::google::protobuf::internal::ReflectionOps::Merge(from, this);
+ ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Mixin)
MergeFrom(*source);
@@ -1685,20 +1685,20 @@ void Mixin::MergeFrom(const Mixin& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Mixin)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
- ::google::protobuf::uint32 cached_has_bits = 0;
+ ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.name().size() > 0) {
- name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
+ name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
}
if (from.root().size() > 0) {
- root_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.root_);
+ root_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.root_);
}
}
-void Mixin::CopyFrom(const ::google::protobuf::Message& from) {
+void Mixin::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Mixin)
if (&from == this) return;
Clear();
@@ -1723,34 +1723,31 @@ void Mixin::Swap(Mixin* other) {
void Mixin::InternalSwap(Mixin* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
- name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
- root_.Swap(&other->root_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ root_.Swap(&other->root_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
}
-::google::protobuf::Metadata Mixin::GetMetadata() const {
- ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fapi_2eproto);
+::PROTOBUF_NAMESPACE_ID::Metadata Mixin::GetMetadata() const {
+ ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::assign_descriptors_table_google_2fprotobuf_2fapi_2eproto);
return ::file_level_metadata_google_2fprotobuf_2fapi_2eproto[kIndexInFileMessages];
}
// @@protoc_insertion_point(namespace_scope)
-} // namespace protobuf
-} // namespace google
-namespace google {
-namespace protobuf {
-template<> PROTOBUF_NOINLINE ::google::protobuf::Api* Arena::CreateMaybeMessage< ::google::protobuf::Api >(Arena* arena) {
- return Arena::CreateInternal< ::google::protobuf::Api >(arena);
+PROTOBUF_NAMESPACE_CLOSE
+PROTOBUF_NAMESPACE_OPEN
+template<> PROTOBUF_NOINLINE PROTOBUF_NAMESPACE_ID::Api* Arena::CreateMaybeMessage< PROTOBUF_NAMESPACE_ID::Api >(Arena* arena) {
+ return Arena::CreateInternal< PROTOBUF_NAMESPACE_ID::Api >(arena);
}
-template<> PROTOBUF_NOINLINE ::google::protobuf::Method* Arena::CreateMaybeMessage< ::google::protobuf::Method >(Arena* arena) {
- return Arena::CreateInternal< ::google::protobuf::Method >(arena);
+template<> PROTOBUF_NOINLINE PROTOBUF_NAMESPACE_ID::Method* Arena::CreateMaybeMessage< PROTOBUF_NAMESPACE_ID::Method >(Arena* arena) {
+ return Arena::CreateInternal< PROTOBUF_NAMESPACE_ID::Method >(arena);
}
-template<> PROTOBUF_NOINLINE ::google::protobuf::Mixin* Arena::CreateMaybeMessage< ::google::protobuf::Mixin >(Arena* arena) {
- return Arena::CreateInternal< ::google::protobuf::Mixin >(arena);
+template<> PROTOBUF_NOINLINE PROTOBUF_NAMESPACE_ID::Mixin* Arena::CreateMaybeMessage< PROTOBUF_NAMESPACE_ID::Mixin >(Arena* arena) {
+ return Arena::CreateInternal< PROTOBUF_NAMESPACE_ID::Mixin >(arena);
}
-} // namespace protobuf
-} // namespace google
+PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include
diff --git a/src/google/protobuf/api.pb.h b/src/google/protobuf/api.pb.h
index 3b74e19bcd..4e4f921f01 100644
--- a/src/google/protobuf/api.pb.h
+++ b/src/google/protobuf/api.pb.h
@@ -1,8 +1,8 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/api.proto
-#ifndef PROTOBUF_INCLUDED_google_2fprotobuf_2fapi_2eproto
-#define PROTOBUF_INCLUDED_google_2fprotobuf_2fapi_2eproto
+#ifndef GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fapi_2eproto
+#define GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fapi_2eproto
#include
#include
@@ -31,34 +31,31 @@
#include // IWYU pragma: export
#include // IWYU pragma: export
#include
-namespace google {
-namespace protobuf {
-namespace internal {
-class AnyMetadata;
-} // namespace internal
-} // namespace protobuf
-} // namespace google
#include
#include
// @@protoc_insertion_point(includes)
#include
#define PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fapi_2eproto PROTOBUF_EXPORT
+PROTOBUF_NAMESPACE_OPEN
+namespace internal {
+class AnyMetadata;
+} // namespace internal
+PROTOBUF_NAMESPACE_CLOSE
// Internal implementation detail -- do not use these members.
struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2fapi_2eproto {
- static const ::google::protobuf::internal::ParseTableField entries[]
+ static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
- static const ::google::protobuf::internal::AuxillaryParseTableField aux[]
+ static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
- static const ::google::protobuf::internal::ParseTable schema[3]
+ static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[3]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
- static const ::google::protobuf::internal::FieldMetadata field_metadata[];
- static const ::google::protobuf::internal::SerializationTable serialization_table[];
- static const ::google::protobuf::uint32 offsets[];
+ static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[];
+ static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[];
+ static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[];
};
void PROTOBUF_EXPORT AddDescriptors_google_2fprotobuf_2fapi_2eproto();
-namespace google {
-namespace protobuf {
+PROTOBUF_NAMESPACE_OPEN
class Api;
class ApiDefaultTypeInternal;
PROTOBUF_EXPORT extern ApiDefaultTypeInternal _Api_default_instance_;
@@ -68,34 +65,32 @@ PROTOBUF_EXPORT extern MethodDefaultTypeInternal _Method_default_instance_;
class Mixin;
class MixinDefaultTypeInternal;
PROTOBUF_EXPORT extern MixinDefaultTypeInternal _Mixin_default_instance_;
-template<> PROTOBUF_EXPORT ::google::protobuf::Api* Arena::CreateMaybeMessage<::google::protobuf::Api>(Arena*);
-template<> PROTOBUF_EXPORT ::google::protobuf::Method* Arena::CreateMaybeMessage<::google::protobuf::Method>(Arena*);
-template<> PROTOBUF_EXPORT ::google::protobuf::Mixin* Arena::CreateMaybeMessage<::google::protobuf::Mixin>(Arena*);
-} // namespace protobuf
-} // namespace google
-namespace google {
-namespace protobuf {
+PROTOBUF_NAMESPACE_CLOSE
+PROTOBUF_NAMESPACE_OPEN
+template<> PROTOBUF_EXPORT PROTOBUF_NAMESPACE_ID::Api* Arena::CreateMaybeMessage(Arena*);
+template<> PROTOBUF_EXPORT PROTOBUF_NAMESPACE_ID::Method* Arena::CreateMaybeMessage(Arena*);
+template<> PROTOBUF_EXPORT PROTOBUF_NAMESPACE_ID::Mixin* Arena::CreateMaybeMessage(Arena*);
+PROTOBUF_NAMESPACE_CLOSE
+PROTOBUF_NAMESPACE_OPEN
// ===================================================================
class PROTOBUF_EXPORT Api final :
- public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Api) */ {
+ public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Api) */ {
public:
Api();
virtual ~Api();
Api(const Api& from);
-
- inline Api& operator=(const Api& from) {
- CopyFrom(from);
- return *this;
- }
- #if LANG_CXX11
Api(Api&& from) noexcept
: Api() {
*this = ::std::move(from);
}
+ inline Api& operator=(const Api& from) {
+ CopyFrom(from);
+ return *this;
+ }
inline Api& operator=(Api&& from) noexcept {
if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
if (this != &from) InternalSwap(&from);
@@ -104,8 +99,8 @@ class PROTOBUF_EXPORT Api final :
}
return *this;
}
- #endif
- static const ::google::protobuf::Descriptor* descriptor() {
+
+ static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
return default_instance().GetDescriptor();
}
static const Api& default_instance();
@@ -129,11 +124,11 @@ class PROTOBUF_EXPORT Api final :
return CreateMaybeMessage(nullptr);
}
- Api* New(::google::protobuf::Arena* arena) const final {
+ Api* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
return CreateMaybeMessage(arena);
}
- void CopyFrom(const ::google::protobuf::Message& from) final;
- void MergeFrom(const ::google::protobuf::Message& from) final;
+ void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
+ void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void CopyFrom(const Api& from);
void MergeFrom(const Api& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
@@ -141,15 +136,15 @@ class PROTOBUF_EXPORT Api final :
size_t ByteSizeLong() const final;
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
- const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final;
+ const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
#else
bool MergePartialFromCodedStream(
- ::google::protobuf::io::CodedInputStream* input) final;
+ ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final;
#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
void SerializeWithCachedSizes(
- ::google::protobuf::io::CodedOutputStream* output) const final;
- ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
- ::google::protobuf::uint8* target) const final;
+ ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final;
+ ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray(
+ ::PROTOBUF_NAMESPACE_ID::uint8* target) const final;
int GetCachedSize() const final { return _cached_size_.Get(); }
private:
@@ -157,12 +152,12 @@ class PROTOBUF_EXPORT Api final :
inline void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Api* other);
- friend class ::google::protobuf::internal::AnyMetadata;
- static ::google::protobuf::StringPiece FullMessageName() {
+ friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+ static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "google.protobuf.Api";
}
private:
- inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
+ inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const {
return nullptr;
}
inline void* MaybeArenaPtr() const {
@@ -170,7 +165,7 @@ class PROTOBUF_EXPORT Api final :
}
public:
- ::google::protobuf::Metadata GetMetadata() const final;
+ ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
// nested types ----------------------------------------------------
@@ -180,116 +175,110 @@ class PROTOBUF_EXPORT Api final :
int methods_size() const;
void clear_methods();
static const int kMethodsFieldNumber = 2;
- ::google::protobuf::Method* mutable_methods(int index);
- ::google::protobuf::RepeatedPtrField< ::google::protobuf::Method >*
+ PROTOBUF_NAMESPACE_ID::Method* mutable_methods(int index);
+ ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Method >*
mutable_methods();
- const ::google::protobuf::Method& methods(int index) const;
- ::google::protobuf::Method* add_methods();
- const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Method >&
+ const PROTOBUF_NAMESPACE_ID::Method& methods(int index) const;
+ PROTOBUF_NAMESPACE_ID::Method* add_methods();
+ const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Method >&
methods() const;
// repeated .google.protobuf.Option options = 3;
int options_size() const;
void clear_options();
static const int kOptionsFieldNumber = 3;
- ::google::protobuf::Option* mutable_options(int index);
- ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*
+ PROTOBUF_NAMESPACE_ID::Option* mutable_options(int index);
+ ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Option >*
mutable_options();
- const ::google::protobuf::Option& options(int index) const;
- ::google::protobuf::Option* add_options();
- const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >&
+ const PROTOBUF_NAMESPACE_ID::Option& options(int index) const;
+ PROTOBUF_NAMESPACE_ID::Option* add_options();
+ const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Option >&
options() const;
// repeated .google.protobuf.Mixin mixins = 6;
int mixins_size() const;
void clear_mixins();
static const int kMixinsFieldNumber = 6;
- ::google::protobuf::Mixin* mutable_mixins(int index);
- ::google::protobuf::RepeatedPtrField< ::google::protobuf::Mixin >*
+ PROTOBUF_NAMESPACE_ID::Mixin* mutable_mixins(int index);
+ ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Mixin >*
mutable_mixins();
- const ::google::protobuf::Mixin& mixins(int index) const;
- ::google::protobuf::Mixin* add_mixins();
- const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Mixin >&
+ const PROTOBUF_NAMESPACE_ID::Mixin& mixins(int index) const;
+ PROTOBUF_NAMESPACE_ID::Mixin* add_mixins();
+ const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Mixin >&
mixins() const;
// string name = 1;
void clear_name();
static const int kNameFieldNumber = 1;
- const ::std::string& name() const;
- void set_name(const ::std::string& value);
- #if LANG_CXX11
- void set_name(::std::string&& value);
- #endif
+ const std::string& name() const;
+ void set_name(const std::string& value);
+ void set_name(std::string&& value);
void set_name(const char* value);
void set_name(const char* value, size_t size);
- ::std::string* mutable_name();
- ::std::string* release_name();
- void set_allocated_name(::std::string* name);
+ std::string* mutable_name();
+ std::string* release_name();
+ void set_allocated_name(std::string* name);
// string version = 4;
void clear_version();
static const int kVersionFieldNumber = 4;
- const ::std::string& version() const;
- void set_version(const ::std::string& value);
- #if LANG_CXX11
- void set_version(::std::string&& value);
- #endif
+ const std::string& version() const;
+ void set_version(const std::string& value);
+ void set_version(std::string&& value);
void set_version(const char* value);
void set_version(const char* value, size_t size);
- ::std::string* mutable_version();
- ::std::string* release_version();
- void set_allocated_version(::std::string* version);
+ std::string* mutable_version();
+ std::string* release_version();
+ void set_allocated_version(std::string* version);
// .google.protobuf.SourceContext source_context = 5;
bool has_source_context() const;
void clear_source_context();
static const int kSourceContextFieldNumber = 5;
- const ::google::protobuf::SourceContext& source_context() const;
- ::google::protobuf::SourceContext* release_source_context();
- ::google::protobuf::SourceContext* mutable_source_context();
- void set_allocated_source_context(::google::protobuf::SourceContext* source_context);
+ const PROTOBUF_NAMESPACE_ID::SourceContext& source_context() const;
+ PROTOBUF_NAMESPACE_ID::SourceContext* release_source_context();
+ PROTOBUF_NAMESPACE_ID::SourceContext* mutable_source_context();
+ void set_allocated_source_context(PROTOBUF_NAMESPACE_ID::SourceContext* source_context);
// .google.protobuf.Syntax syntax = 7;
void clear_syntax();
static const int kSyntaxFieldNumber = 7;
- ::google::protobuf::Syntax syntax() const;
- void set_syntax(::google::protobuf::Syntax value);
+ PROTOBUF_NAMESPACE_ID::Syntax syntax() const;
+ void set_syntax(PROTOBUF_NAMESPACE_ID::Syntax value);
// @@protoc_insertion_point(class_scope:google.protobuf.Api)
private:
class HasBitSetters;
- ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
- ::google::protobuf::RepeatedPtrField< ::google::protobuf::Method > methods_;
- ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option > options_;
- ::google::protobuf::RepeatedPtrField< ::google::protobuf::Mixin > mixins_;
- ::google::protobuf::internal::ArenaStringPtr name_;
- ::google::protobuf::internal::ArenaStringPtr version_;
- ::google::protobuf::SourceContext* source_context_;
+ ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
+ ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Method > methods_;
+ ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Option > options_;
+ ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Mixin > mixins_;
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr version_;
+ PROTOBUF_NAMESPACE_ID::SourceContext* source_context_;
int syntax_;
- mutable ::google::protobuf::internal::CachedSize _cached_size_;
+ mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
friend struct ::TableStruct_google_2fprotobuf_2fapi_2eproto;
};
// -------------------------------------------------------------------
class PROTOBUF_EXPORT Method final :
- public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Method) */ {
+ public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Method) */ {
public:
Method();
virtual ~Method();
Method(const Method& from);
-
- inline Method& operator=(const Method& from) {
- CopyFrom(from);
- return *this;
- }
- #if LANG_CXX11
Method(Method&& from) noexcept
: Method() {
*this = ::std::move(from);
}
+ inline Method& operator=(const Method& from) {
+ CopyFrom(from);
+ return *this;
+ }
inline Method& operator=(Method&& from) noexcept {
if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
if (this != &from) InternalSwap(&from);
@@ -298,8 +287,8 @@ class PROTOBUF_EXPORT Method final :
}
return *this;
}
- #endif
- static const ::google::protobuf::Descriptor* descriptor() {
+
+ static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
return default_instance().GetDescriptor();
}
static const Method& default_instance();
@@ -323,11 +312,11 @@ class PROTOBUF_EXPORT Method final :
return CreateMaybeMessage(nullptr);
}
- Method* New(::google::protobuf::Arena* arena) const final {
+ Method* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
return CreateMaybeMessage(arena);
}
- void CopyFrom(const ::google::protobuf::Message& from) final;
- void MergeFrom(const ::google::protobuf::Message& from) final;
+ void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
+ void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void CopyFrom(const Method& from);
void MergeFrom(const Method& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
@@ -335,15 +324,15 @@ class PROTOBUF_EXPORT Method final :
size_t ByteSizeLong() const final;
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
- const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final;
+ const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
#else
bool MergePartialFromCodedStream(
- ::google::protobuf::io::CodedInputStream* input) final;
+ ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final;
#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
void SerializeWithCachedSizes(
- ::google::protobuf::io::CodedOutputStream* output) const final;
- ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
- ::google::protobuf::uint8* target) const final;
+ ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final;
+ ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray(
+ ::PROTOBUF_NAMESPACE_ID::uint8* target) const final;
int GetCachedSize() const final { return _cached_size_.Get(); }
private:
@@ -351,12 +340,12 @@ class PROTOBUF_EXPORT Method final :
inline void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Method* other);
- friend class ::google::protobuf::internal::AnyMetadata;
- static ::google::protobuf::StringPiece FullMessageName() {
+ friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+ static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "google.protobuf.Method";
}
private:
- inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
+ inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const {
return nullptr;
}
inline void* MaybeArenaPtr() const {
@@ -364,7 +353,7 @@ class PROTOBUF_EXPORT Method final :
}
public:
- ::google::protobuf::Metadata GetMetadata() const final;
+ ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
// nested types ----------------------------------------------------
@@ -374,55 +363,49 @@ class PROTOBUF_EXPORT Method final :
int options_size() const;
void clear_options();
static const int kOptionsFieldNumber = 6;
- ::google::protobuf::Option* mutable_options(int index);
- ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*
+ PROTOBUF_NAMESPACE_ID::Option* mutable_options(int index);
+ ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Option >*
mutable_options();
- const ::google::protobuf::Option& options(int index) const;
- ::google::protobuf::Option* add_options();
- const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >&
+ const PROTOBUF_NAMESPACE_ID::Option& options(int index) const;
+ PROTOBUF_NAMESPACE_ID::Option* add_options();
+ const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Option >&
options() const;
// string name = 1;
void clear_name();
static const int kNameFieldNumber = 1;
- const ::std::string& name() const;
- void set_name(const ::std::string& value);
- #if LANG_CXX11
- void set_name(::std::string&& value);
- #endif
+ const std::string& name() const;
+ void set_name(const std::string& value);
+ void set_name(std::string&& value);
void set_name(const char* value);
void set_name(const char* value, size_t size);
- ::std::string* mutable_name();
- ::std::string* release_name();
- void set_allocated_name(::std::string* name);
+ std::string* mutable_name();
+ std::string* release_name();
+ void set_allocated_name(std::string* name);
// string request_type_url = 2;
void clear_request_type_url();
static const int kRequestTypeUrlFieldNumber = 2;
- const ::std::string& request_type_url() const;
- void set_request_type_url(const ::std::string& value);
- #if LANG_CXX11
- void set_request_type_url(::std::string&& value);
- #endif
+ const std::string& request_type_url() const;
+ void set_request_type_url(const std::string& value);
+ void set_request_type_url(std::string&& value);
void set_request_type_url(const char* value);
void set_request_type_url(const char* value, size_t size);
- ::std::string* mutable_request_type_url();
- ::std::string* release_request_type_url();
- void set_allocated_request_type_url(::std::string* request_type_url);
+ std::string* mutable_request_type_url();
+ std::string* release_request_type_url();
+ void set_allocated_request_type_url(std::string* request_type_url);
// string response_type_url = 4;
void clear_response_type_url();
static const int kResponseTypeUrlFieldNumber = 4;
- const ::std::string& response_type_url() const;
- void set_response_type_url(const ::std::string& value);
- #if LANG_CXX11
- void set_response_type_url(::std::string&& value);
- #endif
+ const std::string& response_type_url() const;
+ void set_response_type_url(const std::string& value);
+ void set_response_type_url(std::string&& value);
void set_response_type_url(const char* value);
void set_response_type_url(const char* value, size_t size);
- ::std::string* mutable_response_type_url();
- ::std::string* release_response_type_url();
- void set_allocated_response_type_url(::std::string* response_type_url);
+ std::string* mutable_response_type_url();
+ std::string* release_response_type_url();
+ void set_allocated_response_type_url(std::string* response_type_url);
// bool request_streaming = 3;
void clear_request_streaming();
@@ -439,44 +422,42 @@ class PROTOBUF_EXPORT Method final :
// .google.protobuf.Syntax syntax = 7;
void clear_syntax();
static const int kSyntaxFieldNumber = 7;
- ::google::protobuf::Syntax syntax() const;
- void set_syntax(::google::protobuf::Syntax value);
+ PROTOBUF_NAMESPACE_ID::Syntax syntax() const;
+ void set_syntax(PROTOBUF_NAMESPACE_ID::Syntax value);
// @@protoc_insertion_point(class_scope:google.protobuf.Method)
private:
class HasBitSetters;
- ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
- ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option > options_;
- ::google::protobuf::internal::ArenaStringPtr name_;
- ::google::protobuf::internal::ArenaStringPtr request_type_url_;
- ::google::protobuf::internal::ArenaStringPtr response_type_url_;
+ ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
+ ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Option > options_;
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr request_type_url_;
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr response_type_url_;
bool request_streaming_;
bool response_streaming_;
int syntax_;
- mutable ::google::protobuf::internal::CachedSize _cached_size_;
+ mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
friend struct ::TableStruct_google_2fprotobuf_2fapi_2eproto;
};
// -------------------------------------------------------------------
class PROTOBUF_EXPORT Mixin final :
- public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Mixin) */ {
+ public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Mixin) */ {
public:
Mixin();
virtual ~Mixin();
Mixin(const Mixin& from);
-
- inline Mixin& operator=(const Mixin& from) {
- CopyFrom(from);
- return *this;
- }
- #if LANG_CXX11
Mixin(Mixin&& from) noexcept
: Mixin() {
*this = ::std::move(from);
}
+ inline Mixin& operator=(const Mixin& from) {
+ CopyFrom(from);
+ return *this;
+ }
inline Mixin& operator=(Mixin&& from) noexcept {
if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
if (this != &from) InternalSwap(&from);
@@ -485,8 +466,8 @@ class PROTOBUF_EXPORT Mixin final :
}
return *this;
}
- #endif
- static const ::google::protobuf::Descriptor* descriptor() {
+
+ static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
return default_instance().GetDescriptor();
}
static const Mixin& default_instance();
@@ -510,11 +491,11 @@ class PROTOBUF_EXPORT Mixin final :
return CreateMaybeMessage(nullptr);
}
- Mixin* New(::google::protobuf::Arena* arena) const final {
+ Mixin* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
return CreateMaybeMessage(arena);
}
- void CopyFrom(const ::google::protobuf::Message& from) final;
- void MergeFrom(const ::google::protobuf::Message& from) final;
+ void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
+ void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void CopyFrom(const Mixin& from);
void MergeFrom(const Mixin& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
@@ -522,15 +503,15 @@ class PROTOBUF_EXPORT Mixin final :
size_t ByteSizeLong() const final;
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
- const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final;
+ const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
#else
bool MergePartialFromCodedStream(
- ::google::protobuf::io::CodedInputStream* input) final;
+ ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final;
#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
void SerializeWithCachedSizes(
- ::google::protobuf::io::CodedOutputStream* output) const final;
- ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
- ::google::protobuf::uint8* target) const final;
+ ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final;
+ ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray(
+ ::PROTOBUF_NAMESPACE_ID::uint8* target) const final;
int GetCachedSize() const final { return _cached_size_.Get(); }
private:
@@ -538,12 +519,12 @@ class PROTOBUF_EXPORT Mixin final :
inline void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Mixin* other);
- friend class ::google::protobuf::internal::AnyMetadata;
- static ::google::protobuf::StringPiece FullMessageName() {
+ friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+ static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "google.protobuf.Mixin";
}
private:
- inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
+ inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const {
return nullptr;
}
inline void* MaybeArenaPtr() const {
@@ -551,7 +532,7 @@ class PROTOBUF_EXPORT Mixin final :
}
public:
- ::google::protobuf::Metadata GetMetadata() const final;
+ ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
// nested types ----------------------------------------------------
@@ -560,39 +541,35 @@ class PROTOBUF_EXPORT Mixin final :
// string name = 1;
void clear_name();
static const int kNameFieldNumber = 1;
- const ::std::string& name() const;
- void set_name(const ::std::string& value);
- #if LANG_CXX11
- void set_name(::std::string&& value);
- #endif
+ const std::string& name() const;
+ void set_name(const std::string& value);
+ void set_name(std::string&& value);
void set_name(const char* value);
void set_name(const char* value, size_t size);
- ::std::string* mutable_name();
- ::std::string* release_name();
- void set_allocated_name(::std::string* name);
+ std::string* mutable_name();
+ std::string* release_name();
+ void set_allocated_name(std::string* name);
// string root = 2;
void clear_root();
static const int kRootFieldNumber = 2;
- const ::std::string& root() const;
- void set_root(const ::std::string& value);
- #if LANG_CXX11
- void set_root(::std::string&& value);
- #endif
+ const std::string& root() const;
+ void set_root(const std::string& value);
+ void set_root(std::string&& value);
void set_root(const char* value);
void set_root(const char* value, size_t size);
- ::std::string* mutable_root();
- ::std::string* release_root();
- void set_allocated_root(::std::string* root);
+ std::string* mutable_root();
+ std::string* release_root();
+ void set_allocated_root(std::string* root);
// @@protoc_insertion_point(class_scope:google.protobuf.Mixin)
private:
class HasBitSetters;
- ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
- ::google::protobuf::internal::ArenaStringPtr name_;
- ::google::protobuf::internal::ArenaStringPtr root_;
- mutable ::google::protobuf::internal::CachedSize _cached_size_;
+ ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr root_;
+ mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
friend struct ::TableStruct_google_2fprotobuf_2fapi_2eproto;
};
// ===================================================================
@@ -608,54 +585,52 @@ class PROTOBUF_EXPORT Mixin final :
// string name = 1;
inline void Api::clear_name() {
- name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
-inline const ::std::string& Api::name() const {
+inline const std::string& Api::name() const {
// @@protoc_insertion_point(field_get:google.protobuf.Api.name)
return name_.GetNoArena();
}
-inline void Api::set_name(const ::std::string& value) {
+inline void Api::set_name(const std::string& value) {
- name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+ name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value);
// @@protoc_insertion_point(field_set:google.protobuf.Api.name)
}
-#if LANG_CXX11
-inline void Api::set_name(::std::string&& value) {
+inline void Api::set_name(std::string&& value) {
name_.SetNoArena(
- &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
+ &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
// @@protoc_insertion_point(field_set_rvalue:google.protobuf.Api.name)
}
-#endif
inline void Api::set_name(const char* value) {
GOOGLE_DCHECK(value != nullptr);
- name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
+ name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
// @@protoc_insertion_point(field_set_char:google.protobuf.Api.name)
}
inline void Api::set_name(const char* value, size_t size) {
- name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
::std::string(reinterpret_cast(value), size));
// @@protoc_insertion_point(field_set_pointer:google.protobuf.Api.name)
}
-inline ::std::string* Api::mutable_name() {
+inline std::string* Api::mutable_name() {
// @@protoc_insertion_point(field_mutable:google.protobuf.Api.name)
- return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ return name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
-inline ::std::string* Api::release_name() {
+inline std::string* Api::release_name() {
// @@protoc_insertion_point(field_release:google.protobuf.Api.name)
- return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ return name_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
-inline void Api::set_allocated_name(::std::string* name) {
+inline void Api::set_allocated_name(std::string* name) {
if (name != nullptr) {
} else {
}
- name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name);
+ name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name);
// @@protoc_insertion_point(field_set_allocated:google.protobuf.Api.name)
}
@@ -666,24 +641,24 @@ inline int Api::methods_size() const {
inline void Api::clear_methods() {
methods_.Clear();
}
-inline ::google::protobuf::Method* Api::mutable_methods(int index) {
+inline PROTOBUF_NAMESPACE_ID::Method* Api::mutable_methods(int index) {
// @@protoc_insertion_point(field_mutable:google.protobuf.Api.methods)
return methods_.Mutable(index);
}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Method >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Method >*
Api::mutable_methods() {
// @@protoc_insertion_point(field_mutable_list:google.protobuf.Api.methods)
return &methods_;
}
-inline const ::google::protobuf::Method& Api::methods(int index) const {
+inline const PROTOBUF_NAMESPACE_ID::Method& Api::methods(int index) const {
// @@protoc_insertion_point(field_get:google.protobuf.Api.methods)
return methods_.Get(index);
}
-inline ::google::protobuf::Method* Api::add_methods() {
+inline PROTOBUF_NAMESPACE_ID::Method* Api::add_methods() {
// @@protoc_insertion_point(field_add:google.protobuf.Api.methods)
return methods_.Add();
}
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Method >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Method >&
Api::methods() const {
// @@protoc_insertion_point(field_list:google.protobuf.Api.methods)
return methods_;
@@ -693,24 +668,24 @@ Api::methods() const {
inline int Api::options_size() const {
return options_.size();
}
-inline ::google::protobuf::Option* Api::mutable_options(int index) {
+inline PROTOBUF_NAMESPACE_ID::Option* Api::mutable_options(int index) {
// @@protoc_insertion_point(field_mutable:google.protobuf.Api.options)
return options_.Mutable(index);
}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Option >*
Api::mutable_options() {
// @@protoc_insertion_point(field_mutable_list:google.protobuf.Api.options)
return &options_;
}
-inline const ::google::protobuf::Option& Api::options(int index) const {
+inline const PROTOBUF_NAMESPACE_ID::Option& Api::options(int index) const {
// @@protoc_insertion_point(field_get:google.protobuf.Api.options)
return options_.Get(index);
}
-inline ::google::protobuf::Option* Api::add_options() {
+inline PROTOBUF_NAMESPACE_ID::Option* Api::add_options() {
// @@protoc_insertion_point(field_add:google.protobuf.Api.options)
return options_.Add();
}
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Option >&
Api::options() const {
// @@protoc_insertion_point(field_list:google.protobuf.Api.options)
return options_;
@@ -718,54 +693,52 @@ Api::options() const {
// string version = 4;
inline void Api::clear_version() {
- version_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ version_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
-inline const ::std::string& Api::version() const {
+inline const std::string& Api::version() const {
// @@protoc_insertion_point(field_get:google.protobuf.Api.version)
return version_.GetNoArena();
}
-inline void Api::set_version(const ::std::string& value) {
+inline void Api::set_version(const std::string& value) {
- version_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+ version_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value);
// @@protoc_insertion_point(field_set:google.protobuf.Api.version)
}
-#if LANG_CXX11
-inline void Api::set_version(::std::string&& value) {
+inline void Api::set_version(std::string&& value) {
version_.SetNoArena(
- &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
+ &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
// @@protoc_insertion_point(field_set_rvalue:google.protobuf.Api.version)
}
-#endif
inline void Api::set_version(const char* value) {
GOOGLE_DCHECK(value != nullptr);
- version_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
+ version_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
// @@protoc_insertion_point(field_set_char:google.protobuf.Api.version)
}
inline void Api::set_version(const char* value, size_t size) {
- version_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ version_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
::std::string(reinterpret_cast(value), size));
// @@protoc_insertion_point(field_set_pointer:google.protobuf.Api.version)
}
-inline ::std::string* Api::mutable_version() {
+inline std::string* Api::mutable_version() {
// @@protoc_insertion_point(field_mutable:google.protobuf.Api.version)
- return version_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ return version_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
-inline ::std::string* Api::release_version() {
+inline std::string* Api::release_version() {
// @@protoc_insertion_point(field_release:google.protobuf.Api.version)
- return version_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ return version_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
-inline void Api::set_allocated_version(::std::string* version) {
+inline void Api::set_allocated_version(std::string* version) {
if (version != nullptr) {
} else {
}
- version_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), version);
+ version_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), version);
// @@protoc_insertion_point(field_set_allocated:google.protobuf.Api.version)
}
@@ -773,37 +746,37 @@ inline void Api::set_allocated_version(::std::string* version) {
inline bool Api::has_source_context() const {
return this != internal_default_instance() && source_context_ != nullptr;
}
-inline const ::google::protobuf::SourceContext& Api::source_context() const {
- const ::google::protobuf::SourceContext* p = source_context_;
+inline const PROTOBUF_NAMESPACE_ID::SourceContext& Api::source_context() const {
+ const PROTOBUF_NAMESPACE_ID::SourceContext* p = source_context_;
// @@protoc_insertion_point(field_get:google.protobuf.Api.source_context)
- return p != nullptr ? *p : *reinterpret_cast(
- &::google::protobuf::_SourceContext_default_instance_);
+ return p != nullptr ? *p : *reinterpret_cast(
+ &PROTOBUF_NAMESPACE_ID::_SourceContext_default_instance_);
}
-inline ::google::protobuf::SourceContext* Api::release_source_context() {
+inline PROTOBUF_NAMESPACE_ID::SourceContext* Api::release_source_context() {
// @@protoc_insertion_point(field_release:google.protobuf.Api.source_context)
- ::google::protobuf::SourceContext* temp = source_context_;
+ PROTOBUF_NAMESPACE_ID::SourceContext* temp = source_context_;
source_context_ = nullptr;
return temp;
}
-inline ::google::protobuf::SourceContext* Api::mutable_source_context() {
+inline PROTOBUF_NAMESPACE_ID::SourceContext* Api::mutable_source_context() {
if (source_context_ == nullptr) {
- auto* p = CreateMaybeMessage<::google::protobuf::SourceContext>(GetArenaNoVirtual());
+ auto* p = CreateMaybeMessage(GetArenaNoVirtual());
source_context_ = p;
}
// @@protoc_insertion_point(field_mutable:google.protobuf.Api.source_context)
return source_context_;
}
-inline void Api::set_allocated_source_context(::google::protobuf::SourceContext* source_context) {
- ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
+inline void Api::set_allocated_source_context(PROTOBUF_NAMESPACE_ID::SourceContext* source_context) {
+ ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == nullptr) {
- delete reinterpret_cast< ::google::protobuf::MessageLite*>(source_context_);
+ delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(source_context_);
}
if (source_context) {
- ::google::protobuf::Arena* submessage_arena = nullptr;
+ ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr;
if (message_arena != submessage_arena) {
- source_context = ::google::protobuf::internal::GetOwnedMessage(
+ source_context = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, source_context, submessage_arena);
}
@@ -821,24 +794,24 @@ inline int Api::mixins_size() const {
inline void Api::clear_mixins() {
mixins_.Clear();
}
-inline ::google::protobuf::Mixin* Api::mutable_mixins(int index) {
+inline PROTOBUF_NAMESPACE_ID::Mixin* Api::mutable_mixins(int index) {
// @@protoc_insertion_point(field_mutable:google.protobuf.Api.mixins)
return mixins_.Mutable(index);
}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Mixin >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Mixin >*
Api::mutable_mixins() {
// @@protoc_insertion_point(field_mutable_list:google.protobuf.Api.mixins)
return &mixins_;
}
-inline const ::google::protobuf::Mixin& Api::mixins(int index) const {
+inline const PROTOBUF_NAMESPACE_ID::Mixin& Api::mixins(int index) const {
// @@protoc_insertion_point(field_get:google.protobuf.Api.mixins)
return mixins_.Get(index);
}
-inline ::google::protobuf::Mixin* Api::add_mixins() {
+inline PROTOBUF_NAMESPACE_ID::Mixin* Api::add_mixins() {
// @@protoc_insertion_point(field_add:google.protobuf.Api.mixins)
return mixins_.Add();
}
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Mixin >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Mixin >&
Api::mixins() const {
// @@protoc_insertion_point(field_list:google.protobuf.Api.mixins)
return mixins_;
@@ -848,11 +821,11 @@ Api::mixins() const {
inline void Api::clear_syntax() {
syntax_ = 0;
}
-inline ::google::protobuf::Syntax Api::syntax() const {
+inline PROTOBUF_NAMESPACE_ID::Syntax Api::syntax() const {
// @@protoc_insertion_point(field_get:google.protobuf.Api.syntax)
- return static_cast< ::google::protobuf::Syntax >(syntax_);
+ return static_cast< PROTOBUF_NAMESPACE_ID::Syntax >(syntax_);
}
-inline void Api::set_syntax(::google::protobuf::Syntax value) {
+inline void Api::set_syntax(PROTOBUF_NAMESPACE_ID::Syntax value) {
syntax_ = value;
// @@protoc_insertion_point(field_set:google.protobuf.Api.syntax)
@@ -864,107 +837,103 @@ inline void Api::set_syntax(::google::protobuf::Syntax value) {
// string name = 1;
inline void Method::clear_name() {
- name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
-inline const ::std::string& Method::name() const {
+inline const std::string& Method::name() const {
// @@protoc_insertion_point(field_get:google.protobuf.Method.name)
return name_.GetNoArena();
}
-inline void Method::set_name(const ::std::string& value) {
+inline void Method::set_name(const std::string& value) {
- name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+ name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value);
// @@protoc_insertion_point(field_set:google.protobuf.Method.name)
}
-#if LANG_CXX11
-inline void Method::set_name(::std::string&& value) {
+inline void Method::set_name(std::string&& value) {
name_.SetNoArena(
- &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
+ &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
// @@protoc_insertion_point(field_set_rvalue:google.protobuf.Method.name)
}
-#endif
inline void Method::set_name(const char* value) {
GOOGLE_DCHECK(value != nullptr);
- name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
+ name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
// @@protoc_insertion_point(field_set_char:google.protobuf.Method.name)
}
inline void Method::set_name(const char* value, size_t size) {
- name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
::std::string(reinterpret_cast(value), size));
// @@protoc_insertion_point(field_set_pointer:google.protobuf.Method.name)
}
-inline ::std::string* Method::mutable_name() {
+inline std::string* Method::mutable_name() {
// @@protoc_insertion_point(field_mutable:google.protobuf.Method.name)
- return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ return name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
-inline ::std::string* Method::release_name() {
+inline std::string* Method::release_name() {
// @@protoc_insertion_point(field_release:google.protobuf.Method.name)
- return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ return name_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
-inline void Method::set_allocated_name(::std::string* name) {
+inline void Method::set_allocated_name(std::string* name) {
if (name != nullptr) {
} else {
}
- name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name);
+ name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name);
// @@protoc_insertion_point(field_set_allocated:google.protobuf.Method.name)
}
// string request_type_url = 2;
inline void Method::clear_request_type_url() {
- request_type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ request_type_url_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
-inline const ::std::string& Method::request_type_url() const {
+inline const std::string& Method::request_type_url() const {
// @@protoc_insertion_point(field_get:google.protobuf.Method.request_type_url)
return request_type_url_.GetNoArena();
}
-inline void Method::set_request_type_url(const ::std::string& value) {
+inline void Method::set_request_type_url(const std::string& value) {
- request_type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+ request_type_url_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value);
// @@protoc_insertion_point(field_set:google.protobuf.Method.request_type_url)
}
-#if LANG_CXX11
-inline void Method::set_request_type_url(::std::string&& value) {
+inline void Method::set_request_type_url(std::string&& value) {
request_type_url_.SetNoArena(
- &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
+ &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
// @@protoc_insertion_point(field_set_rvalue:google.protobuf.Method.request_type_url)
}
-#endif
inline void Method::set_request_type_url(const char* value) {
GOOGLE_DCHECK(value != nullptr);
- request_type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
+ request_type_url_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
// @@protoc_insertion_point(field_set_char:google.protobuf.Method.request_type_url)
}
inline void Method::set_request_type_url(const char* value, size_t size) {
- request_type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ request_type_url_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
::std::string(reinterpret_cast(value), size));
// @@protoc_insertion_point(field_set_pointer:google.protobuf.Method.request_type_url)
}
-inline ::std::string* Method::mutable_request_type_url() {
+inline std::string* Method::mutable_request_type_url() {
// @@protoc_insertion_point(field_mutable:google.protobuf.Method.request_type_url)
- return request_type_url_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ return request_type_url_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
-inline ::std::string* Method::release_request_type_url() {
+inline std::string* Method::release_request_type_url() {
// @@protoc_insertion_point(field_release:google.protobuf.Method.request_type_url)
- return request_type_url_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ return request_type_url_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
-inline void Method::set_allocated_request_type_url(::std::string* request_type_url) {
+inline void Method::set_allocated_request_type_url(std::string* request_type_url) {
if (request_type_url != nullptr) {
} else {
}
- request_type_url_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), request_type_url);
+ request_type_url_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), request_type_url);
// @@protoc_insertion_point(field_set_allocated:google.protobuf.Method.request_type_url)
}
@@ -984,54 +953,52 @@ inline void Method::set_request_streaming(bool value) {
// string response_type_url = 4;
inline void Method::clear_response_type_url() {
- response_type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ response_type_url_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
-inline const ::std::string& Method::response_type_url() const {
+inline const std::string& Method::response_type_url() const {
// @@protoc_insertion_point(field_get:google.protobuf.Method.response_type_url)
return response_type_url_.GetNoArena();
}
-inline void Method::set_response_type_url(const ::std::string& value) {
+inline void Method::set_response_type_url(const std::string& value) {
- response_type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+ response_type_url_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value);
// @@protoc_insertion_point(field_set:google.protobuf.Method.response_type_url)
}
-#if LANG_CXX11
-inline void Method::set_response_type_url(::std::string&& value) {
+inline void Method::set_response_type_url(std::string&& value) {
response_type_url_.SetNoArena(
- &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
+ &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
// @@protoc_insertion_point(field_set_rvalue:google.protobuf.Method.response_type_url)
}
-#endif
inline void Method::set_response_type_url(const char* value) {
GOOGLE_DCHECK(value != nullptr);
- response_type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
+ response_type_url_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
// @@protoc_insertion_point(field_set_char:google.protobuf.Method.response_type_url)
}
inline void Method::set_response_type_url(const char* value, size_t size) {
- response_type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ response_type_url_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
::std::string(reinterpret_cast(value), size));
// @@protoc_insertion_point(field_set_pointer:google.protobuf.Method.response_type_url)
}
-inline ::std::string* Method::mutable_response_type_url() {
+inline std::string* Method::mutable_response_type_url() {
// @@protoc_insertion_point(field_mutable:google.protobuf.Method.response_type_url)
- return response_type_url_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ return response_type_url_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
-inline ::std::string* Method::release_response_type_url() {
+inline std::string* Method::release_response_type_url() {
// @@protoc_insertion_point(field_release:google.protobuf.Method.response_type_url)
- return response_type_url_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ return response_type_url_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
-inline void Method::set_allocated_response_type_url(::std::string* response_type_url) {
+inline void Method::set_allocated_response_type_url(std::string* response_type_url) {
if (response_type_url != nullptr) {
} else {
}
- response_type_url_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), response_type_url);
+ response_type_url_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), response_type_url);
// @@protoc_insertion_point(field_set_allocated:google.protobuf.Method.response_type_url)
}
@@ -1053,24 +1020,24 @@ inline void Method::set_response_streaming(bool value) {
inline int Method::options_size() const {
return options_.size();
}
-inline ::google::protobuf::Option* Method::mutable_options(int index) {
+inline PROTOBUF_NAMESPACE_ID::Option* Method::mutable_options(int index) {
// @@protoc_insertion_point(field_mutable:google.protobuf.Method.options)
return options_.Mutable(index);
}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Option >*
Method::mutable_options() {
// @@protoc_insertion_point(field_mutable_list:google.protobuf.Method.options)
return &options_;
}
-inline const ::google::protobuf::Option& Method::options(int index) const {
+inline const PROTOBUF_NAMESPACE_ID::Option& Method::options(int index) const {
// @@protoc_insertion_point(field_get:google.protobuf.Method.options)
return options_.Get(index);
}
-inline ::google::protobuf::Option* Method::add_options() {
+inline PROTOBUF_NAMESPACE_ID::Option* Method::add_options() {
// @@protoc_insertion_point(field_add:google.protobuf.Method.options)
return options_.Add();
}
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Option >&
Method::options() const {
// @@protoc_insertion_point(field_list:google.protobuf.Method.options)
return options_;
@@ -1080,11 +1047,11 @@ Method::options() const {
inline void Method::clear_syntax() {
syntax_ = 0;
}
-inline ::google::protobuf::Syntax Method::syntax() const {
+inline PROTOBUF_NAMESPACE_ID::Syntax Method::syntax() const {
// @@protoc_insertion_point(field_get:google.protobuf.Method.syntax)
- return static_cast< ::google::protobuf::Syntax >(syntax_);
+ return static_cast< PROTOBUF_NAMESPACE_ID::Syntax >(syntax_);
}
-inline void Method::set_syntax(::google::protobuf::Syntax value) {
+inline void Method::set_syntax(PROTOBUF_NAMESPACE_ID::Syntax value) {
syntax_ = value;
// @@protoc_insertion_point(field_set:google.protobuf.Method.syntax)
@@ -1096,107 +1063,103 @@ inline void Method::set_syntax(::google::protobuf::Syntax value) {
// string name = 1;
inline void Mixin::clear_name() {
- name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
-inline const ::std::string& Mixin::name() const {
+inline const std::string& Mixin::name() const {
// @@protoc_insertion_point(field_get:google.protobuf.Mixin.name)
return name_.GetNoArena();
}
-inline void Mixin::set_name(const ::std::string& value) {
+inline void Mixin::set_name(const std::string& value) {
- name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+ name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value);
// @@protoc_insertion_point(field_set:google.protobuf.Mixin.name)
}
-#if LANG_CXX11
-inline void Mixin::set_name(::std::string&& value) {
+inline void Mixin::set_name(std::string&& value) {
name_.SetNoArena(
- &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
+ &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
// @@protoc_insertion_point(field_set_rvalue:google.protobuf.Mixin.name)
}
-#endif
inline void Mixin::set_name(const char* value) {
GOOGLE_DCHECK(value != nullptr);
- name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
+ name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
// @@protoc_insertion_point(field_set_char:google.protobuf.Mixin.name)
}
inline void Mixin::set_name(const char* value, size_t size) {
- name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
::std::string(reinterpret_cast(value), size));
// @@protoc_insertion_point(field_set_pointer:google.protobuf.Mixin.name)
}
-inline ::std::string* Mixin::mutable_name() {
+inline std::string* Mixin::mutable_name() {
// @@protoc_insertion_point(field_mutable:google.protobuf.Mixin.name)
- return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ return name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
-inline ::std::string* Mixin::release_name() {
+inline std::string* Mixin::release_name() {
// @@protoc_insertion_point(field_release:google.protobuf.Mixin.name)
- return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ return name_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
-inline void Mixin::set_allocated_name(::std::string* name) {
+inline void Mixin::set_allocated_name(std::string* name) {
if (name != nullptr) {
} else {
}
- name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name);
+ name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name);
// @@protoc_insertion_point(field_set_allocated:google.protobuf.Mixin.name)
}
// string root = 2;
inline void Mixin::clear_root() {
- root_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ root_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
-inline const ::std::string& Mixin::root() const {
+inline const std::string& Mixin::root() const {
// @@protoc_insertion_point(field_get:google.protobuf.Mixin.root)
return root_.GetNoArena();
}
-inline void Mixin::set_root(const ::std::string& value) {
+inline void Mixin::set_root(const std::string& value) {
- root_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+ root_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value);
// @@protoc_insertion_point(field_set:google.protobuf.Mixin.root)
}
-#if LANG_CXX11
-inline void Mixin::set_root(::std::string&& value) {
+inline void Mixin::set_root(std::string&& value) {
root_.SetNoArena(
- &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
+ &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
// @@protoc_insertion_point(field_set_rvalue:google.protobuf.Mixin.root)
}
-#endif
inline void Mixin::set_root(const char* value) {
GOOGLE_DCHECK(value != nullptr);
- root_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
+ root_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
// @@protoc_insertion_point(field_set_char:google.protobuf.Mixin.root)
}
inline void Mixin::set_root(const char* value, size_t size) {
- root_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ root_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
::std::string(reinterpret_cast(value), size));
// @@protoc_insertion_point(field_set_pointer:google.protobuf.Mixin.root)
}
-inline ::std::string* Mixin::mutable_root() {
+inline std::string* Mixin::mutable_root() {
// @@protoc_insertion_point(field_mutable:google.protobuf.Mixin.root)
- return root_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ return root_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
-inline ::std::string* Mixin::release_root() {
+inline std::string* Mixin::release_root() {
// @@protoc_insertion_point(field_release:google.protobuf.Mixin.root)
- return root_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ return root_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
-inline void Mixin::set_allocated_root(::std::string* root) {
+inline void Mixin::set_allocated_root(std::string* root) {
if (root != nullptr) {
} else {
}
- root_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), root);
+ root_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), root);
// @@protoc_insertion_point(field_set_allocated:google.protobuf.Mixin.root)
}
@@ -1210,10 +1173,9 @@ inline void Mixin::set_allocated_root(::std::string* root) {
// @@protoc_insertion_point(namespace_scope)
-} // namespace protobuf
-} // namespace google
+PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include
-#endif // PROTOBUF_INCLUDED_google_2fprotobuf_2fapi_2eproto
+#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fapi_2eproto
diff --git a/src/google/protobuf/arena.h b/src/google/protobuf/arena.h
index bd56239ec9..3a9feb5b34 100644
--- a/src/google/protobuf/arena.h
+++ b/src/google/protobuf/arena.h
@@ -35,6 +35,7 @@
#include
#include
+#include
#ifdef max
#undef max // Visual Studio defines this macro
#endif
@@ -244,10 +245,7 @@ struct ArenaOptions {
// well as protobuf container types like RepeatedPtrField and Map. The protocol
// is internal to protobuf and is not guaranteed to be stable. Non-proto types
// should not rely on this protocol.
-//
-// Do NOT subclass Arena. This class will be marked as final when C++11 is
-// enabled.
-class PROTOBUF_EXPORT Arena {
+class PROTOBUF_EXPORT Arena final {
public:
// Arena constructor taking custom options. See ArenaOptions below for
// descriptions of the options available.
@@ -442,7 +440,11 @@ class PROTOBUF_EXPORT Arena {
sizeof(char)>
is_arena_constructable;
- template
+ template ()
+ .GetArena())>::value,
+ int>::type = 0>
static char HasGetArena(decltype(&U::GetArena));
template
static double HasGetArena(...);
@@ -480,6 +482,9 @@ class PROTOBUF_EXPORT Arena {
};
private:
+ template
+ struct has_get_arena : InternalHelper::has_get_arena {};
+
template
PROTOBUF_ALWAYS_INLINE static T* CreateMessageInternal(Arena* arena,
Args&&... args) {
@@ -673,15 +678,15 @@ class PROTOBUF_EXPORT Arena {
}
template ::value &&
- InternalHelper::has_get_arena::value,
+ has_get_arena::value,
int>::type = 0>
PROTOBUF_ALWAYS_INLINE static Arena* GetArenaInternal(const T* value) {
return value->GetArena();
}
- template ::value &&
- !InternalHelper::has_get_arena::value,
- int>::type = 0>
+ template ::value &&
+ !has_get_arena::value,
+ int>::type = 0>
PROTOBUF_ALWAYS_INLINE static Arena* GetArenaInternal(const T* value) {
return nullptr;
}
diff --git a/src/google/protobuf/arena_unittest.cc b/src/google/protobuf/arena_unittest.cc
index 9fdcda5d6b..a682a9c323 100644
--- a/src/google/protobuf/arena_unittest.cc
+++ b/src/google/protobuf/arena_unittest.cc
@@ -59,10 +59,11 @@
using proto2_arena_unittest::ArenaMessage;
-using protobuf_unittest::TestAllTypes;
using protobuf_unittest::TestAllExtensions;
-using protobuf_unittest::TestOneof2;
+using protobuf_unittest::TestAllTypes;
using protobuf_unittest::TestEmptyMessage;
+using protobuf_unittest::TestOneof2;
+using protobuf_unittest_no_arena::TestNoArenaMessage;
namespace google {
namespace protobuf {
@@ -112,14 +113,14 @@ class PleaseDontCopyMe {
// A class that takes four different types as constructor arguments.
class MustBeConstructedWithOneThroughFour {
public:
- MustBeConstructedWithOneThroughFour(
- int one, const char* two, const string& three,
- const PleaseDontCopyMe* four)
+ MustBeConstructedWithOneThroughFour(int one, const char* two,
+ const std::string& three,
+ const PleaseDontCopyMe* four)
: one_(one), two_(two), three_(three), four_(four) {}
int one_;
const char* const two_;
- string three_;
+ std::string three_;
const PleaseDontCopyMe* four_;
private:
@@ -129,21 +130,29 @@ class MustBeConstructedWithOneThroughFour {
// A class that takes eight different types as constructor arguments.
class MustBeConstructedWithOneThroughEight {
public:
- MustBeConstructedWithOneThroughEight(
- int one, const char* two, const string& three,
- const PleaseDontCopyMe* four, int five, const char* six,
- const string& seven, const string& eight)
- : one_(one), two_(two), three_(three), four_(four), five_(five),
- six_(six), seven_(seven), eight_(eight) {}
+ MustBeConstructedWithOneThroughEight(int one, const char* two,
+ const std::string& three,
+ const PleaseDontCopyMe* four, int five,
+ const char* six,
+ const std::string& seven,
+ const std::string& eight)
+ : one_(one),
+ two_(two),
+ three_(three),
+ four_(four),
+ five_(five),
+ six_(six),
+ seven_(seven),
+ eight_(eight) {}
int one_;
const char* const two_;
- string three_;
+ std::string three_;
const PleaseDontCopyMe* four_;
int five_;
const char* const six_;
- string seven_;
- string eight_;
+ std::string seven_;
+ std::string eight_;
private:
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MustBeConstructedWithOneThroughEight);
@@ -152,16 +161,14 @@ class MustBeConstructedWithOneThroughEight {
TEST(ArenaTest, ArenaConstructable) {
EXPECT_TRUE(Arena::is_arena_constructable::type::value);
EXPECT_TRUE(Arena::is_arena_constructable::type::value);
- EXPECT_FALSE(Arena::is_arena_constructable<
- protobuf_unittest_no_arena::TestNoArenaMessage>::type::value);
+ EXPECT_FALSE(Arena::is_arena_constructable::type::value);
EXPECT_FALSE(Arena::is_arena_constructable::type::value);
}
TEST(ArenaTest, DestructorSkippable) {
EXPECT_TRUE(Arena::is_destructor_skippable::type::value);
EXPECT_TRUE(Arena::is_destructor_skippable::type::value);
- EXPECT_FALSE(Arena::is_destructor_skippable<
- protobuf_unittest_no_arena::TestNoArenaMessage>::type::value);
+ EXPECT_FALSE(Arena::is_destructor_skippable::type::value);
EXPECT_FALSE(Arena::is_destructor_skippable::type::value);
}
@@ -171,12 +178,12 @@ TEST(ArenaTest, BasicCreate) {
EXPECT_TRUE(Arena::Create(&arena) != NULL);
EXPECT_TRUE(Arena::Create(&arena) != NULL);
EXPECT_TRUE(Arena::Create(&arena) != NULL);
- EXPECT_TRUE(Arena::Create(&arena) != NULL);
+ EXPECT_TRUE(Arena::Create(&arena) != NULL);
arena.Own(new int32);
arena.Own(new int64);
arena.Own(new float);
arena.Own(new double);
- arena.Own(new string);
+ arena.Own(new std::string);
arena.Own(NULL);
Notifier notifier;
SimpleDataType* data = Arena::Create(&arena);
@@ -190,8 +197,8 @@ TEST(ArenaTest, BasicCreate) {
TEST(ArenaTest, CreateAndConstCopy) {
Arena arena;
- const string s("foo");
- const string* s_copy = Arena::Create(&arena, s);
+ const std::string s("foo");
+ const std::string* s_copy = Arena::Create(&arena, s);
EXPECT_TRUE(s_copy != NULL);
EXPECT_EQ("foo", s);
EXPECT_EQ("foo", *s_copy);
@@ -199,8 +206,8 @@ TEST(ArenaTest, CreateAndConstCopy) {
TEST(ArenaTest, CreateAndNonConstCopy) {
Arena arena;
- string s("foo");
- const string* s_copy = Arena::Create(&arena, s);
+ std::string s("foo");
+ const std::string* s_copy = Arena::Create(&arena, s);
EXPECT_TRUE(s_copy != NULL);
EXPECT_EQ("foo", s);
EXPECT_EQ("foo", *s_copy);
@@ -208,8 +215,8 @@ TEST(ArenaTest, CreateAndNonConstCopy) {
TEST(ArenaTest, CreateAndMove) {
Arena arena;
- string s("foo");
- const string* s_move = Arena::Create(&arena, std::move(s));
+ std::string s("foo");
+ const std::string* s_move = Arena::Create(&arena, std::move(s));
EXPECT_TRUE(s_move != NULL);
EXPECT_TRUE(s.empty()); // NOLINT
EXPECT_EQ("foo", *s_move);
@@ -217,7 +224,7 @@ TEST(ArenaTest, CreateAndMove) {
TEST(ArenaTest, CreateWithFourConstructorArguments) {
Arena arena;
- const string three("3");
+ const std::string three("3");
const PleaseDontCopyMe four(4);
const MustBeConstructedWithOneThroughFour* new_object =
Arena::Create(
@@ -231,10 +238,10 @@ TEST(ArenaTest, CreateWithFourConstructorArguments) {
TEST(ArenaTest, CreateWithEightConstructorArguments) {
Arena arena;
- const string three("3");
+ const std::string three("3");
const PleaseDontCopyMe four(4);
- const string seven("7");
- const string eight("8");
+ const std::string seven("7");
+ const std::string eight("8");
const MustBeConstructedWithOneThroughEight* new_object =
Arena::Create(
&arena, 1, "2", three, &four, 5, "6", seven, eight);
@@ -251,14 +258,14 @@ TEST(ArenaTest, CreateWithEightConstructorArguments) {
class PleaseMoveMe {
public:
- explicit PleaseMoveMe(const string& value) : value_(value) {}
+ explicit PleaseMoveMe(const std::string& value) : value_(value) {}
PleaseMoveMe(PleaseMoveMe&&) = default;
PleaseMoveMe(const PleaseMoveMe&) = delete;
- const string& value() const { return value_; }
+ const std::string& value() const { return value_; }
private:
- string value_;
+ std::string value_;
};
TEST(ArenaTest, CreateWithMoveArguments) {
@@ -411,7 +418,7 @@ TEST(ArenaTest, ReflectionSwapFields) {
reflection->SwapFields(arena1_message, arena2_message, fields);
EXPECT_EQ(&arena1, arena1_message->GetArena());
EXPECT_EQ(&arena2, arena2_message->GetArena());
- string output;
+ std::string output;
arena1_message->SerializeToString(&output);
EXPECT_EQ(0, output.size());
TestUtil::ExpectAllFieldsSet(*arena2_message);
@@ -461,7 +468,7 @@ TEST(ArenaTest, SetAllocatedMessage) {
arena_message->set_allocated_optional_nested_message(nested);
EXPECT_EQ(118, arena_message->optional_nested_message().bb());
- protobuf_unittest_no_arena::TestNoArenaMessage no_arena_message;
+ TestNoArenaMessage no_arena_message;
EXPECT_FALSE(no_arena_message.has_arena_message());
no_arena_message.set_allocated_arena_message(NULL);
EXPECT_FALSE(no_arena_message.has_arena_message());
@@ -485,7 +492,7 @@ TEST(ArenaTest, ReleaseMessage) {
TEST(ArenaTest, SetAllocatedString) {
Arena arena;
TestAllTypes* arena_message = Arena::CreateMessage(&arena);
- string* allocated_str = new string("hello");
+ std::string* allocated_str = new std::string("hello");
arena_message->set_allocated_optional_string(allocated_str);
EXPECT_EQ("hello", arena_message->optional_string());
}
@@ -494,7 +501,7 @@ TEST(ArenaTest, ReleaseString) {
Arena arena;
TestAllTypes* arena_message = Arena::CreateMessage(&arena);
arena_message->set_optional_string("hello");
- std::unique_ptr released_str(
+ std::unique_ptr released_str(
arena_message->release_optional_string());
EXPECT_EQ("hello", *released_str);
@@ -510,7 +517,7 @@ TEST(ArenaTest, SwapBetweenArenasWithAllFieldsSet) {
TestAllTypes* arena2_message = Arena::CreateMessage(&arena2);
TestUtil::SetAllFields(arena2_message);
arena2_message->Swap(arena1_message);
- string output;
+ std::string output;
arena2_message->SerializeToString(&output);
EXPECT_EQ(0, output.size());
}
@@ -548,7 +555,7 @@ TEST(ArenaTest, SwapBetweenArenasUsingReflection) {
TestUtil::SetAllFields(arena2_message);
const Reflection* r = arena2_message->GetReflection();
r->Swap(arena1_message, arena2_message);
- string output;
+ std::string output;
arena2_message->SerializeToString(&output);
EXPECT_EQ(0, output.size());
}
@@ -571,7 +578,7 @@ TEST(ArenaTest, SwapBetweenArenaAndNonArenaUsingReflection) {
TEST(ArenaTest, ReleaseFromArenaMessageMakesCopy) {
TestAllTypes::NestedMessage* nested_msg = NULL;
- string* nested_string = NULL;
+ std::string* nested_string = NULL;
{
Arena arena;
TestAllTypes* arena_message = Arena::CreateMessage(&arena);
@@ -763,7 +770,7 @@ TEST(ArenaTest, AddAllocatedToRepeatedField) {
// Heap-arena case for strings (which are not arena-allocated).
arena1_message->Clear();
for (int i = 0; i < 10; i++) {
- string* s = new string("Test");
+ std::string* s = new std::string("Test");
arena1_message->mutable_repeated_string()->
AddAllocated(s);
// Should not copy.
@@ -862,19 +869,21 @@ TEST(ArenaTest, ReleaseLastRepeatedField) {
// no delete -- |released| is on the arena.
}
- // Test string case as well. ReleaseLast() in this case must copy the string,
- // even though it was originally heap-allocated and its pointer was simply
- // appended to the repeated field's internal vector, because the string was
- // placed on the arena's destructor list and cannot be removed from that list
- // (so the arena permanently owns the original instance).
+ // Test string case as well. ReleaseLast() in this case must copy the
+ // string, even though it was originally heap-allocated and its pointer
+ // was simply appended to the repeated field's internal vector, because the
+ // string was placed on the arena's destructor list and cannot be removed
+ // from that list (so the arena permanently owns the original instance).
arena_message->Clear();
for (int i = 0; i < 10; i++) {
- string* s = new string("Test");
+ std::string* s = new std::string("Test");
arena_message->mutable_repeated_string()->AddAllocated(s);
}
for (int i = 0; i < 10; i++) {
- const string* orig_element = &arena_message->repeated_string(10 - 1 - i);
- string* released = arena_message->mutable_repeated_string()->ReleaseLast();
+ const std::string* orig_element =
+ &arena_message->repeated_string(10 - 1 - i);
+ std::string* released =
+ arena_message->mutable_repeated_string()->ReleaseLast();
EXPECT_NE(released, orig_element);
EXPECT_EQ("Test", *released);
delete released;
@@ -889,7 +898,7 @@ TEST(ArenaTest, UnsafeArenaReleaseAdd) {
Arena arena;
TestAllTypes* message1 = Arena::CreateMessage(&arena);
TestAllTypes* message2 = Arena::CreateMessage(&arena);
- string* arena_string = Arena::Create(&arena);
+ std::string* arena_string = Arena::Create(&arena);
*arena_string = kContent;
message1->unsafe_arena_set_allocated_optional_string(arena_string);
@@ -902,7 +911,7 @@ TEST(ArenaTest, UnsafeArenaAddAllocated) {
Arena arena;
TestAllTypes* message = Arena::CreateMessage(&arena);
for (int i = 0; i < 10; i++) {
- string* arena_string = Arena::Create(&arena);
+ std::string* arena_string = Arena::Create(&arena);
message->mutable_repeated_string()->UnsafeArenaAddAllocated(arena_string);
EXPECT_EQ(arena_string, message->mutable_repeated_string(i));
}
@@ -912,7 +921,7 @@ TEST(ArenaTest, UnsafeArenaRelease) {
Arena arena;
TestAllTypes* message = Arena::CreateMessage(&arena);
- string* s = new string("test string");
+ std::string* s = new std::string("test string");
message->unsafe_arena_set_allocated_optional_string(s);
EXPECT_TRUE(message->has_optional_string());
EXPECT_EQ("test string", message->optional_string());
@@ -920,7 +929,7 @@ TEST(ArenaTest, UnsafeArenaRelease) {
EXPECT_FALSE(message->has_optional_string());
delete s;
- s = new string("test string");
+ s = new std::string("test string");
message->unsafe_arena_set_allocated_oneof_string(s);
EXPECT_TRUE(message->has_oneof_string());
EXPECT_EQ("test string", message->oneof_string());
@@ -934,9 +943,9 @@ TEST(ArenaTest, OneofMerge) {
TestAllTypes* message0 = Arena::CreateMessage(&arena);
TestAllTypes* message1 = Arena::CreateMessage(&arena);
- message0->unsafe_arena_set_allocated_oneof_string(new string("x"));
+ message0->unsafe_arena_set_allocated_oneof_string(new std::string("x"));
ASSERT_TRUE(message0->has_oneof_string());
- message1->unsafe_arena_set_allocated_oneof_string(new string("y"));
+ message1->unsafe_arena_set_allocated_oneof_string(new std::string("y"));
ASSERT_TRUE(message1->has_oneof_string());
EXPECT_EQ("x", message0->oneof_string());
EXPECT_EQ("y", message1->oneof_string());
@@ -1005,8 +1014,8 @@ void TestSwapRepeatedField(Arena* arena1, Arena* arena2) {
field1.Swap(&field2);
EXPECT_EQ(5, field1.size());
EXPECT_EQ(10, field2.size());
- EXPECT_TRUE(string("field1") == field2.Get(0).optional_string());
- EXPECT_TRUE(string("field2") == field1.Get(0).optional_string());
+ EXPECT_TRUE(std::string("field1") == field2.Get(0).optional_string());
+ EXPECT_TRUE(std::string("field2") == field1.Get(0).optional_string());
// Ensure that fields retained their original order:
for (int i = 0; i < field1.size(); i++) {
EXPECT_EQ(i, field1.Get(i).optional_int32());
@@ -1044,8 +1053,8 @@ TEST(ArenaTest, ExtensionsOnArena) {
Arena::CreateMessage(&arena);
message_ext->SetExtension(
protobuf_unittest::optional_int32_extension, 42);
- message_ext->SetExtension(
- protobuf_unittest::optional_string_extension, string("test"));
+ message_ext->SetExtension(protobuf_unittest::optional_string_extension,
+ std::string("test"));
message_ext->MutableExtension(
protobuf_unittest::optional_nested_message_extension)->set_bb(42);
}
@@ -1157,7 +1166,7 @@ TEST(ArenaTest, MutableMessageReflection) {
void FillArenaAwareFields(TestAllTypes* message) {
- string test_string = "hello world";
+ std::string test_string = "hello world";
message->set_optional_int32(42);
message->set_optional_string(test_string);
message->set_optional_bytes(test_string);
@@ -1213,7 +1222,7 @@ TEST(ArenaTest, MessageLiteOnArena) {
TestAllTypes initial_message;
FillArenaAwareFields(&initial_message);
- string serialized;
+ std::string serialized;
initial_message.SerializeToString(&serialized);
{
@@ -1236,14 +1245,14 @@ TEST(ArenaTest, MessageLiteOnArena) {
// (even if this was not its original intent).
TEST(ArenaTest, RepeatedFieldWithNonPODType) {
{
- RepeatedField field_on_heap;
+ RepeatedField field_on_heap;
for (int i = 0; i < 100; i++) {
*field_on_heap.Add() = "test string long enough to exceed inline buffer";
}
}
{
Arena arena;
- RepeatedField field_on_arena(&arena);
+ RepeatedField field_on_arena(&arena);
for (int i = 0; i < 100; i++) {
*field_on_arena.Add() = "test string long enough to exceed inline buffer";
}
@@ -1339,6 +1348,33 @@ TEST(ArenaTest, GetArenaShouldReturnNullForNonArenaAllocatedMessages) {
EXPECT_EQ(NULL, Arena::GetArena(const_pointer_to_message));
}
+TEST(ArenaTest, GetArenaShouldReturnNullForNonArenaCompatibleTypes) {
+ TestNoArenaMessage message;
+ const TestNoArenaMessage* const_pointer_to_message = &message;
+ EXPECT_EQ(nullptr, Arena::GetArena(&message));
+ EXPECT_EQ(nullptr, Arena::GetArena(const_pointer_to_message));
+
+ // Test that GetArena returns nullptr for types that have a GetArena method
+ // that doesn't return Arena*.
+ struct {
+ int GetArena() const { return 0; }
+ } has_get_arena_method_wrong_return_type;
+ EXPECT_EQ(nullptr, Arena::GetArena(&has_get_arena_method_wrong_return_type));
+
+ // Test that GetArena returns nullptr for types that have a GetArena alias.
+ struct {
+ using GetArena = Arena*;
+ } has_get_arena_alias;
+ EXPECT_EQ(nullptr, Arena::GetArena(&has_get_arena_alias));
+
+ // Test that GetArena returns nullptr for types that have a GetArena data
+ // member.
+ struct {
+ Arena GetArena;
+ } has_get_arena_data_member;
+ EXPECT_EQ(nullptr, Arena::GetArena(&has_get_arena_data_member));
+}
+
TEST(ArenaTest, AddCleanup) {
Arena arena;
for (int i = 0; i < 100; i++) {
@@ -1351,7 +1387,7 @@ TEST(ArenaTest, UnsafeSetAllocatedOnArena) {
TestAllTypes* message = Arena::CreateMessage(&arena);
EXPECT_FALSE(message->has_optional_string());
- string owned_string = "test with long enough content to heap-allocate";
+ std::string owned_string = "test with long enough content to heap-allocate";
message->unsafe_arena_set_allocated_optional_string(&owned_string);
EXPECT_TRUE(message->has_optional_string());
diff --git a/src/google/protobuf/arenastring.h b/src/google/protobuf/arenastring.h
index 9234ee00f0..f4ff07dca1 100644
--- a/src/google/protobuf/arenastring.h
+++ b/src/google/protobuf/arenastring.h
@@ -67,7 +67,7 @@ class TaggedPtr {
struct PROTOBUF_EXPORT ArenaStringPtr {
inline void Set(const ::std::string* default_value,
- const ::std::string& value, ::google::protobuf::Arena* arena) {
+ const ::std::string& value, Arena* arena) {
if (ptr_ == default_value) {
CreateInstance(arena, &value);
} else {
@@ -76,8 +76,7 @@ struct PROTOBUF_EXPORT ArenaStringPtr {
}
inline void SetLite(const ::std::string* default_value,
- const ::std::string& value,
- ::google::protobuf::Arena* arena) {
+ const ::std::string& value, Arena* arena) {
Set(default_value, value, arena);
}
@@ -85,7 +84,7 @@ struct PROTOBUF_EXPORT ArenaStringPtr {
inline const ::std::string& Get() const { return *ptr_; }
inline ::std::string* Mutable(const ::std::string* default_value,
- ::google::protobuf::Arena* arena) {
+ Arena* arena) {
if (ptr_ == default_value) {
CreateInstance(arena, default_value);
}
@@ -97,7 +96,7 @@ struct PROTOBUF_EXPORT ArenaStringPtr {
// retains ownership. Clears this field back to NULL state. Used to implement
// release_() methods on generated classes.
inline ::std::string* Release(const ::std::string* default_value,
- ::google::protobuf::Arena* arena) {
+ Arena* arena) {
if (ptr_ == default_value) {
return NULL;
}
@@ -105,8 +104,8 @@ struct PROTOBUF_EXPORT ArenaStringPtr {
}
// Similar to Release, but ptr_ cannot be the default_value.
- inline ::std::string* ReleaseNonDefault(
- const ::std::string* default_value, ::google::protobuf::Arena* arena) {
+ inline ::std::string* ReleaseNonDefault(const ::std::string* default_value,
+ Arena* arena) {
GOOGLE_DCHECK(!IsDefault(default_value));
::std::string* released = NULL;
if (arena != NULL) {
@@ -126,7 +125,7 @@ struct PROTOBUF_EXPORT ArenaStringPtr {
// state. Used to implement unsafe_arena_release_() methods on
// generated classes.
inline ::std::string* UnsafeArenaRelease(const ::std::string* default_value,
- ::google::protobuf::Arena* /* arena */) {
+ Arena* /* arena */) {
if (ptr_ == default_value) {
return NULL;
}
@@ -139,7 +138,7 @@ struct PROTOBUF_EXPORT ArenaStringPtr {
// destructor is registered with the arena. Used to implement
// set_allocated_ in generated classes.
inline void SetAllocated(const ::std::string* default_value,
- ::std::string* value, ::google::protobuf::Arena* arena) {
+ ::std::string* value, Arena* arena) {
if (arena == NULL && ptr_ != default_value) {
Destroy(default_value, arena);
}
@@ -159,7 +158,7 @@ struct PROTOBUF_EXPORT ArenaStringPtr {
// to implement unsafe_arena_set_allocated_ in generated classes.
inline void UnsafeArenaSetAllocated(const ::std::string* default_value,
::std::string* value,
- ::google::protobuf::Arena* /* arena */) {
+ Arena* /* arena */) {
if (value != NULL) {
ptr_ = value;
} else {
@@ -201,8 +200,7 @@ struct PROTOBUF_EXPORT ArenaStringPtr {
}
// Frees storage (if not on an arena).
- inline void Destroy(const ::std::string* default_value,
- ::google::protobuf::Arena* arena) {
+ inline void Destroy(const ::std::string* default_value, Arena* arena) {
if (arena == NULL && ptr_ != default_value) {
delete ptr_;
}
@@ -213,7 +211,7 @@ struct PROTOBUF_EXPORT ArenaStringPtr {
// the user) will always be the empty string. Assumes that |default_value|
// is an empty string.
inline void ClearToEmpty(const ::std::string* default_value,
- ::google::protobuf::Arena* /* arena */) {
+ Arena* /* arena */) {
if (ptr_ == default_value) {
// Already set to default (which is empty) -- do nothing.
} else {
@@ -234,7 +232,7 @@ struct PROTOBUF_EXPORT ArenaStringPtr {
// overhead of heap operations. After this returns, the content (as seen by
// the user) will always be equal to |default_value|.
inline void ClearToDefault(const ::std::string* default_value,
- ::google::protobuf::Arena* /* arena */) {
+ Arena* /* arena */) {
if (ptr_ == default_value) {
// Already set to default -- do nothing.
} else {
@@ -370,8 +368,7 @@ struct PROTOBUF_EXPORT ArenaStringPtr {
::std::string* ptr_;
PROTOBUF_NOINLINE
- void CreateInstance(::google::protobuf::Arena* arena,
- const ::std::string* initial_value) {
+ void CreateInstance(Arena* arena, const ::std::string* initial_value) {
GOOGLE_DCHECK(initial_value != NULL);
// uses "new ::std::string" when arena is nullptr
ptr_ = Arena::Create< ::std::string >(arena, *initial_value);
diff --git a/src/google/protobuf/arenastring_unittest.cc b/src/google/protobuf/arenastring_unittest.cc
index c5f89a7007..edb6f6cd61 100644
--- a/src/google/protobuf/arenastring_unittest.cc
+++ b/src/google/protobuf/arenastring_unittest.cc
@@ -52,85 +52,83 @@ namespace protobuf {
using internal::ArenaStringPtr;
-static string WrapString(const char* value) {
- return value;
-}
+static std::string WrapString(const char* value) { return value; }
// Test ArenaStringPtr with arena == NULL.
TEST(ArenaStringPtrTest, ArenaStringPtrOnHeap) {
ArenaStringPtr field;
- ::std::string default_value = "default";
+ std::string default_value = "default";
field.UnsafeSetDefault(&default_value);
- EXPECT_EQ(string("default"), field.Get());
+ EXPECT_EQ(std::string("default"), field.Get());
field.Set(&default_value, WrapString("Test short"), NULL);
- EXPECT_EQ(string("Test short"), field.Get());
+ EXPECT_EQ(std::string("Test short"), field.Get());
field.Set(&default_value, WrapString("Test long long long long value"), NULL);
- EXPECT_EQ(string("Test long long long long value"), field.Get());
- field.Set(&default_value, string(""), NULL);
+ EXPECT_EQ(std::string("Test long long long long value"), field.Get());
+ field.Set(&default_value, std::string(""), NULL);
field.Destroy(&default_value, NULL);
ArenaStringPtr field2;
field2.UnsafeSetDefault(&default_value);
- ::std::string* mut = field2.Mutable(&default_value, NULL);
+ std::string* mut = field2.Mutable(&default_value, NULL);
EXPECT_EQ(mut, field2.Mutable(&default_value, NULL));
EXPECT_EQ(mut, &field2.Get());
EXPECT_NE(&default_value, mut);
- EXPECT_EQ(string("default"), *mut);
+ EXPECT_EQ(std::string("default"), *mut);
*mut = "Test long long long long value"; // ensure string allocates storage
- EXPECT_EQ(string("Test long long long long value"), field2.Get());
+ EXPECT_EQ(std::string("Test long long long long value"), field2.Get());
field2.Destroy(&default_value, NULL);
}
TEST(ArenaStringPtrTest, ArenaStringPtrOnArena) {
Arena arena;
ArenaStringPtr field;
- ::std::string default_value = "default";
+ std::string default_value = "default";
field.UnsafeSetDefault(&default_value);
- EXPECT_EQ(string("default"), field.Get());
+ EXPECT_EQ(std::string("default"), field.Get());
field.Set(&default_value, WrapString("Test short"), &arena);
- EXPECT_EQ(string("Test short"), field.Get());
+ EXPECT_EQ(std::string("Test short"), field.Get());
field.Set(&default_value, WrapString("Test long long long long value"),
&arena);
- EXPECT_EQ(string("Test long long long long value"), field.Get());
- field.Set(&default_value, string(""), &arena);
+ EXPECT_EQ(std::string("Test long long long long value"), field.Get());
+ field.Set(&default_value, std::string(""), &arena);
field.Destroy(&default_value, &arena);
ArenaStringPtr field2;
field2.UnsafeSetDefault(&default_value);
- ::std::string* mut = field2.Mutable(&default_value, &arena);
+ std::string* mut = field2.Mutable(&default_value, &arena);
EXPECT_EQ(mut, field2.Mutable(&default_value, &arena));
EXPECT_EQ(mut, &field2.Get());
EXPECT_NE(&default_value, mut);
- EXPECT_EQ(string("default"), *mut);
+ EXPECT_EQ(std::string("default"), *mut);
*mut = "Test long long long long value"; // ensure string allocates storage
- EXPECT_EQ(string("Test long long long long value"), field2.Get());
+ EXPECT_EQ(std::string("Test long long long long value"), field2.Get());
field2.Destroy(&default_value, &arena);
}
TEST(ArenaStringPtrTest, ArenaStringPtrOnArenaNoSSO) {
Arena arena;
ArenaStringPtr field;
- ::std::string default_value = "default";
+ std::string default_value = "default";
field.UnsafeSetDefault(&default_value);
- EXPECT_EQ(string("default"), field.Get());
+ EXPECT_EQ(std::string("default"), field.Get());
// Avoid triggering the SSO optimization by setting the string to something
// larger than the internal buffer.
field.Set(&default_value, WrapString("Test long long long long value"),
&arena);
- EXPECT_EQ(string("Test long long long long value"), field.Get());
- field.Set(&default_value, string(""), &arena);
+ EXPECT_EQ(std::string("Test long long long long value"), field.Get());
+ field.Set(&default_value, std::string(""), &arena);
field.Destroy(&default_value, &arena);
ArenaStringPtr field2;
field2.UnsafeSetDefault(&default_value);
- ::std::string* mut = field2.Mutable(&default_value, &arena);
+ std::string* mut = field2.Mutable(&default_value, &arena);
EXPECT_EQ(mut, field2.Mutable(&default_value, &arena));
EXPECT_EQ(mut, &field2.Get());
EXPECT_NE(&default_value, mut);
- EXPECT_EQ(string("default"), *mut);
+ EXPECT_EQ(std::string("default"), *mut);
*mut = "Test long long long long value"; // ensure string allocates storage
- EXPECT_EQ(string("Test long long long long value"), field2.Get());
+ EXPECT_EQ(std::string("Test long long long long value"), field2.Get());
field2.Destroy(&default_value, &arena);
}
diff --git a/src/google/protobuf/compiler/annotation_test_util.cc b/src/google/protobuf/compiler/annotation_test_util.cc
index a0530b9a69..d33f29fb94 100644
--- a/src/google/protobuf/compiler/annotation_test_util.cc
+++ b/src/google/protobuf/compiler/annotation_test_util.cc
@@ -57,8 +57,9 @@ class DescriptorCapturingGenerator : public CodeGenerator {
explicit DescriptorCapturingGenerator(FileDescriptorProto* file)
: file_(file) {}
- virtual bool Generate(const FileDescriptor* file, const string& parameter,
- GeneratorContext* context, string* error) const {
+ virtual bool Generate(const FileDescriptor* file,
+ const std::string& parameter, GeneratorContext* context,
+ std::string* error) const {
file->CopyTo(file_);
return true;
}
@@ -68,21 +69,21 @@ class DescriptorCapturingGenerator : public CodeGenerator {
};
} // namespace
-void AddFile(const string& filename, const string& data) {
+void AddFile(const std::string& filename, const std::string& data) {
GOOGLE_CHECK_OK(File::SetContents(TestTempDir() + "/" + filename, data,
true));
}
-bool RunProtoCompiler(const string& filename,
- const string& plugin_specific_args,
+bool RunProtoCompiler(const std::string& filename,
+ const std::string& plugin_specific_args,
CommandLineInterface* cli, FileDescriptorProto* file) {
cli->SetInputsAreProtoPathRelative(true);
DescriptorCapturingGenerator capturing_generator(file);
cli->RegisterGenerator("--capture_out", &capturing_generator, "");
- string proto_path = "-I" + TestTempDir();
- string capture_out = "--capture_out=" + TestTempDir();
+ std::string proto_path = "-I" + TestTempDir();
+ std::string capture_out = "--capture_out=" + TestTempDir();
const char* argv[] = {"protoc", proto_path.c_str(),
plugin_specific_args.c_str(), capture_out.c_str(),
@@ -91,15 +92,15 @@ bool RunProtoCompiler(const string& filename,
return cli->Run(5, argv) == 0;
}
-bool DecodeMetadata(const string& path, GeneratedCodeInfo* info) {
- string data;
+bool DecodeMetadata(const std::string& path, GeneratedCodeInfo* info) {
+ std::string data;
GOOGLE_CHECK_OK(File::GetContents(path, &data, true));
io::ArrayInputStream input(data.data(), data.size());
return info->ParseFromZeroCopyStream(&input);
}
void FindAnnotationsOnPath(
- const GeneratedCodeInfo& info, const string& source_file,
+ const GeneratedCodeInfo& info, const std::string& source_file,
const std::vector& path,
std::vector* annotations) {
for (int i = 0; i < info.annotation_size(); ++i) {
@@ -121,7 +122,7 @@ void FindAnnotationsOnPath(
}
const GeneratedCodeInfo::Annotation* FindAnnotationOnPath(
- const GeneratedCodeInfo& info, const string& source_file,
+ const GeneratedCodeInfo& info, const std::string& source_file,
const std::vector& path) {
std::vector annotations;
FindAnnotationsOnPath(info, source_file, path, &annotations);
@@ -132,9 +133,9 @@ const GeneratedCodeInfo::Annotation* FindAnnotationOnPath(
}
bool AtLeastOneAnnotationMatchesSubstring(
- const string& file_content,
+ const std::string& file_content,
const std::vector& annotations,
- const string& expected_text) {
+ const std::string& expected_text) {
for (std::vector::const_iterator
i = annotations.begin(),
e = annotations.end();
@@ -152,9 +153,9 @@ bool AtLeastOneAnnotationMatchesSubstring(
return false;
}
-bool AnnotationMatchesSubstring(const string& file_content,
+bool AnnotationMatchesSubstring(const std::string& file_content,
const GeneratedCodeInfo::Annotation* annotation,
- const string& expected_text) {
+ const std::string& expected_text) {
std::vector annotations;
annotations.push_back(annotation);
return AtLeastOneAnnotationMatchesSubstring(file_content, annotations,
diff --git a/src/google/protobuf/compiler/annotation_test_util.h b/src/google/protobuf/compiler/annotation_test_util.h
index fbd3dec5f3..7c1319182e 100644
--- a/src/google/protobuf/compiler/annotation_test_util.h
+++ b/src/google/protobuf/compiler/annotation_test_util.h
@@ -52,7 +52,8 @@ struct ExpectedOutput {
std::string file_path;
std::string file_content;
GeneratedCodeInfo file_info;
- explicit ExpectedOutput(const std::string& file_path) : file_path(file_path) {}
+ explicit ExpectedOutput(const std::string& file_path)
+ : file_path(file_path) {}
};
// Creates a file with name `filename` and content `data` in temp test
diff --git a/src/google/protobuf/compiler/code_generator.cc b/src/google/protobuf/compiler/code_generator.cc
index aaabd9142d..3319d5c503 100644
--- a/src/google/protobuf/compiler/code_generator.cc
+++ b/src/google/protobuf/compiler/code_generator.cc
@@ -46,11 +46,10 @@ namespace compiler {
CodeGenerator::~CodeGenerator() {}
-bool CodeGenerator::GenerateAll(
- const std::vector& files,
- const string& parameter,
- GeneratorContext* generator_context,
- string* error) const {
+bool CodeGenerator::GenerateAll(const std::vector& files,
+ const std::string& parameter,
+ GeneratorContext* generator_context,
+ std::string* error) const {
// Default implemenation is just to call the per file method, and prefix any
// error string with the file to provide context.
bool succeeded = true;
@@ -74,13 +73,13 @@ bool CodeGenerator::GenerateAll(
GeneratorContext::~GeneratorContext() {}
-io::ZeroCopyOutputStream*
-GeneratorContext::OpenForAppend(const string& filename) {
+io::ZeroCopyOutputStream* GeneratorContext::OpenForAppend(
+ const std::string& filename) {
return NULL;
}
io::ZeroCopyOutputStream* GeneratorContext::OpenForInsert(
- const string& filename, const string& insertion_point) {
+ const std::string& filename, const std::string& insertion_point) {
GOOGLE_LOG(FATAL) << "This GeneratorContext does not support insertion.";
return NULL; // make compiler happy
}
@@ -98,14 +97,15 @@ void GeneratorContext::GetCompilerVersion(Version* version) const {
}
// Parses a set of comma-delimited name/value pairs.
-void ParseGeneratorParameter(const string& text,
- std::vector >* output) {
- std::vector parts = Split(text, ",", true);
+void ParseGeneratorParameter(
+ const std::string& text,
+ std::vector >* output) {
+ std::vector parts = Split(text, ",", true);
for (int i = 0; i < parts.size(); i++) {
- string::size_type equals_pos = parts[i].find_first_of('=');
- std::pair value;
- if (equals_pos == string::npos) {
+ std::string::size_type equals_pos = parts[i].find_first_of('=');
+ std::pair value;
+ if (equals_pos == std::string::npos) {
value.first = parts[i];
value.second = "";
} else {
diff --git a/src/google/protobuf/compiler/command_line_interface.cc b/src/google/protobuf/compiler/command_line_interface.cc
index 6bae201437..126c433b64 100644
--- a/src/google/protobuf/compiler/command_line_interface.cc
+++ b/src/google/protobuf/compiler/command_line_interface.cc
@@ -116,7 +116,7 @@ static const char* kDefaultDirectDependenciesViolationMsg =
// Returns true if the text looks like a Windows-style absolute path, starting
// with a drive letter. Example: "C:\foo". TODO(kenton): Share this with
// copy in importer.cc?
-static bool IsWindowsAbsolutePath(const string& text) {
+static bool IsWindowsAbsolutePath(const std::string& text) {
#if defined(_WIN32) || defined(__CYGWIN__)
return text.size() >= 3 && text[1] == ':' &&
isalpha(text[0]) &&
@@ -147,13 +147,13 @@ void SetFdToBinaryMode(int fd) {
// (Text and binary are the same on non-Windows platforms.)
}
-void AddTrailingSlash(string* path) {
+void AddTrailingSlash(std::string* path) {
if (!path->empty() && path->at(path->size() - 1) != '/') {
path->push_back('/');
}
}
-bool VerifyDirectoryExists(const string& path) {
+bool VerifyDirectoryExists(const std::string& path) {
if (path.empty()) return true;
if (access(path.c_str(), F_OK) == -1) {
@@ -168,12 +168,13 @@ bool VerifyDirectoryExists(const string& path) {
// parent if necessary, and so on. The full file name is actually
// (prefix + filename), but we assume |prefix| already exists and only create
// directories listed in |filename|.
-bool TryCreateParentDirectory(const string& prefix, const string& filename) {
+bool TryCreateParentDirectory(const std::string& prefix,
+ const std::string& filename) {
// Recursively create parent directories to the output file.
// On Windows, both '/' and '\' are valid path separators.
- std::vector parts =
+ std::vector