I have a simple code which is not working and I don't really know why... here it's:
std::wstring CDbFilterSerializer::DeserializeFromString(const std::wstring& jsonStr)
{
std::wistringstream ss{ jsonStr };
boost::property_tree::read_json(ss, m_root);
return m_root.data();
}
The problem here is that after calling m_root.read_json(...) the wptre object is empty. The return statement is an example, cause the real code after populating the wptree object, I call m_root.get("MyKey") to start reading values and this throw an exception cause the object is empty.
The json received as parameter is:
{
"type":{
"className":"NumericFilterSerializerHelper: NumericType => unsigned int, DbSerializer => class CDbFilterSerializerByNumericValue",
"description":""
},
"data":{
"int_number":"45"
}
}
Is there something wrong here?