Debugger: Add Number class for expression usage.
- This class abstracts out the underlying type of a value, and handles all the basic mathematical logical operators accordingly. Replaces the MAPM type previously used for these respective operations.
This commit is contained in:
@@ -219,6 +219,7 @@ Application Debugger :
|
|||||||
|
|
||||||
# types
|
# types
|
||||||
ArrayIndexPath.cpp
|
ArrayIndexPath.cpp
|
||||||
|
Number.cpp
|
||||||
TargetAddressRangeList.cpp
|
TargetAddressRangeList.cpp
|
||||||
ValueLocation.cpp
|
ValueLocation.cpp
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,56 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2014, Rene Gollent, [email protected].
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
#ifndef NUMBER_H
|
||||||
|
#define NUMBER_H
|
||||||
|
|
||||||
|
#include <TypeConstants.h>
|
||||||
|
|
||||||
|
#include "Variant.h"
|
||||||
|
|
||||||
|
|
||||||
|
class BString;
|
||||||
|
|
||||||
|
|
||||||
|
class Number {
|
||||||
|
public:
|
||||||
|
Number();
|
||||||
|
virtual ~Number();
|
||||||
|
Number(type_code type, const BString& value);
|
||||||
|
Number(const BVariant& value);
|
||||||
|
Number(const Number& other);
|
||||||
|
|
||||||
|
void SetTo(type_code type, const BString& value,
|
||||||
|
int32 base = 10);
|
||||||
|
void SetTo(const BVariant& value);
|
||||||
|
|
||||||
|
Number& operator=(const Number& rhs);
|
||||||
|
Number& operator+=(const Number& rhs);
|
||||||
|
Number& operator-=(const Number& rhs);
|
||||||
|
Number& operator/=(const Number& rhs);
|
||||||
|
Number& operator*=(const Number& rhs);
|
||||||
|
Number& operator%=(const Number& rhs);
|
||||||
|
|
||||||
|
Number& operator&=(const Number& rhs);
|
||||||
|
Number& operator|=(const Number& rhs);
|
||||||
|
Number& operator^=(const Number& rhs);
|
||||||
|
|
||||||
|
Number operator-() const;
|
||||||
|
Number operator~() const;
|
||||||
|
|
||||||
|
int operator<(const Number& rhs) const;
|
||||||
|
int operator<=(const Number& rhs) const;
|
||||||
|
int operator>(const Number& rhs) const;
|
||||||
|
int operator>=(const Number& rhs) const;
|
||||||
|
int operator==(const Number& rhs) const;
|
||||||
|
int operator!=(const Number& rhs) const;
|
||||||
|
|
||||||
|
BVariant GetValue() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
BVariant fValue;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif // NUMBER_H
|
||||||
Reference in New Issue
Block a user