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

Method GetFileNameFromXML

IO/XML/vtkXMLCompositeDataReader.cxx:190–212  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

188
189//------------------------------------------------------------------------------
190std::string vtkXMLCompositeDataReader::GetFileNameFromXML(
191 vtkXMLDataElement* xmlElem, const std::string& filePath)
192{
193 // Construct the name of the internal file.
194 const char* file = xmlElem->GetAttribute("file");
195 if (!file)
196 {
197 return std::string();
198 }
199
200 std::string fileName;
201 if (!(file[0] == '/' || file[1] == ':'))
202 {
203 fileName = filePath;
204 if (!fileName.empty())
205 {
206 fileName += "/";
207 }
208 }
209 fileName += file;
210
211 return fileName;
212}
213
214//------------------------------------------------------------------------------
215vtkXMLReader* vtkXMLCompositeDataReader::GetReaderOfType(const char* type)

Callers 2

ReadDataObjectMethod · 0.95

Calls 3

stringClass · 0.50
GetAttributeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected