CPP00
1.0
読み取り中…
検索中…
一致する文字列を見つけられません
main.cpp
[詳解]
1
/* ************************************************************************** */
2
/* */
3
/* ::: :::::::: */
4
/* main.cpp :+: :+: :+: */
5
/* +:+ +:+ +:+ */
6
/* By: kamitsui <kamitsui@student.42tokyo.jp> +#+ +:+ +#+ */
7
/* +#+#+#+#+#+ +#+ */
8
/* Created: 2025/03/19 21:20:03 by kamitsui #+# #+# */
9
/* Updated: 2025/04/13 01:32:29 by kamitsui ### ########.fr */
10
/* */
11
/* ************************************************************************** */
12
13
#include "
PhoneBook.hpp
"
14
21
int
main
(
void
) {
22
PhoneBook
phoneBook;
23
std::string
command;
24
25
while
(
true
) {
26
std::cout
<<
"Enter command (ADD, SEARCH, EXIT): "
;
27
command = phoneBook.
getInputLine
();
28
29
if
(command ==
"ADD"
)
30
phoneBook.
addContact
();
31
else
if
(command ==
"SEARCH"
)
32
phoneBook.
searchContact
();
33
else
if
(command ==
"EXIT"
)
34
break
;
35
else
36
std::cerr
<<
"Invalid input."
<<
std::endl
;
37
}
38
return
(0);
39
}
PhoneBook.hpp
PhoneBook Class
std::endl
basic_ostream< _CharT, _Traits > & endl(basic_ostream< _CharT, _Traits > &__os)
std::cerr
ostream cerr
std::cout
ostream cout
std::basic_string
PhoneBook
Defines the PhoneBook class.
Definition
PhoneBook.hpp:41
PhoneBook::getInputLine
std::string getInputLine() const
Reads a line of text from standard input.
Definition
PhoneBook.cpp:35
PhoneBook::searchContact
void searchContact() const
Searches for and displays contact information by index
Definition
PhoneBookSearchContact.cpp:107
PhoneBook::addContact
void addContact()
Adds a new contact to the phone book.
Definition
PhoneBookAddContact.cpp:24
main
int main(void)
Main entry point of the Awesome Phone Book application.
Definition
main.cpp:21
ex01
main.cpp
構築:
1.9.8