Home » U++ Library support » U++ Core » Jsonize problems with maps
Jsonize problems with maps [message #36002] |
Wed, 18 April 2012 09:11 |
Mindtraveller
Messages: 917 Registered: August 2007 Location: Russia, Moscow rgn.
|
Experienced Contributor |
|
|
There's a problem with maps jsonization.
Small example:#include <Core/Core.h>
using namespace Upp;
struct TestStruct
{
VectorMap<String,String> map;
void Jsonize(JsonIO &json)
{
json("map",map); //compile error!
}
};
CONSOLE_APP_MAIN
{
StoreAsJson(TestStruct());
}
Actually, I found 2 problems with jsonizing the Maps.
1) It doesn't actually compile (strange!)
2) Even if it compiled, json representation of such map is not optimal. IMO there must be special version for maps with string keys. It will make possible using native json way for representing such maps:
{ "key1":value1, "key2":value2, ... }
[Updated on: Wed, 18 April 2012 09:15] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sat May 11 10:14:00 CEST 2024
Total time taken to generate the page: 0.02232 seconds
|