Skip to content

JSON::Query an JSON::Object #99

@MarkusAdam

Description

@MarkusAdam

Hello

I'm using Release version 1.5.1 compiled with Visual Studio 2005.

If i query an Object, the result is not as expected. If i make the same with a pointer to the object the result is as expected. The problem can be reproduced with the following sample code.

Poco::JSON::Object obj;
Poco::JSON::Object::Ptr pObj = &obj;

pObj->set("Id", 22);

//Query ok (Object::Ptr)
Poco::JSON::Query queryPointer(pObj);
Poco::Dynamic::Var idQueryPointer = queryPointer.find("Id");
int nIdPointer = idQueryPointer;

//Query fails (Object)
Poco::JSON::Query queryObj(obj);
Poco::Dynamic::Var idQueryObj = queryObj.find("Id");
int nIdObj = idQueryObj;  //Throws BadCastException("Can not convert to Int32");

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions