ex00 and ex01
This commit is contained in:
48
ex00/ScalarConverter/ScalarConverter.hpp
Normal file
48
ex00/ScalarConverter/ScalarConverter.hpp
Normal file
@@ -0,0 +1,48 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ScalarConverter.hpp :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: aortigos <aortigos@student.42malaga.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2026/02/28 20:03:23 by aortigos #+# #+# */
|
||||
/* Updated: 2026/02/28 20:03:23 by aortigos ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef SCALARCONVERTER_HPP
|
||||
|
||||
# define SCALARCONVERTER_HPP
|
||||
|
||||
# include <iostream> // STD::
|
||||
# include <climits> // INT_INT & INT_MAX
|
||||
# include <cstdlib> // strtol
|
||||
# include <iomanip>
|
||||
|
||||
class ScalarConverter
|
||||
{
|
||||
private:
|
||||
ScalarConverter();
|
||||
ScalarConverter(const ScalarConverter &other);
|
||||
ScalarConverter& operator=(const ScalarConverter &other);
|
||||
~ScalarConverter();
|
||||
public:
|
||||
// Main function
|
||||
static void convert(const std::string &literal);
|
||||
|
||||
// Checkers
|
||||
static bool isSpecialCase(const std::string &literal);
|
||||
static bool isChar(const std::string &literal);
|
||||
static bool isInt(const std::string &literal);
|
||||
static bool isFloat(const std::string &literal);
|
||||
static bool isDouble(const std::string &literal);
|
||||
|
||||
// Converters
|
||||
static void convertFromSpecialCase(const std::string &literal);
|
||||
static void convertFromChar(const std::string &literal);
|
||||
static void convertFromInt(const std::string &literal);
|
||||
static void convertFromFloat(const std::string &literal);
|
||||
static void convertFromDouble(const std::string &literal);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user