49 lines
2.1 KiB
C++
49 lines
2.1 KiB
C++
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* 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
|