aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/text_format.cc
diff options
context:
space:
mode:
authorGravatar Adam Cozzette <acozzette@google.com>2017-04-27 14:55:53 -0700
committerGravatar Adam Cozzette <acozzette@google.com>2017-04-27 14:55:53 -0700
commit9053033a5076f82cf18b823c31f352e95e5bfd8d (patch)
tree1d2a2611f56e786d7c3e40b8fd1b2e3d9aff9025 /src/google/protobuf/text_format.cc
parent067b1eec3bf852abaad0844999461baff8a5fdc8 (diff)
parenta6189acd18b00611c1dc7042299ad75486f08a1a (diff)
Merge remote-tracking branch 'remotes/google/3.3.x' into merge-3.3-to-master
Diffstat (limited to 'src/google/protobuf/text_format.cc')
-rw-r--r--src/google/protobuf/text_format.cc15
1 files changed, 3 insertions, 12 deletions
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