JSON library fix for empty-named objects. Also, stuff Erik did that I don't fully understand, but he made me amend his commit :'(

This commit is contained in:
Thulinma 2013-07-01 15:08:15 +02:00
parent 526feda148
commit 3e559fdffd
3 changed files with 30 additions and 91 deletions

View file

@ -442,10 +442,12 @@ std::string JSON::Value::toPacked(){
r += 0xE0;
if (objVal.size() > 0){
for (JSON::ObjIter it = objVal.begin(); it != objVal.end(); it++){
r += it->first.size() / 256;
r += it->first.size() % 256;
r += it->first;
r += it->second.toPacked();
if (it->first.size() > 0){
r += it->first.size() / 256;
r += it->first.size() % 256;
r += it->first;
r += it->second.toPacked();
}
}
}
r += (char)0x0;