STAmount::setJson to allow amounts to be set in place.

This commit is contained in:
JoelKatz
2013-05-13 16:35:21 -07:00
parent fdf669035e
commit 0366fd87a1
2 changed files with 9 additions and 3 deletions

View File

@@ -1223,9 +1223,9 @@ void STAmount::roundSelf()
}
}
Json::Value STAmount::getJson(int) const
void STAmount::setJson(Json::Value& elem) const
{
Json::Value elem(Json::objectValue);
elem = Json::objectValue;
if (!mIsNative)
{
@@ -1237,9 +1237,14 @@ Json::Value STAmount::getJson(int) const
}
else
{
elem=getText();
elem = getText();
}
}
Json::Value STAmount::getJson(int) const
{
Json::Value elem;
setJson(elem);
return elem;
}

View File

@@ -473,6 +473,7 @@ public:
static bool issuerFromString(uint160& uDstIssuer, const std::string& sIssuer);
Json::Value getJson(int) const;
void setJson(Json::Value&) const;
STAmount getRound() const;
void roundSelf();