libnative-utilities/include/utils/Integer.hpp
2024-08-15 18:40:30 +08:00

36 lines
847 B
C++

#ifndef INTEGER_HPP
#define INTEGER_HPP
#define INTEGER_MAX_LENGTH 20
#define HEX_MAX_LENGTH 18
class Integer{
private:
Integer();
public:
static const char hexChars[17];
static int getIntegerLength(const long long int arg);
static long long int parseInteger(const char* str);
static long long int parseHex(const char* str);
static char* toString(const long long int arg);
static int toString(const long long int arg, char* buffer, const unsigned int buffer_size);
static char* toHexString(const unsigned long long arg);
static char* toHexString(const unsigned long long int arg, unsigned int format);
static int toHexString(const unsigned long long int arg, const unsigned int format, char* buffer, const unsigned int bufferSize);
};
#endif // INTEGER_HPP