ready to switch to OO serialization

This commit is contained in:
woodser
2019-06-07 08:57:50 -04:00
parent d60c3aa06d
commit 1a0fd84872
2 changed files with 10 additions and 0 deletions
+1
View File
@@ -150,6 +150,7 @@ boost::property_tree::ptree MoneroUtils::toPropertyTree(const MoneroBlock& block
cout << "toPropertyTree(block)" << endl;
boost::property_tree::ptree blockNode;
if (block.height != boost::none) blockNode.put("height", *block.height); // TODO: finish this, add txs
//blockNode.add_child("txs", toPropertyTree(block.txs)); // TODO: block.txs is vector<shared_ptr<MoneroTx>> so need to handle
return blockNode;
}
+9
View File
@@ -84,6 +84,15 @@ namespace MoneroUtils
return typeNodes;
}
// template <class T*> boost::property_tree::ptree toPropertyTree(const vector<T*> types) {
// cout << "toPropertyTree(types*)" << endl;
// boost::property_tree::ptree typeNodes;
// for (const auto& type : types) {
// typeNodes.push_back(std::make_pair("", toPropertyTree(type)));
// }
// return typeNodes;
// }
/**
* Modified from core_rpc_server.cpp to return a string.
*