Add string support for currencies to STAmount.

This commit is contained in:
Arthur Britto
2012-05-19 18:16:13 -07:00
parent 230ee34b24
commit 82085f0264
2 changed files with 148 additions and 0 deletions

View File

@@ -228,10 +228,12 @@ public:
int getOffset() const { return mOffset; }
uint64 getValue() const { return mValue; }
void setValue(const STAmount& v) { mValue=v; }
std::string getCurrencyHuman();
bool isNative() const { return mIsNative; }
const uint160& getCurrency() const { return mCurrency; }
void zero() { mOffset = mIsNative ? -100 : 0; mValue = 0; }
bool isZero() const { return mValue == 0; }
bool setValue(const std::string& sAmount, const std::string& sCurrency);
virtual bool isEquivalent(const SerializedType& t) const;
@@ -275,6 +277,7 @@ public:
const char *name = NULL);
static STAmount deSerialize(SerializerIterator&);
static bool currencyFromString(uint160& uDstCurrency, const std::string& sCurrency);
};
class STHash128 : public SerializedType