Use jss for many Json fields.

* Document JsonFields.
  * Remove some unused JsonFields values.
This commit is contained in:
Tom Ritchford
2015-02-10 16:54:27 -05:00
parent 558c6b621b
commit 315a8b6b60
82 changed files with 1449 additions and 869 deletions

View File

@@ -166,7 +166,7 @@ Json::Value make_error (error_code_i code, std::string const& message)
bool contains_error (Json::Value const& json)
{
if (json.isObject() && json.isMember ("error"))
if (json.isObject() && json.isMember (jss::error))
return true;
return false;
}

View File

@@ -876,7 +876,7 @@ amountFromJson (SField::ref name, Json::Value const& v)
if (v.isObject ())
{
WriteLog (lsTRACE, STAmount) <<
"value='" << v["value"].asString () <<
"value='" << v[jss::value].asString () <<
"', currency='" << v["currency"].asString () <<
"', issuer='" << v["issuer"].asString () <<
"')";

View File

@@ -113,7 +113,7 @@ Json::Value STLedgerEntry::getJson (int options) const
{
Json::Value ret (STObject::getJson (options));
ret["index"] = to_string (mIndex);
ret[jss::index] = to_string (mIndex);
return ret;
}

View File

@@ -221,7 +221,7 @@ void STTx::setSourceAccount (RippleAddress const& naSource)
Json::Value STTx::getJson (int) const
{
Json::Value ret = STObject::getJson (0);
ret["hash"] = to_string (getTransactionID ());
ret[jss::hash] = to_string (getTransactionID ());
return ret;
}
@@ -231,8 +231,8 @@ Json::Value STTx::getJson (int options, bool binary) const
{
Json::Value ret;
Serializer s = STObject::getSerializer ();
ret["tx"] = strHex (s.peekData ());
ret["hash"] = to_string (getTransactionID ());
ret[jss::tx] = strHex (s.peekData ());
ret[jss::hash] = to_string (getTransactionID ());
return ret;
}
return getJson(options);