aboutsummaryrefslogtreecommitdiff
path: root/cpp00/ex01/Contact.hpp
blob: d9fbee6614f46947b7852ae55259d4eb75d0d965 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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:
    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 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