style: use my one (with logic) norm for header hope u enjoy it
This commit is contained in:
parent
ff72109a4e
commit
2d6b2ddb83
13 changed files with 316 additions and 315 deletions
|
|
@ -6,42 +6,42 @@
|
||||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/10/17 15:27:54 by rparodi #+# #+# */
|
/* Created: 2024/10/17 15:27:54 by rparodi #+# #+# */
|
||||||
/* Updated: 2024/10/17 15:48:22 by rparodi ### ########.fr */
|
/* Updated: 2024/12/23 12:36:02 by rparodi ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#ifndef COLOR_HPP
|
#ifndef COLOR_HPP
|
||||||
#define COLOR_HPP
|
#define COLOR_HPP
|
||||||
|
|
||||||
#define CLR_RESET "\033[0m"
|
#define CLR_RESET "\033[0m"
|
||||||
|
|
||||||
#define CLR_BLACK "\033[0;30m"
|
#define CLR_BLACK "\033[0;30m"
|
||||||
#define CLR_RED "\033[0;31m"
|
#define CLR_RED "\033[0;31m"
|
||||||
#define CLR_GREEN "\033[0;32m"
|
#define CLR_GREEN "\033[0;32m"
|
||||||
#define CLR_YELLOW "\033[0;33m"
|
#define CLR_YELLOW "\033[0;33m"
|
||||||
#define CLR_BLUE "\033[0;34m"
|
#define CLR_BLUE "\033[0;34m"
|
||||||
#define CLR_MAGENTA "\033[0;35m"
|
#define CLR_MAGENTA "\033[0;35m"
|
||||||
#define CLR_CYAN "\033[0;36m"
|
#define CLR_CYAN "\033[0;36m"
|
||||||
#define CLR_WHITE "\033[0;37m"
|
#define CLR_WHITE "\033[0;37m"
|
||||||
#define CLR_GOLD "\033[38;5;220m"
|
#define CLR_GOLD "\033[38;5;220m"
|
||||||
#define CLR_GREY "\033[38;5;240m"
|
#define CLR_GREY "\033[38;5;240m"
|
||||||
|
|
||||||
#define CLR_LIGHT_BLACK "\033[0;90m"
|
#define CLR_LIGHT_BLACK "\033[0;90m"
|
||||||
#define CLR_LIGHT_RED "\033[0;91m"
|
#define CLR_LIGHT_RED "\033[0;91m"
|
||||||
#define CLR_LIGHT_GREEN "\033[0;92m"
|
#define CLR_LIGHT_GREEN "\033[0;92m"
|
||||||
#define CLR_LIGHT_YELLOW "\033[0;93m"
|
#define CLR_LIGHT_YELLOW "\033[0;93m"
|
||||||
#define CLR_LIGHT_BLUE "\033[0;94m"
|
#define CLR_LIGHT_BLUE "\033[0;94m"
|
||||||
#define CLR_LIGHT_MAGENTA "\033[0;95m"
|
#define CLR_LIGHT_MAGENTA "\033[0;95m"
|
||||||
#define CLR_LIGHT_CYAN "\033[0;96m"
|
#define CLR_LIGHT_CYAN "\033[0;96m"
|
||||||
#define CLR_LIGHT_WHITE "\033[0;97m"
|
#define CLR_LIGHT_WHITE "\033[0;97m"
|
||||||
|
|
||||||
#define CLR_BOLD_BLACK "\033[1;30m"
|
#define CLR_BOLD_BLACK "\033[1;30m"
|
||||||
#define CLR_BOLD_RED "\033[1;31m"
|
#define CLR_BOLD_RED "\033[1;31m"
|
||||||
#define CLR_BOLD_GREEN "\033[1;32m"
|
#define CLR_BOLD_GREEN "\033[1;32m"
|
||||||
#define CLR_BOLD_YELLOW "\033[1;33m"
|
#define CLR_BOLD_YELLOW "\033[1;33m"
|
||||||
#define CLR_BOLD_BLUE "\033[1;34m"
|
#define CLR_BOLD_BLUE "\033[1;34m"
|
||||||
#define CLR_BOLD_MAGENTA "\033[1;35m"
|
#define CLR_BOLD_MAGENTA "\033[1;35m"
|
||||||
#define CLR_BOLD_CYAN "\033[1;36m"
|
#define CLR_BOLD_CYAN "\033[1;36m"
|
||||||
#define CLR_BOLD_WHITE "\033[1;37m"
|
#define CLR_BOLD_WHITE "\033[1;37m"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -6,26 +6,26 @@
|
||||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/10/17 14:56:49 by rparodi #+# #+# */
|
/* Created: 2024/10/17 14:56:49 by rparodi #+# #+# */
|
||||||
/* Updated: 2024/10/22 14:06:11 by rparodi ### ########.fr */
|
/* Updated: 2024/12/23 12:36:19 by rparodi ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#ifndef PHONEBOOK_HPP
|
#ifndef PHONEBOOK_HPP
|
||||||
# define PHONEBOOK_HPP
|
#define PHONEBOOK_HPP
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include "color.hpp"
|
#include "color.hpp"
|
||||||
|
|
||||||
#define MENU CLR_BLUE << "ADD" << CLR_RESET << ":\tAdding a new contact" << std::endl << CLR_BLUE << "SEARCH" << CLR_RESET << ":\tSearching a contact in the list" << std::endl << CLR_BLUE << "EXIT" << CLR_RESET << ":\texit the program" << std::endl
|
#define MENU CLR_BLUE << "ADD" << CLR_RESET << ":\tAdding a new contact" << std::endl << CLR_BLUE << "SEARCH" << CLR_RESET << ":\tSearching a contact in the list" << std::endl << CLR_BLUE << "EXIT" << CLR_RESET << ":\texit the program" << std::endl
|
||||||
|
|
||||||
std::string get_input(const char *err_msg, std::string file, int line);
|
std::string get_input(const char *err_msg, std::string file, int line);
|
||||||
|
|
||||||
class Contact
|
class Contact
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Contact();
|
Contact();
|
||||||
~Contact();
|
~Contact();
|
||||||
|
|
@ -44,10 +44,10 @@ class Contact
|
||||||
std::string _nickname;
|
std::string _nickname;
|
||||||
std::string _number;
|
std::string _number;
|
||||||
std::string _secret;
|
std::string _secret;
|
||||||
};
|
};
|
||||||
|
|
||||||
class PhoneBook
|
class PhoneBook
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PhoneBook();
|
PhoneBook();
|
||||||
~PhoneBook();
|
~PhoneBook();
|
||||||
|
|
@ -56,6 +56,6 @@ class PhoneBook
|
||||||
void search();
|
void search();
|
||||||
private:
|
private:
|
||||||
void searching_header();
|
void searching_header();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -6,27 +6,27 @@
|
||||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/11/04 16:03:03 by rparodi #+# #+# */
|
/* Created: 2024/11/04 16:03:03 by rparodi #+# #+# */
|
||||||
/* Updated: 2024/11/04 16:31:17 by rparodi ### ########.fr */
|
/* Updated: 2024/12/23 12:36:49 by rparodi ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#ifndef ZOMBIE_HPP
|
#ifndef ZOMBIE_HPP
|
||||||
# define ZOMBIE_HPP
|
#define ZOMBIE_HPP
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class Zombie
|
class Zombie
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Zombie(std::string name);
|
Zombie(std::string name);
|
||||||
~Zombie();
|
~Zombie();
|
||||||
void announce(void);
|
void announce(void);
|
||||||
private:
|
private:
|
||||||
std::string _name;
|
std::string _name;
|
||||||
};
|
};
|
||||||
|
|
||||||
Zombie* newZombie( std::string name );
|
Zombie* newZombie( std::string name );
|
||||||
void randomChump( std::string name );
|
void randomChump( std::string name );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,12 @@
|
||||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/11/04 15:48:46 by rparodi #+# #+# */
|
/* Created: 2024/11/04 15:48:46 by rparodi #+# #+# */
|
||||||
/* Updated: 2024/11/04 16:40:59 by rparodi ### ########.fr */
|
/* Updated: 2024/12/17 23:05:23 by rparodi ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#include "Zombie.hpp"
|
#include "Zombie.hpp"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
Zombie roger = Zombie("Roger");
|
Zombie roger = Zombie("Roger");
|
||||||
|
|
|
||||||
|
|
@ -6,19 +6,19 @@
|
||||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/11/04 16:03:03 by rparodi #+# #+# */
|
/* Created: 2024/11/04 16:03:03 by rparodi #+# #+# */
|
||||||
/* Updated: 2024/11/05 12:55:24 by rparodi ### ########.fr */
|
/* Updated: 2024/12/23 12:38:52 by rparodi ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#ifndef ZOMBIE_HPP
|
#ifndef ZOMBIE_HPP
|
||||||
# define ZOMBIE_HPP
|
# define ZOMBIE_HPP
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class Zombie
|
class Zombie
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Zombie();
|
Zombie();
|
||||||
~Zombie();
|
~Zombie();
|
||||||
|
|
@ -26,40 +26,40 @@ class Zombie
|
||||||
void setName( std::string name );
|
void setName( std::string name );
|
||||||
private:
|
private:
|
||||||
std::string _name;
|
std::string _name;
|
||||||
};
|
};
|
||||||
|
|
||||||
Zombie* zombieHorde( int N, std::string name );
|
Zombie* zombieHorde( int N, std::string name );
|
||||||
|
|
||||||
|
|
||||||
#define CLR_RESET "\033[0m"
|
#define CLR_RESET "\033[0m"
|
||||||
|
|
||||||
#define CLR_BLACK "\033[0;30m"
|
#define CLR_BLACK "\033[0;30m"
|
||||||
#define CLR_RED "\033[0;31m"
|
#define CLR_RED "\033[0;31m"
|
||||||
#define CLR_GREEN "\033[0;32m"
|
#define CLR_GREEN "\033[0;32m"
|
||||||
#define CLR_YELLOW "\033[0;33m"
|
#define CLR_YELLOW "\033[0;33m"
|
||||||
#define CLR_BLUE "\033[0;34m"
|
#define CLR_BLUE "\033[0;34m"
|
||||||
#define CLR_MAGENTA "\033[0;35m"
|
#define CLR_MAGENTA "\033[0;35m"
|
||||||
#define CLR_CYAN "\033[0;36m"
|
#define CLR_CYAN "\033[0;36m"
|
||||||
#define CLR_WHITE "\033[0;37m"
|
#define CLR_WHITE "\033[0;37m"
|
||||||
#define CLR_GOLD "\033[38;5;220m"
|
#define CLR_GOLD "\033[38;5;220m"
|
||||||
#define CLR_GREY "\033[38;5;240m"
|
#define CLR_GREY "\033[38;5;240m"
|
||||||
|
|
||||||
#define CLR_LIGHT_BLACK "\033[0;90m"
|
#define CLR_LIGHT_BLACK "\033[0;90m"
|
||||||
#define CLR_LIGHT_RED "\033[0;91m"
|
#define CLR_LIGHT_RED "\033[0;91m"
|
||||||
#define CLR_LIGHT_GREEN "\033[0;92m"
|
#define CLR_LIGHT_GREEN "\033[0;92m"
|
||||||
#define CLR_LIGHT_YELLOW "\033[0;93m"
|
#define CLR_LIGHT_YELLOW "\033[0;93m"
|
||||||
#define CLR_LIGHT_BLUE "\033[0;94m"
|
#define CLR_LIGHT_BLUE "\033[0;94m"
|
||||||
#define CLR_LIGHT_MAGENTA "\033[0;95m"
|
#define CLR_LIGHT_MAGENTA "\033[0;95m"
|
||||||
#define CLR_LIGHT_CYAN "\033[0;96m"
|
#define CLR_LIGHT_CYAN "\033[0;96m"
|
||||||
#define CLR_LIGHT_WHITE "\033[0;97m"
|
#define CLR_LIGHT_WHITE "\033[0;97m"
|
||||||
|
|
||||||
#define CLR_BOLD_BLACK "\033[1;30m"
|
#define CLR_BOLD_BLACK "\033[1;30m"
|
||||||
#define CLR_BOLD_RED "\033[1;31m"
|
#define CLR_BOLD_RED "\033[1;31m"
|
||||||
#define CLR_BOLD_GREEN "\033[1;32m"
|
#define CLR_BOLD_GREEN "\033[1;32m"
|
||||||
#define CLR_BOLD_YELLOW "\033[1;33m"
|
#define CLR_BOLD_YELLOW "\033[1;33m"
|
||||||
#define CLR_BOLD_BLUE "\033[1;34m"
|
#define CLR_BOLD_BLUE "\033[1;34m"
|
||||||
#define CLR_BOLD_MAGENTA "\033[1;35m"
|
#define CLR_BOLD_MAGENTA "\033[1;35m"
|
||||||
#define CLR_BOLD_CYAN "\033[1;36m"
|
#define CLR_BOLD_CYAN "\033[1;36m"
|
||||||
#define CLR_BOLD_WHITE "\033[1;37m"
|
#define CLR_BOLD_WHITE "\033[1;37m"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -6,18 +6,18 @@
|
||||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/11/05 13:34:19 by rparodi #+# #+# */
|
/* Created: 2024/11/05 13:34:19 by rparodi #+# #+# */
|
||||||
/* Updated: 2024/11/05 14:23:03 by rparodi ### ########.fr */
|
/* Updated: 2024/12/23 12:38:16 by rparodi ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#ifndef HUMANA_HPP
|
#ifndef HUMANA_HPP
|
||||||
#define HUMANA_HPP
|
#define HUMANA_HPP
|
||||||
|
|
||||||
#include "Weapon.hpp"
|
#include "Weapon.hpp"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
class HumanA {
|
class HumanA {
|
||||||
public:
|
public:
|
||||||
HumanA(std::string name, Weapon &toGive);
|
HumanA(std::string name, Weapon &toGive);
|
||||||
~HumanA();
|
~HumanA();
|
||||||
|
|
@ -25,6 +25,6 @@ class HumanA {
|
||||||
private:
|
private:
|
||||||
std::string _name;
|
std::string _name;
|
||||||
Weapon *_weapon;
|
Weapon *_weapon;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -6,18 +6,18 @@
|
||||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/11/05 13:34:19 by rparodi #+# #+# */
|
/* Created: 2024/11/05 13:34:19 by rparodi #+# #+# */
|
||||||
/* Updated: 2024/11/05 14:32:31 by rparodi ### ########.fr */
|
/* Updated: 2024/12/23 12:38:24 by rparodi ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#ifndef HUMANB_HPP
|
#ifndef HUMANB_HPP
|
||||||
#define HUMANB_HPP
|
#define HUMANB_HPP
|
||||||
|
|
||||||
#include "Weapon.hpp"
|
#include "Weapon.hpp"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
class HumanB {
|
class HumanB {
|
||||||
public:
|
public:
|
||||||
HumanB(std::string name);
|
HumanB(std::string name);
|
||||||
~HumanB();
|
~HumanB();
|
||||||
|
|
@ -27,6 +27,6 @@ class HumanB {
|
||||||
std::string _name;
|
std::string _name;
|
||||||
bool _isArmed;
|
bool _isArmed;
|
||||||
Weapon *_weaponGiven;
|
Weapon *_weaponGiven;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -6,17 +6,17 @@
|
||||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/11/05 13:24:43 by rparodi #+# #+# */
|
/* Created: 2024/11/05 13:24:43 by rparodi #+# #+# */
|
||||||
/* Updated: 2024/11/05 14:25:09 by rparodi ### ########.fr */
|
/* Updated: 2024/12/23 12:38:07 by rparodi ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#ifndef WEAPON_HPP
|
#ifndef WEAPON_HPP
|
||||||
#define WEAPON_HPP
|
#define WEAPON_HPP
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
class Weapon {
|
class Weapon {
|
||||||
public:
|
public:
|
||||||
Weapon(std::string type);
|
Weapon(std::string type);
|
||||||
~Weapon();
|
~Weapon();
|
||||||
|
|
@ -24,14 +24,14 @@ class Weapon {
|
||||||
void setType(std::string type);
|
void setType(std::string type);
|
||||||
private:
|
private:
|
||||||
std::string _type;
|
std::string _type;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define CLR_RESET "\033[0m"
|
#define CLR_RESET "\033[0m"
|
||||||
|
|
||||||
#define CLR_YELLOW "\033[0;33m"
|
#define CLR_YELLOW "\033[0;33m"
|
||||||
#define CLR_GOLD "\033[38;5;220m"
|
#define CLR_GOLD "\033[38;5;220m"
|
||||||
|
|
||||||
#define CLR_BLUE "\033[0;34m"
|
#define CLR_BLUE "\033[0;34m"
|
||||||
#define CLR_CYAN "\033[0;36m"
|
#define CLR_CYAN "\033[0;36m"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -6,42 +6,42 @@
|
||||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/10/17 15:27:54 by rparodi #+# #+# */
|
/* Created: 2024/10/17 15:27:54 by rparodi #+# #+# */
|
||||||
/* Updated: 2024/10/17 15:48:22 by rparodi ### ########.fr */
|
/* Updated: 2024/12/23 12:37:37 by rparodi ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#ifndef COLOR_HPP
|
#ifndef COLOR_HPP
|
||||||
#define COLOR_HPP
|
#define COLOR_HPP
|
||||||
|
|
||||||
#define CLR_RESET "\033[0m"
|
#define CLR_RESET "\033[0m"
|
||||||
|
|
||||||
#define CLR_BLACK "\033[0;30m"
|
#define CLR_BLACK "\033[0;30m"
|
||||||
#define CLR_RED "\033[0;31m"
|
#define CLR_RED "\033[0;31m"
|
||||||
#define CLR_GREEN "\033[0;32m"
|
#define CLR_GREEN "\033[0;32m"
|
||||||
#define CLR_YELLOW "\033[0;33m"
|
#define CLR_YELLOW "\033[0;33m"
|
||||||
#define CLR_BLUE "\033[0;34m"
|
#define CLR_BLUE "\033[0;34m"
|
||||||
#define CLR_MAGENTA "\033[0;35m"
|
#define CLR_MAGENTA "\033[0;35m"
|
||||||
#define CLR_CYAN "\033[0;36m"
|
#define CLR_CYAN "\033[0;36m"
|
||||||
#define CLR_WHITE "\033[0;37m"
|
#define CLR_WHITE "\033[0;37m"
|
||||||
#define CLR_GOLD "\033[38;5;220m"
|
#define CLR_GOLD "\033[38;5;220m"
|
||||||
#define CLR_GREY "\033[38;5;240m"
|
#define CLR_GREY "\033[38;5;240m"
|
||||||
|
|
||||||
#define CLR_LIGHT_BLACK "\033[0;90m"
|
#define CLR_LIGHT_BLACK "\033[0;90m"
|
||||||
#define CLR_LIGHT_RED "\033[0;91m"
|
#define CLR_LIGHT_RED "\033[0;91m"
|
||||||
#define CLR_LIGHT_GREEN "\033[0;92m"
|
#define CLR_LIGHT_GREEN "\033[0;92m"
|
||||||
#define CLR_LIGHT_YELLOW "\033[0;93m"
|
#define CLR_LIGHT_YELLOW "\033[0;93m"
|
||||||
#define CLR_LIGHT_BLUE "\033[0;94m"
|
#define CLR_LIGHT_BLUE "\033[0;94m"
|
||||||
#define CLR_LIGHT_MAGENTA "\033[0;95m"
|
#define CLR_LIGHT_MAGENTA "\033[0;95m"
|
||||||
#define CLR_LIGHT_CYAN "\033[0;96m"
|
#define CLR_LIGHT_CYAN "\033[0;96m"
|
||||||
#define CLR_LIGHT_WHITE "\033[0;97m"
|
#define CLR_LIGHT_WHITE "\033[0;97m"
|
||||||
|
|
||||||
#define CLR_BOLD_BLACK "\033[1;30m"
|
#define CLR_BOLD_BLACK "\033[1;30m"
|
||||||
#define CLR_BOLD_RED "\033[1;31m"
|
#define CLR_BOLD_RED "\033[1;31m"
|
||||||
#define CLR_BOLD_GREEN "\033[1;32m"
|
#define CLR_BOLD_GREEN "\033[1;32m"
|
||||||
#define CLR_BOLD_YELLOW "\033[1;33m"
|
#define CLR_BOLD_YELLOW "\033[1;33m"
|
||||||
#define CLR_BOLD_BLUE "\033[1;34m"
|
#define CLR_BOLD_BLUE "\033[1;34m"
|
||||||
#define CLR_BOLD_MAGENTA "\033[1;35m"
|
#define CLR_BOLD_MAGENTA "\033[1;35m"
|
||||||
#define CLR_BOLD_CYAN "\033[1;36m"
|
#define CLR_BOLD_CYAN "\033[1;36m"
|
||||||
#define CLR_BOLD_WHITE "\033[1;37m"
|
#define CLR_BOLD_WHITE "\033[1;37m"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -6,18 +6,18 @@
|
||||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/11/05 15:26:18 by rparodi #+# #+# */
|
/* Created: 2024/11/05 15:26:18 by rparodi #+# #+# */
|
||||||
/* Updated: 2024/11/06 16:35:49 by rparodi ### ########.fr */
|
/* Updated: 2024/12/23 12:39:18 by rparodi ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#ifndef ERR_MSG_HPP
|
#ifndef ERR_MSG_HPP
|
||||||
# define ERR_MSG_HPP
|
#define ERR_MSG_HPP
|
||||||
|
|
||||||
#include "color.hpp"
|
#include "color.hpp"
|
||||||
|
|
||||||
#define ERR_PREFIX "Error:\n"
|
#define ERR_PREFIX "Error:\n"
|
||||||
#define ARGS_MISSING "Please give 3 arguments: <filename> <to_replace> <by_word> !"
|
#define ARGS_MISSING "Please give 3 arguments: <filename> <to_replace> <by_word> !"
|
||||||
#define FILE_CANT_OPEN ": The file cannot be open !"
|
#define FILE_CANT_OPEN ": The file cannot be open !"
|
||||||
#define FILE_CANT_READ ": The file connot be read !"
|
#define FILE_CANT_READ ": The file connot be read !"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -6,22 +6,22 @@
|
||||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/11/05 15:27:45 by rparodi #+# #+# */
|
/* Created: 2024/11/05 15:27:45 by rparodi #+# #+# */
|
||||||
/* Updated: 2024/11/06 15:56:45 by rparodi ### ########.fr */
|
/* Updated: 2024/12/23 12:36:59 by rparodi ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#ifndef SED_HPP
|
#ifndef SED_HPP
|
||||||
#define SED_HPP
|
#define SED_HPP
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <streambuf>
|
#include <streambuf>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
#include "err_msg.hpp"
|
#include "err_msg.hpp"
|
||||||
|
|
||||||
class Sed
|
class Sed
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Sed(char **argv, std::ifstream *input);
|
Sed(char **argv, std::ifstream *input);
|
||||||
~Sed();
|
~Sed();
|
||||||
|
|
@ -32,6 +32,6 @@ class Sed
|
||||||
std::string _to_replace;
|
std::string _to_replace;
|
||||||
std::string _by_word;
|
std::string _by_word;
|
||||||
std::ifstream *_input;
|
std::ifstream *_input;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -6,23 +6,23 @@
|
||||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/11/06 17:37:15 by rparodi #+# #+# */
|
/* Created: 2024/11/06 17:37:15 by rparodi #+# #+# */
|
||||||
/* Updated: 2024/11/06 19:43:33 by rparodi ### ########.fr */
|
/* Updated: 2024/12/23 12:37:09 by rparodi ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#ifndef HARL_HPP
|
#ifndef HARL_HPP
|
||||||
#define HARL_HPP
|
#define HARL_HPP
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#define DEBUG_MSG "I love having extra bacon for my 7XL-double-cheese-triple-pickle-special- ketchup burger. I really do!"
|
#define DEBUG_MSG "I love having extra bacon for my 7XL-double-cheese-triple-pickle-special- ketchup burger. I really do!"
|
||||||
#define ERROR_MSG "This is unacceptable! I want to speak to the manager now."
|
#define ERROR_MSG "This is unacceptable! I want to speak to the manager now."
|
||||||
#define INFO_MSG "I cannot believe adding extra bacon costs more money. You didn’t put enough bacon in my burger! If you did, I wouldn’t be asking for more!"
|
#define INFO_MSG "I cannot believe adding extra bacon costs more money. You didn’t put enough bacon in my burger! If you did, I wouldn’t be asking for more!"
|
||||||
#define WARN_MSG "I think I deserve to have some extra bacon for free. I’ve been coming for years whereas you started working here since last month."
|
#define WARN_MSG "I think I deserve to have some extra bacon for free. I’ve been coming for years whereas you started working here since last month."
|
||||||
|
|
||||||
class Harl
|
class Harl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Harl();
|
Harl();
|
||||||
~Harl();
|
~Harl();
|
||||||
|
|
@ -32,6 +32,6 @@ class Harl
|
||||||
void info(void);
|
void info(void);
|
||||||
void warning(void);
|
void warning(void);
|
||||||
void error(void);
|
void error(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -6,23 +6,23 @@
|
||||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/11/06 17:37:15 by rparodi #+# #+# */
|
/* Created: 2024/11/06 17:37:15 by rparodi #+# #+# */
|
||||||
/* Updated: 2024/11/06 19:43:33 by rparodi ### ########.fr */
|
/* Updated: 2024/12/23 12:37:22 by rparodi ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#ifndef HARL_HPP
|
#ifndef HARL_HPP
|
||||||
#define HARL_HPP
|
#define HARL_HPP
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#define DEBUG_MSG "I love having extra bacon for my 7XL-double-cheese-triple-pickle-special- ketchup burger. I really do!"
|
#define DEBUG_MSG "I love having extra bacon for my 7XL-double-cheese-triple-pickle-special- ketchup burger. I really do!"
|
||||||
#define ERROR_MSG "This is unacceptable! I want to speak to the manager now."
|
#define ERROR_MSG "This is unacceptable! I want to speak to the manager now."
|
||||||
#define INFO_MSG "I cannot believe adding extra bacon costs more money. You didn’t put enough bacon in my burger! If you did, I wouldn’t be asking for more!"
|
#define INFO_MSG "I cannot believe adding extra bacon costs more money. You didn’t put enough bacon in my burger! If you did, I wouldn’t be asking for more!"
|
||||||
#define WARN_MSG "I think I deserve to have some extra bacon for free. I’ve been coming for years whereas you started working here since last month."
|
#define WARN_MSG "I think I deserve to have some extra bacon for free. I’ve been coming for years whereas you started working here since last month."
|
||||||
|
|
||||||
class Harl
|
class Harl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Harl();
|
Harl();
|
||||||
~Harl();
|
~Harl();
|
||||||
|
|
@ -32,6 +32,6 @@ class Harl
|
||||||
void info(void);
|
void info(void);
|
||||||
void warning(void);
|
void warning(void);
|
||||||
void error(void);
|
void error(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue