I am using Jsoncpp to write a Json::value to a string using the Json::FastWriter.
string s;
s.append("me?json=");
val["firstname"] = firstname;
val["lastname"] = lastname;
val["x"] = me->myPos.X;
val["y"] = me->myPos.Y;
val["z"] = me->myPos.Z;
val["lookx"] = me->myOri.X;
val["looky"] = me->myOri.Y;
val["lookz"] = me->myOri.Z;
url.append(writer.write(val));
The problem is they don't appear in the string as in the order that I added them to the Json::value val, they seem to be alphabetically sorted depending on the first letter in each element("firstname, lastname, lookx, looky, lookz,x",etc). How do you prevent this? I want it to be added in the order that I add it to the Json::value and NOT be sorted.
If this is not possible, how would one alter the source code to achieve it?
Thanks