Difference between revisions of "Json parser and writer"

From VCMI Project Wiki
Jump to: navigation, search
m
Line 4: Line 4:
 
Main class JsonNode represents one "node" from Json file (array, string, etc.).
 
Main class JsonNode represents one "node" from Json file (array, string, etc.).
 
Basic usage:
 
Basic usage:
<pre>
+
<syntaxhighlight lang="cpp">
 
const JsonNode node("some_config.json");
 
const JsonNode node("some_config.json");
 
std::string value = node["value"].String();
 
std::string value = node["value"].String();
</pre>
+
</syntaxhighlight>
  
 
===File formats===
 
===File formats===

Revision as of 15:06, 14 December 2012

Capable of error checking and basic error recovery. Also have optional schema validation. Located at lib/JsonNode.h. Currently supports only local encoding - no conversion from unicode.

Main class JsonNode represents one "node" from Json file (array, string, etc.). Basic usage:

const JsonNode node("some_config.json");
std::string value = node["value"].String();

File formats