| 679 | } |
| 680 | |
| 681 | JsonWrapper stringToJson(const std::string& str) { |
| 682 | yyjson_read_err err; |
| 683 | auto json = yyjson_read_opts(const_cast<char*>(str.c_str()), str.size(), 0, nullptr, &err); |
| 684 | if (json == nullptr) { |
| 685 | invalidJsonError(str.c_str(), str.size(), &err); |
| 686 | } |
| 687 | return JsonWrapper(json); |
| 688 | } |
| 689 | |
| 690 | JsonWrapper stringToJsonNoError(const std::string& str) { |
| 691 | return JsonWrapper(yyjson_read(str.c_str(), str.size(), 0 /* flg */)); |
no test coverage detected