Refactor STParsedJSON to parse an object or array [RIPD-480]

The implementation of multi-sign has a SigningAccounts array as a
member of the outermost object.  This array could not be parsed
by the previous implementation of STParsedJSON, which only knew
how to parse objects.  This refactor supports the required parsing.

The refactor divides the parsing into three separate functions:

 o parseNoRecurse() which parses most rippled data types.
 o parseObject() which parses object types that may contain
   arbitrary other types.
 o parseArray() which parses object types that may contain
   arbitrary other types.

The change is required by the multi-sign implementation, but is
independent.  So the parsing change is going in as a separate
commit.

The parsing is still far from perfect.  But this was as much as
needs doing to accomplish the ends and mitigate risk of breaking
the parser.
This commit is contained in:
Scott Schurr
2014-10-09 15:12:02 -07:00
committed by Vinnie Falco
parent af24d541d1
commit 761902864a
7 changed files with 745 additions and 620 deletions

View File

@@ -324,7 +324,7 @@ Json::Value transactionSign (
}
}
STParsedJSON parsed ("tx_json", tx_json);
STParsedJSONObject parsed ("tx_json", tx_json);
if (!parsed.object.get())
{
jvResult ["error"] = parsed.error ["error"];