Skip to content

Instantly share code, notes, and snippets.

@jdoliner
Created October 14, 2011 21:18
Show Gist options
  • Save jdoliner/1288379 to your computer and use it in GitHub Desktop.
Save jdoliner/1288379 to your computer and use it in GitHub Desktop.
json_spirit Object example
inline
std::string GetVillageOwnerJson(Player p, const std::vector<std::string> &properties)
{
json_spirit::Object root;
//std::vector< json_spirit::Pair > root;
BOOST_FOREACH(std::string f, properties)
{
if(IsValidPlayerProperty(f))
{
root[f] = GetPlayerPropertyValue
//root.push_back(json_spirit::Pair(f, GetPlayerPropertyValue(p, f)));
}
}
return json_spirit::write(root);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment