aboutsummaryrefslogtreecommitdiff
path: root/cpp00/ex01/Contact.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/Contact.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/Contact.hpp')
-rw-r--r--cpp00/ex01/Contact.hpp63
1 files changed, 49 insertions, 14 deletions
diff --git a/cpp00/ex01/Contact.hpp b/cpp00/ex01/Contact.hpp
index 3d04889..d9fbee6 100644
--- a/cpp00/ex01/Contact.hpp
+++ b/cpp00/ex01/Contact.hpp
@@ -1,25 +1,60 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* Contact.hpp :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/04/13 07:23:11 by charles #+# #+# */
+/* Updated: 2020/04/13 08:57:01 by charles ### ########.fr */
+/* */
+/* ************************************************************************** */
+
#ifndef CONTACT_HPP
# define CONTACT_HPP
# include <string>
+# include <iomanip>
+# include <iostream>
+# include "utils.hpp"
class Contact
{
public:
- Contact(std::string name);
- // std::string phone_str();
+ static Contact prompt();
+ void preview() const;
+ void put() const;
+
+private:
+ static void promptString(std::string promptString, std::string &s);
+ static void promptInt(std::string promptString, int &i);
+ static std::string trimedName(std::string name);
+
+ struct Address
+ {
+ int m_houseNum;
+ int m_postCode;
+ std::string m_street;
+ std::string m_city;
+ };
+ struct Date
+ {
+ int m_day;
+ int m_month;
+ int m_year;
+ };
- std::string first_name;
- std::string last_name;
- std::string nickname;
- std::string login;
- std::string postal_address;
- std::string email;
- std::string phone;
- std::string birthday;
- std::string fav_meal;
- std::string underware_color;
- std::string darkest_secret;
+ std::string m_firstName;
+ std::string m_lastName;
+ std::string m_nickname;
+ std::string m_login;
+ Address m_address;
+ std::string m_email;
+ std::string m_phone;
+ Date m_birthday;
+ std::string m_favMeal;
+ std::string m_underwareColor;
+ std::string m_darkestSecret;
};
-#endif // CONTACT_HPP
+#endif