Add getJson() for STVector256.

This commit is contained in:
Arthur Britto
2012-07-07 19:43:20 -07:00
parent 74fdafb688
commit a0422631a2
2 changed files with 15 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
#include "SerializedObject.h"
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include "../json/writer.h"
@@ -654,6 +655,18 @@ Json::Value STObject::getJson(int options) const
return ret;
}
Json::Value STVector256::getJson(int options) const
{
Json::Value ret(Json::arrayValue);
BOOST_FOREACH(std::vector<uint256>::const_iterator::value_type vEntry, mValue)
{
ret.append(vEntry.ToString());
}
return ret;
}
static SOElement testSOElements[2][16] =
{ // field, name, id, type, flags
{

View File

@@ -640,6 +640,8 @@ public:
void setValue(const STVector256& v) { mValue = v.mValue; }
void setValue(const std::vector<uint256>& v) { mValue = v; }
Json::Value getJson(int) const;
};
#endif