---------------------------------------------------------------------------
| 1267 | |
| 1268 | //--------------------------------------------------------------------------- |
| 1269 | std::string vtkSMSessionProxyManager::LoadString(const char* filename, vtkTypeUInt32 location) |
| 1270 | { |
| 1271 | if (filename == nullptr) |
| 1272 | { |
| 1273 | vtkErrorMacro("Invalid arguments"); |
| 1274 | return std::string(); |
| 1275 | } |
| 1276 | |
| 1277 | auto proxy = vtkSMSourceProxy::SafeDownCast(this->NewProxy("internal_sources", "StringReader")); |
| 1278 | if (!proxy) |
| 1279 | { |
| 1280 | vtkErrorMacro("Failed to create string proxy reader"); |
| 1281 | return std::string(); |
| 1282 | } |
| 1283 | proxy->SetLocation(location); |
| 1284 | vtkSMPropertyHelper(proxy, "FileName").Set(filename); |
| 1285 | proxy->UpdateVTKObjects(); |
| 1286 | proxy->UpdatePipeline(); |
| 1287 | |
| 1288 | auto stringProp = vtkSMStringVectorProperty::SafeDownCast(proxy->GetProperty("String")); |
| 1289 | proxy->UpdatePropertyInformation(stringProp); |
| 1290 | const std::string contents = stringProp->GetElement(0); |
| 1291 | proxy->Delete(); |
| 1292 | return contents; |
| 1293 | } |
| 1294 | |
| 1295 | //--------------------------------------------------------------------------- |
| 1296 | bool vtkSMSessionProxyManager::SaveXMLState(const char* filename, vtkTypeUInt32 location) |
no test coverage detected