Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Jsonize problems with maps
Jsonize problems with maps [message #36002] Wed, 18 April 2012 09:11 Go to previous message
Mindtraveller is currently offline  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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Little problem in util.cpp and simple solution
Next Topic: LoadFromXMLFile() proposal when file is not found
Goto Forum:
  


Current Time: Sat Apr 27 01:23:43 CEST 2024

Total time taken to generate the page: 0.06499 seconds