aboutsummaryrefslogtreecommitdiff
path: root/cpp00/ex01/PhoneBook.hpp
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-04-13 09:18:30 +0200
committerCharles <sircharlesaze@gmail.com>2020-04-13 09:18:30 +0200
commit629d52b1262879a346e9ca17567a8f483c60ba0a (patch)
treeb6d32f764980b08cea6327e9b8a472d88331aae9 /cpp00/ex01/PhoneBook.hpp
parent8fc4395b9a61416e9bfee500e064dce7be9c8d7c (diff)
downloadpiscine_cpp-629d52b1262879a346e9ca17567a8f483c60ba0a.tar.gz
piscine_cpp-629d52b1262879a346e9ca17567a8f483c60ba0a.tar.bz2
piscine_cpp-629d52b1262879a346e9ca17567a8f483c60ba0a.zip
Fixed cpp00/ex01
Diffstat (limited to 'cpp00/ex01/PhoneBook.hpp')
-rw-r--r--cpp00/ex01/PhoneBook.hpp25
1 files changed, 21 insertions, 4 deletions
diff --git a/cpp00/ex01/PhoneBook.hpp b/cpp00/ex01/PhoneBook.hpp
index c4f8a23..8510710 100644
--- a/cpp00/ex01/PhoneBook.hpp
+++ b/cpp00/ex01/PhoneBook.hpp
@@ -1,3 +1,15 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* 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
@@ -10,11 +22,16 @@ class PhoneBook
{
public:
PhoneBook();
- bool add(Contact contact);
+ void add(Contact contact);
Contact* search(std::string needle);
+ size_t getSize() const;
+ Contact const &get(int index) const;
+
private:
- Contact contacts[CONTACTS_SIZE];
- int contacts_len;
+ Contact m_contacts[CONTACTS_SIZE];
+ int m_size;
};
-#endif // PHONE_BOOK_HPP
+std::ostream &operator<<(std::ostream &out, PhoneBook const &p);
+
+#endif