| 602 | } |
| 603 | |
| 604 | json_t* dataToJson() override |
| 605 | { |
| 606 | if (fCarlaHostHandle == nullptr) |
| 607 | return nullptr; |
| 608 | |
| 609 | CarlaEngine* const engine = carla_get_engine_from_handle(fCarlaHostHandle); |
| 610 | |
| 611 | water::MemoryOutputStream projectState; |
| 612 | engine->saveProjectInternal(projectState); |
| 613 | |
| 614 | const size_t dataSize = projectState.getDataSize(); |
| 615 | #ifndef CARDINAL_SYSDEPS |
| 616 | return jsonp_stringn_nocheck_own(static_cast<const char*>(projectState.getDataAndRelease()), dataSize); |
| 617 | #else |
| 618 | return json_stringn(static_cast<const char*>(projectState.getData()), dataSize); |
| 619 | #endif |
| 620 | } |
| 621 | |
| 622 | void dataFromJson(json_t* const rootJ) override |
| 623 | { |