-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScalarConverter.hpp
More file actions
50 lines (42 loc) · 1.87 KB
/
ScalarConverter.hpp
File metadata and controls
50 lines (42 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ScalarConverter.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: zelhajou <zelhajou@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/31 17:09:48 by zelhajou #+# #+# */
/* Updated: 2025/01/02 17:25:30 by zelhajou ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef SCALARCONVERTER_HPP
#define SCALARCONVERTER_HPP
#include <string>
#include <iostream>
#include <limits>
#include <cstdlib>
#include <cmath>
class ScalarConverter
{
private:
ScalarConverter();
ScalarConverter(ScalarConverter const ©);
ScalarConverter &operator=(const ScalarConverter &src);
public:
~ScalarConverter();
static void convert(const std::string &literal);
private:
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);
static void convertChar(const std::string &literal);
static void convertInt(const std::string &literal);
static void convertFloat(const std::string &literal);
static void convertDouble(const std::string &literal);
static void printChar(char value);
static void printInt(int value);
static void printFloat(float value);
static void printDouble(double value);
};
#endif