aboutsummaryrefslogtreecommitdiff
path: root/cpp05/ex02/Form.hpp
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-10-19 13:59:12 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-10-19 13:59:12 +0200
commitc426fe76ec5925e8c94aae3db04e5e1f1ce1585e (patch)
tree1cdbbe15c1ed92f0df3b7041550270690575f1a2 /cpp05/ex02/Form.hpp
parent60c4c5309af87480fb32f3815bc02031eff43e9b (diff)
downloadpiscine_cpp-c426fe76ec5925e8c94aae3db04e5e1f1ce1585e.tar.gz
piscine_cpp-c426fe76ec5925e8c94aae3db04e5e1f1ce1585e.tar.bz2
piscine_cpp-c426fe76ec5925e8c94aae3db04e5e1f1ce1585e.zip
Adding boilerplate cpp05/ex02
Diffstat (limited to 'cpp05/ex02/Form.hpp')
-rw-r--r--cpp05/ex02/Form.hpp65
1 files changed, 65 insertions, 0 deletions
diff --git a/cpp05/ex02/Form.hpp b/cpp05/ex02/Form.hpp
new file mode 100644
index 0000000..3be16f6
--- /dev/null
+++ b/cpp05/ex02/Form.hpp
@@ -0,0 +1,65 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* Form.hpp :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/04/14 19:19:45 by charles #+# #+# */
+/* Updated: 2020/10/19 13:16:01 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#ifndef FORM_HPP
+# define FORM_HPP
+
+# include "Bureaucrat.hpp"
+
+class Form
+{
+public:
+ Form(Form const& other);
+ void operator=(Form const& other);
+ ~Form();
+
+ Form(std::string const& name);
+
+ std::string const& getName() const;
+ bool getSigned() const;
+ int getGradeSign() const;
+ int getGradeExecute() const;
+
+ void beSigned(Bureaucrat const& b);
+
+ class GradeTooHighException : public std::exception
+ {
+ public:
+ GradeTooHighException();
+ GradeTooHighException(GradeTooHighException const& other);
+ GradeTooHighException& operator=(GradeTooHighException const& other);
+ ~GradeTooHighException();
+ virtual char const* what() const throw();
+ };
+
+ class GradeTooLowException : public std::exception
+ {
+ public:
+ GradeTooLowException();
+ GradeTooLowException(GradeTooLowException const& other);
+ GradeTooLowException& operator=(GradeTooLowException const& other);
+ ~GradeTooLowException();
+ virtual char const* what() const throw();
+ };
+
+private:
+ Form();
+
+ std::string const m_name;
+ bool m_signed;
+ int const m_gradeSign;
+ int const m_gradeExecute;
+};
+
+std::ostream& operator<<(std::ostream& out, Form const& f);
+
+#endif