aboutsummaryrefslogtreecommitdiff
path: root/cpp00/ex01/PhoneBook.hpp
blob: 8510710cb5246024a25cb658c06090dc31ef0b12 (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
26
27
28
29
30
31
32
33
34
35
36
37
/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   PhoneBook.hpp                                      :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: charles <charles.cabergs@gmail.com>        +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2020/04/13 09:06:23 by charles           #+#    #+#             */
/*   Updated: 2020/04/13 09:06:39 by charles          ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

#ifndef PHONE_BOOK_HPP
# define PHONE_BOOK_HPP

# define CONTACTS_SIZE 8

# include <string>
# include "Contact.hpp"

class PhoneBook
{
public:
	PhoneBook();
	void add(Contact contact);
	Contact* search(std::string needle);
    size_t getSize() const;
    Contact const &get(int index) const;

private:
	Contact m_contacts[CONTACTS_SIZE];
	int m_size;
};

std::ostream &operator<<(std::ostream &out, PhoneBook const &p);

#endif