Closed GoogleCodeExporter closed 8 years ago
This looks wrong:
aes67.AddMember("devices", newValue, jsonDoc.GetAllocator());
jsonDoc["devices"].SetArray(); // (*)
rapidjson::Value& devices = jsonDoc["devices"];
You probably meant to use aes67 here instead of jsonDoc:
newValue.SetArray();
aes67.AddMember("devices", newValue, jsonDoc.GetAllocator());
rapidjson::Value& devices = aes67["devices"];
IIRC, requesting the non-existent member "devices" in jsonDoc (*) should have
raised an assertion. Do you compile with assertions disabled? This would be a
bad idea for debugging...
hth,
Philipp
Original comment by philipp....@gmail.com
on 21 Mar 2014 at 12:51
Oh, thank you very much.
I'm sorry to have posted this.
I can't unfortunately enable exceptions on my embedded platform, they are not
supported.
Thanks for your help.
Kind regards,
Roberto
Original comment by rbarbier...@gmail.com
on 21 Mar 2014 at 1:09
An "assertion" is not an "exception", it's just a check followed by a function
call (e.g. printing a message and calling abort()).
#ifndef RAPIDJSON_ASSERT
#include <cassert>
#define RAPIDJSON_ASSERT(x) assert(x)
#endif // RAPIDJSON_ASSERT
If your platform doesn't support "assert()", you can provide your own
RAPIDJSON_ASSERT macro which lets you at least put a breakpoint in the debugger:
void assertion_failed( const char* expr, const char* file, int line );
#define RAPIDJSON_ASSERT(Expr)
((void)((Expr) ? 0 : (assertion_failed( #Expr, __FILE__, __LINE__ ), 0)))
/Philipp
Original comment by philipp....@gmail.com
on 21 Mar 2014 at 1:50
Sorry, I read wrong. That I can certainly do.
Thanks a lot for your help.
R.,
R.
Original comment by rbarbier...@gmail.com
on 21 Mar 2014 at 2:00
Original comment by milo...@gmail.com
on 20 Jun 2014 at 11:20
Original issue reported on code.google.com by
rbarbier...@gmail.com
on 21 Mar 2014 at 9:24