mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Add getJson() for STVector256.
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
#include "SerializedObject.h"
|
#include "SerializedObject.h"
|
||||||
|
|
||||||
|
#include <boost/foreach.hpp>
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
|
|
||||||
#include "../json/writer.h"
|
#include "../json/writer.h"
|
||||||
@@ -654,6 +655,18 @@ Json::Value STObject::getJson(int options) const
|
|||||||
return ret;
|
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] =
|
static SOElement testSOElements[2][16] =
|
||||||
{ // field, name, id, type, flags
|
{ // field, name, id, type, flags
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -640,6 +640,8 @@ public:
|
|||||||
|
|
||||||
void setValue(const STVector256& v) { mValue = v.mValue; }
|
void setValue(const STVector256& v) { mValue = v.mValue; }
|
||||||
void setValue(const std::vector<uint256>& v) { mValue = v; }
|
void setValue(const std::vector<uint256>& v) { mValue = v; }
|
||||||
|
|
||||||
|
Json::Value getJson(int) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user