mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
STPathElement and STPath classes. Better Json-ization of serialized types.
This commit is contained in:
@@ -42,6 +42,9 @@ std::auto_ptr<SerializedType> STObject::makeDefaultObject(SerializedTypeID id, c
|
||||
case STI_ACCOUNT:
|
||||
return std::auto_ptr<SerializedType>(new STAccount(name));
|
||||
|
||||
case STI_PATH:
|
||||
return std::auto_ptr<SerializedType>(new STPath(name));
|
||||
|
||||
default:
|
||||
throw std::runtime_error("Unknown object type");
|
||||
}
|
||||
@@ -85,6 +88,9 @@ std::auto_ptr<SerializedType> STObject::makeDeserializedObject(SerializedTypeID
|
||||
case STI_ACCOUNT:
|
||||
return STAccount::deserialize(sit, name);
|
||||
|
||||
case STI_PATH:
|
||||
return STPath::deserialize(sit, name);
|
||||
|
||||
default:
|
||||
throw std::runtime_error("Unknown object type");
|
||||
}
|
||||
@@ -568,8 +574,8 @@ Json::Value STObject::getJson(int options) const
|
||||
if (it->getSType() != STI_NOTPRESENT)
|
||||
{
|
||||
if (it->getName() == NULL)
|
||||
ret[boost::lexical_cast<std::string>(index)] = it->getText();
|
||||
else ret[it->getName()] = it->getText();
|
||||
ret[boost::lexical_cast<std::string>(index)] = it->getJson(options);
|
||||
else ret[it->getName()] = it->getJson(options);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user