@@ -276,9 +276,9 @@ any particular field definition, see the
276276
277277The generated code includes a ` PhoneType` enum that corresponds to your ` .proto`
278278enum. You can refer to this type as ` Person::PhoneType` and its values as
279- ` Person::MOBILE ` , ` Person::HOME ` , and ` Person::WORK ` (the implementation details
280- are a little more complicated, but you don ' t need to understand them to use the
281- enum).
279+ ` Person::PHONE_TYPE_MOBILE ` , ` Person::PHONE_TYPE_HOME ` , and
280+ ` Person::PHONE_TYPE_WORK ` (the implementation details are a little more
281+ complicated, but you don ' t need to understand them to use the enum).
282282
283283The compiler has also generated a nested class for you called
284284`Person::PhoneNumber`. If you look at the code, you can see that the "real"
@@ -394,11 +394,11 @@ void PromptForAddress(tutorial::Person* person) {
394394 string type;
395395 getline(cin, type);
396396 if (type == "mobile") {
397- phone_number->set_type(tutorial::Person::MOBILE );
397+ phone_number->set_type(tutorial::Person::PHONE_TYPE_MOBILE );
398398 } else if (type == "home") {
399- phone_number->set_type(tutorial::Person::HOME );
399+ phone_number->set_type(tutorial::Person::PHONE_TYPE_HOME );
400400 } else if (type == "work") {
401- phone_number->set_type(tutorial::Person::WORK );
401+ phone_number->set_type(tutorial::Person::PHONE_TYPE_WORK );
402402 } else {
403403 cout << "Unknown phone type. Using default." << endl;
404404 }
@@ -494,13 +494,13 @@ void ListPeople(const tutorial::AddressBook& address_book) {
494494 const tutorial::Person::PhoneNumber& phone_number = person.phones(j);
495495
496496 switch (phone_number.type()) {
497- case tutorial::Person::MOBILE :
497+ case tutorial::Person::PHONE_TYPE_MOBILE :
498498 cout << " Mobile phone #: ";
499499 break;
500- case tutorial::Person::HOME :
500+ case tutorial::Person::PHONE_TYPE_HOME :
501501 cout << " Home phone #: ";
502502 break;
503- case tutorial::Person::WORK :
503+ case tutorial::Person::PHONE_TYPE_WORK :
504504 cout << " Work phone #: ";
505505 break;
506506 }
0 commit comments