MCPcopy Create free account
hub / github.com/Kitware/VTK / ReadElementFromStream

Method ReadElementFromStream

IO/XMLParser/vtkXMLUtilities.cxx:376–394  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

374
375//------------------------------------------------------------------------------
376vtkXMLDataElement* vtkXMLUtilities::ReadElementFromStream(istream& is, int encoding)
377{
378 vtkXMLDataElement* res = nullptr;
379 vtkXMLDataParser* xml_parser = vtkXMLDataParser::New();
380 xml_parser->SetAttributesEncoding(encoding);
381
382 xml_parser->SetStream(&is);
383 if (xml_parser->Parse())
384 {
385 res = xml_parser->GetRootElement();
386 // Bump up the ref count since we are going to delete the parser
387 // which actually owns the element
388 res->Register(nullptr);
389 vtkXMLUtilities::UnFactorElements(res);
390 }
391
392 xml_parser->Delete();
393 return res;
394}
395
396//------------------------------------------------------------------------------
397vtkXMLDataElement* vtkXMLUtilities::ReadElementFromString(const char* str, int encoding)

Callers

nothing calls this directly

Calls 6

GetRootElementMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50
SetStreamMethod · 0.45
ParseMethod · 0.45
RegisterMethod · 0.45

Tested by

no test coverage detected