CPP00 1.0
読み取り中…
検索中…
一致する文字列を見つけられません
PhoneBook クラス

Defines the PhoneBook class. [詳解]

#include <PhoneBook.hpp>

PhoneBook 連携図
Collaboration graph

公開メンバ関数

 PhoneBook ()
 Default constructor for the PhoneBook class.
 
void addContact ()
 Adds a new contact to the phone book.
 
void searchContact () const
 Searches for and displays contact information by index
 
std::string getInputLine () const
 Reads a line of text from standard input.
 

詳解

Defines the PhoneBook class.

The PhoneBook class manages a collection of contacts, allowing users to add, search for, and display contact information. It has a fixed capacity of 8 contacts.

PhoneBook.hpp41 行目に定義があります。

構築子と解体子

◆ PhoneBook()

PhoneBook::PhoneBook ( )

Default constructor for the PhoneBook class.

Initializes the contact count to zero.

PhoneBook.cpp25 行目に定義があります。

関数詳解

◆ addContact()

void PhoneBook::addContact ( )

Adds a new contact to the phone book.

Prompts the user for contact details and adds them to the stored contacts. If the phone book is full (8 contacts), it shifts the existing contacts to make space for the new one, effectively overwriting the oldest contact. All fields (first name, last name, nickname, phone number, darkest secret) are mandatory.

PhoneBookAddContact.cpp24 行目に定義があります。

◆ getInputLine()

std::string PhoneBook::getInputLine ( ) const

Reads a line of text from standard input.

Reads characters from standard input until a newline character is encountered or the end-of-file (EOF) is reached. If EOF is encountered, the program exits.

戻り値
The line of text read from standard input.

PhoneBook.cpp35 行目に定義があります。

◆ searchContact()

void PhoneBook::searchContact ( ) const

Searches for and displays contact information by index

Prompts the user for a contact index and displays the corresponding details if a valid index is provided.

PhoneBookSearchContact.cpp107 行目に定義があります。


このクラス詳解は次のファイルから抽出されました: