From d36c0c538a545fac5d9db6ba65c525246d4efa95 Mon Sep 17 00:00:00 2001 From: Feng Xiao Date: Wed, 29 Mar 2017 14:32:48 -0700 Subject: Down-integrate from google3. --- src/google/protobuf/text_format.cc | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'src/google/protobuf/text_format.cc') diff --git a/src/google/protobuf/text_format.cc b/src/google/protobuf/text_format.cc index 778b878e..04c887e0 100644 --- a/src/google/protobuf/text_format.cc +++ b/src/google/protobuf/text_format.cc @@ -74,18 +74,6 @@ inline bool IsOctNumber(const string& str) { (str[1] >= '0' && str[1] < '8')); } -inline bool GetAnyFieldDescriptors(const Message& message, - const FieldDescriptor** type_url_field, - const FieldDescriptor** value_field) { - const Descriptor* descriptor = message.GetDescriptor(); - *type_url_field = descriptor->FindFieldByNumber(1); - *value_field = descriptor->FindFieldByNumber(2); - return (*type_url_field != NULL && - (*type_url_field)->type() == FieldDescriptor::TYPE_STRING && - *value_field != NULL && - (*value_field)->type() == FieldDescriptor::TYPE_BYTES); -} - } // namespace string Message::DebugString() const { @@ -1322,6 +1310,7 @@ bool TextFormat::Parser::ParseFromString(const string& input, return Parse(&input_stream, output); } + bool TextFormat::Parser::Merge(io::ZeroCopyInputStream* input, Message* output) { ParserImpl parser(output->GetDescriptor(), input, error_collector_, @@ -1339,6 +1328,7 @@ bool TextFormat::Parser::MergeFromString(const string& input, return Merge(&input_stream, output); } + bool TextFormat::Parser::MergeUsingImpl(io::ZeroCopyInputStream* /* input */, Message* output, ParserImpl* parser_impl) { @@ -1387,6 +1377,7 @@ bool TextFormat::Parser::ParseFieldValueFromString( return Parser().MergeFromString(input, output); } + // =========================================================================== // The default implementation for FieldValuePrinter. The base class just -- cgit v1.2.3