@@ -21,12 +21,12 @@ EitherType::~EitherType() {
21
21
}
22
22
23
23
EitherType::operator bool () const { return value_->boolValue (); }
24
- EitherType::operator unsigned () const { return value_->unsignedValue (); }
25
- EitherType::operator unsigned long int () const {
24
+ EitherType::operator uint32_t () const { return value_->unsignedValue (); }
25
+ EitherType::operator uint64_t () const {
26
26
return value_->unsignedlongintValue ();
27
27
}
28
- EitherType::operator int () const { return value_->intValue (); }
29
- EitherType::operator long int () const { return value_->longintValue (); }
28
+ EitherType::operator int32_t () const { return value_->intValue (); }
29
+ EitherType::operator int64_t () const { return value_->longintValue (); }
30
30
EitherType::operator float () const { return value_->floatValue (); }
31
31
EitherType::operator double () const { return value_->doubleValue (); }
32
32
EitherType::operator std::string () const { return value_->stringValue (); }
@@ -42,16 +42,16 @@ void Value::deleteValue() {
42
42
delete (const bool *)value_;
43
43
break ;
44
44
case UNSIGNED:
45
- delete (const unsigned *)value_;
45
+ delete (const uint32_t *)value_;
46
46
break ;
47
47
case UNSIGNEDLONGINT:
48
- delete (const unsigned long int *)value_;
48
+ delete (const uint64_t *)value_;
49
49
break ;
50
50
case INT:
51
- delete (const int *)value_;
51
+ delete (const int32_t *)value_;
52
52
break ;
53
53
case LONGINT:
54
- delete (const long int *)value_;
54
+ delete (const int64_t *)value_;
55
55
break ;
56
56
case FLOAT:
57
57
delete (const float *)value_;
@@ -85,11 +85,13 @@ void Value::deleteValue() {
85
85
Value::~Value () { deleteValue (); }
86
86
87
87
Value::Value (const bool &value) : type_(BOOL), value_(new bool (value)) {}
88
- Value::Value (const unsigned &value)
89
- : type_(UNSIGNED), value_(new unsigned (value)) {}
90
- Value::Value (const unsigned long int &value)
91
- : type_(UNSIGNEDLONGINT), value_(new unsigned long int (value)) {}
92
- Value::Value (const int &value) : type_(INT), value_(new int (value)) {}
88
+ Value::Value (const uint32_t &value)
89
+ : type_(UNSIGNED), value_(new uint32_t (value)) {}
90
+ Value::Value (const uint64_t &value)
91
+ : type_(UNSIGNEDLONGINT), value_(new uint64_t (value)) {}
92
+ Value::Value (const int32_t &value) : type_(INT), value_(new int32_t (value)) {}
93
+ Value::Value (const int64_t &value) : type_(LONGINT), value_(new int64_t (value))
94
+ {}
93
95
Value::Value (const float &value) : type_(FLOAT), value_(new float (value)) {}
94
96
Value::Value (const double &value) : type_(DOUBLE), value_(new double (value)) {}
95
97
Value::Value (const std::string &value)
@@ -206,25 +208,25 @@ bool Value::boolValue() const {
206
208
throw ExceptionAbstract (ExceptionAbstract::TOOLS, " value is not an bool" );
207
209
}
208
210
209
- unsigned Value::unsignedValue () const {
210
- if (type_ == UNSIGNED) return *((const unsigned *)value_);
211
+ uint32_t Value::unsignedValue () const {
212
+ if (type_ == UNSIGNED) return *((const uint32_t *)value_);
211
213
throw ExceptionAbstract (ExceptionAbstract::TOOLS,
212
214
" value is not an unsigned int" );
213
215
}
214
216
215
- unsigned long int Value::unsignedlongintValue () const {
216
- if (type_ == UNSIGNEDLONGINT) return *((const unsigned long int *)value_);
217
+ uint64_t Value::unsignedlongintValue () const {
218
+ if (type_ == UNSIGNEDLONGINT) return *((const uint64_t *)value_);
217
219
throw ExceptionAbstract (ExceptionAbstract::TOOLS,
218
220
" value is not an unsigned long int" );
219
221
}
220
222
221
- long int Value::longintValue () const {
222
- if (type_ == LONGINT) return *((const long int *)value_);
223
+ int64_t Value::longintValue () const {
224
+ if (type_ == LONGINT) return *((const int64_t *)value_);
223
225
throw ExceptionAbstract (ExceptionAbstract::TOOLS, " value is not an long int" );
224
226
}
225
227
226
- int Value::intValue () const {
227
- if (type_ == INT) return *((const int *)value_);
228
+ int32_t Value::intValue () const {
229
+ if (type_ == INT) return *((const int32_t *)value_);
228
230
throw ExceptionAbstract (ExceptionAbstract::TOOLS, " value is not an int" );
229
231
}
230
232
@@ -356,12 +358,14 @@ std::ostream &operator<<(std::ostream &os, const Value &value) {
356
358
template <>
357
359
const Value::Type ValueHelper<bool >::TypeID = Value::BOOL;
358
360
template <>
359
- const Value::Type ValueHelper<unsigned >::TypeID = Value::UNSIGNED;
361
+ const Value::Type ValueHelper<uint32_t >::TypeID = Value::UNSIGNED;
360
362
template <>
361
- const Value::Type ValueHelper<unsigned long int >::TypeID =
363
+ const Value::Type ValueHelper<uint64_t >::TypeID =
362
364
Value::UNSIGNEDLONGINT;
363
365
template <>
364
- const Value::Type ValueHelper<int >::TypeID = Value::INT;
366
+ const Value::Type ValueHelper<int32_t >::TypeID = Value::INT;
367
+ template <>
368
+ const Value::Type ValueHelper<int64_t >::TypeID = Value::LONGINT;
365
369
template <>
366
370
const Value::Type ValueHelper<float >::TypeID = Value::FLOAT;
367
371
template <>
0 commit comments