summaryrefslogtreecommitdiff
path: root/graphs/cpp/address_book/address_book.hh
blob: 9e59ac9fb82c90a2d1a57dea2aa7c8800d988e6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//
// Created by martial.simon on 2/26/25.
//

#pragma once
#include <map>
#include <string>
#include <vector>

#include "contact_details.hh"

class AddressBook
{
public:
    bool add(const std::string& full_name, const std::string& email,
             const std::string& number);
    std::vector<ContactDetails> find(const std::string& full_name);
    std::size_t count(const std::string& full_name);
    bool remove(const std::string& full_name, std::size_t index);
    void remove_all(const std::string& full_name);
    friend std::ostream& operator<<(std::ostream& os, const AddressBook& b);

private:
    std::multimap<std::string, ContactDetails> contact_map_;
};