Re-apply merge of tag v3.5.2
v3.5.2 was previously merged in Ia1b9174f7e3ac5c2d86ea7370d5c6c3ef1a37300
and then reverted as part of Ia04c0b15ebd45e8c7e02edaa6e1f10aeb11ef337,
which leaves v3.5.2 in the history but v3.0.0-beta3 in the tree. Reapply
the merge to v3.5.2 so that v3.9.1 can be merged on top of it.
Bug: 117607748
Test: m checkbuild
Change-Id: I77a2c0638b00487d3acfbf3c0d634f26caf5b9be
diff --git a/examples/list_people.cc b/examples/list_people.cc
index 68e5666..b309c59 100644
--- a/examples/list_people.cc
+++ b/examples/list_people.cc
@@ -1,11 +1,16 @@
// See README.txt for information and build instructions.
-#include <iostream>
#include <fstream>
+#include <google/protobuf/util/time_util.h>
+#include <iostream>
#include <string>
+
#include "addressbook.pb.h"
+
using namespace std;
+using google::protobuf::util::TimeUtil;
+
// Iterates though all people in the AddressBook and prints info about them.
void ListPeople(const tutorial::AddressBook& address_book) {
for (int i = 0; i < address_book.people_size(); i++) {
@@ -30,9 +35,15 @@
case tutorial::Person::WORK:
cout << " Work phone #: ";
break;
+ default:
+ cout << " Unknown phone #: ";
+ break;
}
cout << phone_number.number() << endl;
}
+ if (person.has_last_updated()) {
+ cout << " Updated: " << TimeUtil::ToString(person.last_updated()) << endl;
+ }
}
}