I have some json string come from c++, std::multimap<double,std::string>,this json string such as:
"{"name":"mark","data":[1,2,3,4],"some":"11.1":"Hello","22.2":",","44.4":"World"}}".
When I try to use mormot to deserialize this JSON string, it is failure, I don’t have a appropriate struct to receive it!
So, in Delphi, How can I deserialize this json string :"{"1.1":"Hello","2.2":"world"}" to TDictionary<double,string>?
2
Answers
this is my test code,it can work now.thanks!
TDstring = TDictionary<double, string>;
I am sure there are many ways of doing this. We use the SuperObject library.
Include SuperObject in your uses clause and then you can parse your object and access the values like this…
If you don’t know the key:value pairs in advance you can iterate over the object like this.