| 351 | } |
| 352 | |
| 353 | std::vector<std::string> OMFFile::ReadStringArrayFromStream(const std::string& uid) |
| 354 | { |
| 355 | // strings are stored directly in json so no need to worry about decompression or anything |
| 356 | const auto& json = this->Impl->JSONRoot[uid]; |
| 357 | std::vector<std::string> retVal; |
| 358 | if (json.isNull() || !json.isObject() || !json.isMember("array") || !json.isMember("__class__") || |
| 359 | json["__class__"] != "StringArray") |
| 360 | { |
| 361 | return retVal; |
| 362 | } |
| 363 | |
| 364 | const auto& arrayJSON = json["array"]; |
| 365 | if (!arrayJSON.isArray()) |
| 366 | { |
| 367 | return retVal; |
| 368 | } |
| 369 | retVal.resize(arrayJSON.size()); |
| 370 | for (Json::Value::ArrayIndex i = 0, vecIdx = 0; i < arrayJSON.size(); ++i, ++vecIdx) |
| 371 | { |
| 372 | const auto& element = arrayJSON[i]; |
| 373 | helper::GetStringValue(element, retVal[vecIdx]); |
| 374 | } |
| 375 | return retVal; |
| 376 | } |
| 377 | |
| 378 | VTK_ABI_NAMESPACE_END |
| 379 | } // end namespace omf |
no test coverage detected