Populating JSON array requires direct store manipulation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zorba |
Fix Released
|
Medium
|
Markos Zaharioudakis |
Bug Description
New bug description:
The only way to create a JSON array item with members is to first create the item, then populate it by manipulating the store using Store::
Original bug description:
If you are creating JSON items via the store API, the only way to add members to an array is to use the "no-copy copy()" trick, calling copy() on the member Item and passing a store::CopyMode with theDoCopy set to false.
However, copy() is not implemented for Items of atomic types (at least integer and string), so there is no way at all to create a JSON array with strings or integers as members. This of course means there's no way to do it with the public C++ API either.
Changed in zorba: | |
importance: | Critical → Medium |
milestone: | 2.2 → none |
assignee: | Chris Hillery (ceejatec) → Markos Zaharioudakis (markos-za) |
summary: |
- No way to populate JSON array with atomic values via store API + Populating JSON array requires direct store manipulation |
Changed in zorba: | |
status: | Fix Committed → Fix Released |
The way to do this is to first create an empty array, and then use the zorba:: store:: Store:: populateJSONArr ay() method.