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

Method SplitFileName

IO/ParallelXML/vtkXMLPDataObjectWriter.cxx:308–331  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

306
307//------------------------------------------------------------------------------
308void vtkXMLPDataObjectWriter::SplitFileName()
309{
310 // Split the FileName into its PathName, FileNameBase, and
311 // FileNameExtension components.
312
313 std::string pathname = vtksys::SystemTools::GetFilenamePath(this->FileName);
314 // Pathname may be empty if FileName is simply a filename without any leading
315 // "/".
316 if (!pathname.empty())
317 {
318 pathname += "/";
319 }
320 std::string filename_wo_ext =
321 vtksys::SystemTools::GetFilenameWithoutLastExtension(this->FileName);
322 std::string ext = vtksys::SystemTools::GetFilenameLastExtension(this->FileName);
323
324 delete[] this->PathName;
325 delete[] this->FileNameBase;
326 delete[] this->FileNameExtension;
327
328 this->PathName = vtksys::SystemTools::DuplicateString(pathname.c_str());
329 this->FileNameBase = vtksys::SystemTools::DuplicateString(filename_wo_ext.c_str());
330 this->FileNameExtension = vtksys::SystemTools::DuplicateString(ext.c_str());
331}
332
333//------------------------------------------------------------------------------
334void vtkXMLPDataObjectWriter::ProgressCallbackFunction(

Callers 1

WriteInternalMethod · 0.95

Calls 2

emptyMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected