From 331c3596660fed6c8b04fdfd0a89435ccffaaf20 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Tue, 17 Nov 2020 13:52:48 +0100 Subject: Fixing cpp05/ex00-02 --- cpp05/ex02/PresidentialPardonFrom.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'cpp05/ex02/PresidentialPardonFrom.cpp') diff --git a/cpp05/ex02/PresidentialPardonFrom.cpp b/cpp05/ex02/PresidentialPardonFrom.cpp index e69de29..46e2d3c 100644 --- a/cpp05/ex02/PresidentialPardonFrom.cpp +++ b/cpp05/ex02/PresidentialPardonFrom.cpp @@ -0,0 +1,35 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* PresidentialPardonFrom.cpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cacharle +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/11/17 13:01:25 by cacharle #+# #+# */ +/* Updated: 2020/11/17 13:04:10 by cacharle ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "PresidentialPardonFrom.hpp" + +PresidentialPardonFrom::PresidentialPardonFrom(std::string const& target) + : Form("presidential pardon", 25, 5), m_target(target) {} + +PresidentialPardonFrom::PresidentialPardonFrom(const PresidentialPardonFrom& other) + : Form(other) { *this = other; } + +PresidentialPardonFrom& PresidentialPardonFrom::operator=(const PresidentialPardonFrom& other) +{ + Form::operator=(other); + m_target = other.m_target; + return *this; +} + +PresidentialPardonFrom::~PresidentialPardonFrom() {} + +void PresidentialPardonFrom::executeUnsafe() const +{ + std::cout << m_target << " has been pardoned by Zafod Beeblebrox" << std::endl; +} + +PresidentialPardonFrom::PresidentialPardonFrom() : Form("", 0, 0) {} -- cgit