Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
b0e5ba69
Commit
b0e5ba69
authored
Jul 20, 2015
by
Jan Tattermusch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename persons to people
parent
359d32d4
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
8 additions
and
8 deletions
+8
-8
AddPerson.java
examples/AddPerson.java
+1
-1
ListPeople.java
examples/ListPeople.java
+1
-1
add_person.cc
examples/add_person.cc
+1
-1
add_person.py
examples/add_person.py
+1
-1
addressbook.proto
examples/addressbook.proto
+1
-1
list_people.cc
examples/list_people.cc
+2
-2
list_people.py
examples/list_people.py
+1
-1
No files found.
examples/AddPerson.java
View file @
b0e5ba69
...
...
@@ -80,7 +80,7 @@ class AddPerson {
}
// Add an address.
addressBook
.
addPe
rsons
(
addressBook
.
addPe
ople
(
PromptForAddress
(
new
BufferedReader
(
new
InputStreamReader
(
System
.
in
)),
System
.
out
));
...
...
examples/ListPeople.java
View file @
b0e5ba69
...
...
@@ -9,7 +9,7 @@ import java.io.PrintStream;
class
ListPeople
{
// Iterates though all people in the AddressBook and prints info about them.
static
void
Print
(
AddressBook
addressBook
)
{
for
(
Person
person:
addressBook
.
getPe
rsons
List
())
{
for
(
Person
person:
addressBook
.
getPe
ople
List
())
{
System
.
out
.
println
(
"Person ID: "
+
person
.
getId
());
System
.
out
.
println
(
" Name: "
+
person
.
getName
());
if
(!
person
.
getEmail
().
isEmpty
())
{
...
...
examples/add_person.cc
View file @
b0e5ba69
...
...
@@ -77,7 +77,7 @@ int main(int argc, char* argv[]) {
}
// Add an address.
PromptForAddress
(
address_book
.
add_pe
rsons
());
PromptForAddress
(
address_book
.
add_pe
ople
());
{
// Write the new address book back to disk.
...
...
examples/add_person.py
View file @
b0e5ba69
...
...
@@ -50,7 +50,7 @@ except IOError:
print
sys
.
argv
[
1
]
+
": File not found. Creating a new file."
# Add an address.
PromptForAddress
(
address_book
.
pe
rsons
.
add
())
PromptForAddress
(
address_book
.
pe
ople
.
add
())
# Write the new address book back to disk.
f
=
open
(
sys
.
argv
[
1
],
"wb"
)
...
...
examples/addressbook.proto
View file @
b0e5ba69
...
...
@@ -29,5 +29,5 @@ message Person {
// Our address book file is just one of these.
message
AddressBook
{
repeated
Person
pe
rsons
=
1
;
repeated
Person
pe
ople
=
1
;
}
examples/list_people.cc
View file @
b0e5ba69
...
...
@@ -8,8 +8,8 @@ using namespace std;
// 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
.
pe
rsons
_size
();
i
++
)
{
const
tutorial
::
Person
&
person
=
address_book
.
pe
rsons
(
i
);
for
(
int
i
=
0
;
i
<
address_book
.
pe
ople
_size
();
i
++
)
{
const
tutorial
::
Person
&
person
=
address_book
.
pe
ople
(
i
);
cout
<<
"Person ID: "
<<
person
.
id
()
<<
endl
;
cout
<<
" Name: "
<<
person
.
name
()
<<
endl
;
...
...
examples/list_people.py
View file @
b0e5ba69
...
...
@@ -7,7 +7,7 @@ import sys
# Iterates though all people in the AddressBook and prints info about them.
def
ListPeople
(
address_book
):
for
person
in
address_book
.
pe
rsons
:
for
person
in
address_book
.
pe
ople
:
print
"Person ID:"
,
person
.
id
print
" Name:"
,
person
.
name
if
person
.
email
!=
""
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment