CPP00 1.0
読み取り中…
検索中…
一致する文字列を見つけられません
PhoneBook.hpp
[詳解]
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* PhoneBook.hpp :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: kamitsui <kamitsui@student.42tokyo.jp> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2025/04/06 06:03:37 by kamitsui #+# #+# */
9/* Updated: 2025/04/12 22:00:38 by kamitsui ### ########.fr */
10/* */
11/* ************************************************************************** */
12
25#ifndef PHONEBOOK_HPP
26#define PHONEBOOK_HPP
27
28#include "Contact.hpp"
29#include <cstdlib> // for std::exit(0)
30#include <iomanip>
31#include <iostream>
32#include <sstream>
33
41class PhoneBook {
42 private:
43 Contact contacts_[8];
44 int contactCount_;
45
46 public:
47 PhoneBook();
48 void addContact();
49 void searchContact() const;
51
52 private:
53 void displaySavedContacts() const;
54 std::string truncateString(const std::string &str, size_t maxLength) const;
55 bool getValidIndex(int &index) const;
56 void displayContactInfo(const Contact &contact) const;
57};
58
59#endif // PHONEBOOK_HPP
Contact Class
Defines the Contact class.
Definition Contact.hpp:37
Defines the PhoneBook class.
Definition PhoneBook.hpp:41
PhoneBook()
Default constructor for the PhoneBook class.
Definition PhoneBook.cpp:25
std::string getInputLine() const
Reads a line of text from standard input.
Definition PhoneBook.cpp:35
void searchContact() const
Searches for and displays contact information by index
void addContact()
Adds a new contact to the phone book.