mFrame
載入中...
搜尋中...
無符合項目
Byte.h
1
8#ifndef MFRAME_F9B57639_6FC2_4ABB_B8EB_618F2228B096
9#define MFRAME_F9B57639_6FC2_4ABB_B8EB_618F2228B096
10
11/* ***************************************************************************************
12 * Include
13 */
14
15//----------------------------------------------------------------------------------------
16
17//----------------------------------------------------------------------------------------
18#include "./../numb/Number.h"
19
20/* ***************************************************************************************
21 * Namespace
22 */
23namespace mframe::numb {
24 class Byte;
25} // namespace mframe::numb
26
27/* ***************************************************************************************
28 * Class Byte
29 */
31 /* *************************************************************************************
32 * Variable
33 */
34
35 /* *************************************************************************************
36 * Abstract Method
37 */
38
39 /* *************************************************************************************
40 * Construct Method
41 */
42 public:
47 Byte(void);
48
54 Byte(char value);
55
60 virtual ~Byte(void) override;
61
62 /* *************************************************************************************
63 * Operator Method
64 */
65 public:
70 inline operator char(void) {
71 return this->vValue.s8[0];
72 }
73
81 bool operator==(char v) {
82 return (this->vValue.s8[0] == static_cast<char>(v));
83 }
84
92 bool operator==(Byte& v) {
93 return (this->vValue.s8[0] == v.vValue.s8[0]);
94 }
95
102 char operator=(char v) {
103 this->vValue.s8[0] = v;
104 return this->vValue.s8[0];
105 }
106
114 this->vValue.s8[0] += v;
115 return *this;
116 }
117
125 this->vValue.s8[0] -= v;
126 return *this;
127 }
128
136 this->vValue.s8[0] *= v;
137 return *this;
138 }
139
147 this->vValue.s8[0] /= v;
148 return *this;
149 }
150
157 Byte tmp = *this;
158 ++this->vValue.s8[0];
159 return tmp;
160 }
161
168 ++this->vValue.s8[0];
169 return *this;
170 }
171
178 Byte tmp = *this;
179 --this->vValue.s8[0];
180 return tmp;
181 }
182
189 --this->vValue.s8[0];
190 return *this;
191 }
192
193 /* *************************************************************************************
194 * Public Method <Override>
195 */
196
197 /* *************************************************************************************
198 * Public Method
199 */
200
201 /* *************************************************************************************
202 * Protected Method
203 */
204
205 /* *************************************************************************************
206 * Private Method
207 */
208
209 /* *************************************************************************************
210 * Static Variable
211 */
212
213 /* *************************************************************************************
214 * Static Method
215 */
216};
217
218/* ***************************************************************************************
219 * End of file
220 */
221
222#endif /* MFRAME_F9B57639_6FC2_4ABB_B8EB_618F2228B096 */
Definition Byte.h:30
Byte operator/=(int v)
Definition Byte.h:146
bool operator==(char v)
Definition Byte.h:81
virtual ~Byte(void) override
Destroy the Byte object.
Byte operator+=(int v)
Definition Byte.h:113
Byte operator++()
Definition Byte.h:167
char operator=(char v)
Definition Byte.h:102
Byte & operator--(void)
Definition Byte.h:188
Byte operator--(int)
Definition Byte.h:177
Byte operator++(int)
Definition Byte.h:156
Byte(void)
Construct a new Byte object.
bool operator==(Byte &v)
Definition Byte.h:92
Byte(char value)
Construct a new Byte object.
Byte operator-=(int v)
Definition Byte.h:124
Byte operator*=(int v)
Definition Byte.h:135
Definition Number.h:30
Definition Boolean.h:23