mFrame
載入中...
搜尋中...
無符合項目
Integers.h
1
7#ifndef MFRAME_E2DC1ED1_7C31_4A99_AF60_2B859E6190C9
8#define MFRAME_E2DC1ED1_7C31_4A99_AF60_2B859E6190C9
9
10/* ***************************************************************************************
11 * Include
12 */
13
14//----------------------------------------------------------------------------------------
15
16//----------------------------------------------------------------------------------------
17#include "./../lang/Object.h"
18#include "./../numb/Integer.h"
19
20/* ***************************************************************************************
21 * Namespace
22 */
23namespace mframe::numb {
24 class Integers;
25} // namespace mframe::numb
26
27/* ***************************************************************************************
28 * Class/Interface/Struct/Enum
29 */
31 /* *************************************************************************************
32 * Variable
33 */
34
35 /* *************************************************************************************
36 * Abstract Method
37 */
38
39 /* *************************************************************************************
40 * Construct Method
41 */
42 private:
46 Integers(void) = default;
47
51 virtual ~Integers(void) override = default;
52 /* *************************************************************************************
53 * Operator Method
54 */
55
56 /* *************************************************************************************
57 * Public Method <Override>
58 */
59
60 /* *************************************************************************************
61 * Public Method
62 */
63
64 /* *************************************************************************************
65 * Protected Method
66 */
67
68 /* *************************************************************************************
69 * Private Method
70 */
71
72 /* *************************************************************************************
73 * Static Variable
74 */
75
76 public:
77 static constexpr const char* const TEXT_MAX_VALUE = "+2147483647";
78 static constexpr const char* const TEXT_MIN_VALUE = "-2147483648";
79
80 static constexpr const int MAX_ASCII_VALUE =
81 static_cast<int>(sizeof("-2147483648"));
82
83 static constexpr const int MAX_ASCII_OCTAL =
84 static_cast<int>(sizeof("07777777777777777"));
85
86 static constexpr const int MAX_ASCII_HEX =
87 static_cast<int>(sizeof("0xFFFFFFFF"));
88
89 /* *************************************************************************************
90 * Static Method
91 */
92 public:
99 static inline uint32 castUnsigned(int value) {
100 return static_cast<uint32>(value);
101 }
102
109 static inline int castSigned(uint32 value) {
110 return static_cast<int>(value);
111 }
112
120 static bool isInteger(const char* str, int count = -1);
121
130 static bool parseInteger(int& result, const char* str);
131};
132
133/* ***************************************************************************************
134 * End of file
135 */
136
137#endif /* MFRAME_E2DC1ED1_7C31_4A99_AF60_2B859E6190C9 */
Definition Object.h:34
Definition Integers.h:30
static bool isInteger(const char *str, int count=-1)
static bool parseInteger(int &result, const char *str)
static int castSigned(uint32 value)
Definition Integers.h:109
static uint32 castUnsigned(int value)
Definition Integers.h:99
Definition Boolean.h:23