aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpp05/ex02/RobotomyRequestForm.hpp3
-rw-r--r--cpp05/ex02/ShrubberyCreationForm.cpp7
-rw-r--r--cpp05/ex02/ShrubberyCreationForm.hpp3
-rw-r--r--cpp05/ex03/RobotomyRequestForm.hpp3
-rw-r--r--cpp05/ex03/ShrubberyCreationForm.cpp7
-rw-r--r--cpp05/ex03/ShrubberyCreationForm.hpp3
6 files changed, 16 insertions, 10 deletions
diff --git a/cpp05/ex02/RobotomyRequestForm.hpp b/cpp05/ex02/RobotomyRequestForm.hpp
index 9032799..4948570 100644
--- a/cpp05/ex02/RobotomyRequestForm.hpp
+++ b/cpp05/ex02/RobotomyRequestForm.hpp
@@ -6,13 +6,14 @@
/* By: cacharle <me@cacharle.xyz> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/10/19 13:43:37 by cacharle #+# #+# */
-/* Updated: 2020/12/12 12:09:37 by cacharle ### ########.fr */
+/* Updated: 2020/12/12 12:46:46 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef ROBOTOMYREQUESTFORM_HPP
# define ROBOTOMYREQUESTFORM_HPP
+# include <cstdlib>
# include "Form.hpp"
class RobotomyRequestForm : public Form
diff --git a/cpp05/ex02/ShrubberyCreationForm.cpp b/cpp05/ex02/ShrubberyCreationForm.cpp
index 262f166..ac76272 100644
--- a/cpp05/ex02/ShrubberyCreationForm.cpp
+++ b/cpp05/ex02/ShrubberyCreationForm.cpp
@@ -6,7 +6,7 @@
/* By: cacharle <me@cacharle.xyz> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/10/19 13:45:45 by cacharle #+# #+# */
-/* Updated: 2020/11/17 17:15:43 by charles ### ########.fr */
+/* Updated: 2020/12/12 12:45:12 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -29,10 +29,11 @@ ShrubberyCreationForm::~ShrubberyCreationForm() {}
void ShrubberyCreationForm::executeUnsafe() const
{
- std::ofstream file(m_target + "_shrubbery");
+ std::string filename(m_target + "_shrubbery");
+ std::ofstream file(filename.c_str());
if (!file.is_open())
{
- std::cerr << "Error: " << m_target + "_shrubbery" << ": " << std::strerror(errno) << std::endl;
+ std::cerr << "Error: " << filename << ": " << std::strerror(errno) << std::endl;
return;
}
file <<
diff --git a/cpp05/ex02/ShrubberyCreationForm.hpp b/cpp05/ex02/ShrubberyCreationForm.hpp
index 7266eb8..dab62f8 100644
--- a/cpp05/ex02/ShrubberyCreationForm.hpp
+++ b/cpp05/ex02/ShrubberyCreationForm.hpp
@@ -6,13 +6,14 @@
/* By: cacharle <me@cacharle.xyz> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/10/19 13:43:27 by cacharle #+# #+# */
-/* Updated: 2020/12/12 12:09:51 by cacharle ### ########.fr */
+/* Updated: 2020/12/12 12:44:07 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef SHRUBBERYCREATIONFORM_HPP
# define SHRUBBERYCREATIONFORM_HPP
+# include <cerrno>
# include <string>
# include <cstring>
# include <fstream>
diff --git a/cpp05/ex03/RobotomyRequestForm.hpp b/cpp05/ex03/RobotomyRequestForm.hpp
index f6cafd1..cd93100 100644
--- a/cpp05/ex03/RobotomyRequestForm.hpp
+++ b/cpp05/ex03/RobotomyRequestForm.hpp
@@ -6,13 +6,14 @@
/* By: cacharle <me@cacharle.xyz> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/10/19 13:43:37 by cacharle #+# #+# */
-/* Updated: 2020/12/12 12:20:48 by cacharle ### ########.fr */
+/* Updated: 2020/12/12 12:46:52 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef ROBOTOMYREQUESTFORM_HPP
# define ROBOTOMYREQUESTFORM_HPP
+# include <cstdlib>
# include "Form.hpp"
class RobotomyRequestForm : public Form
diff --git a/cpp05/ex03/ShrubberyCreationForm.cpp b/cpp05/ex03/ShrubberyCreationForm.cpp
index 262f166..3ad872c 100644
--- a/cpp05/ex03/ShrubberyCreationForm.cpp
+++ b/cpp05/ex03/ShrubberyCreationForm.cpp
@@ -6,7 +6,7 @@
/* By: cacharle <me@cacharle.xyz> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/10/19 13:45:45 by cacharle #+# #+# */
-/* Updated: 2020/11/17 17:15:43 by charles ### ########.fr */
+/* Updated: 2020/12/12 12:44:47 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -29,10 +29,11 @@ ShrubberyCreationForm::~ShrubberyCreationForm() {}
void ShrubberyCreationForm::executeUnsafe() const
{
- std::ofstream file(m_target + "_shrubbery");
+ std::string filename(m_target + "_shrubbery");
+ std::ofstream file(filename.c_str());
if (!file.is_open())
{
- std::cerr << "Error: " << m_target + "_shrubbery" << ": " << std::strerror(errno) << std::endl;
+ std::cerr << "Error: " << filename << ": " << std::strerror(errno) << std::endl;
return;
}
file <<
diff --git a/cpp05/ex03/ShrubberyCreationForm.hpp b/cpp05/ex03/ShrubberyCreationForm.hpp
index 27e34a0..b2c0b7d 100644
--- a/cpp05/ex03/ShrubberyCreationForm.hpp
+++ b/cpp05/ex03/ShrubberyCreationForm.hpp
@@ -6,13 +6,14 @@
/* By: cacharle <me@cacharle.xyz> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/10/19 13:43:27 by cacharle #+# #+# */
-/* Updated: 2020/12/12 12:20:33 by cacharle ### ########.fr */
+/* Updated: 2020/12/12 12:44:17 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef SHRUBBERYCREATIONFORM_HPP
# define SHRUBBERYCREATIONFORM_HPP
+# include <cerrno>
# include <string>
# include <cstring>
# include <fstream>