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

Method SetBaseFileName

IO/Core/vtkURILoader.cxx:69–86  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

67
68//------------------------------------------------------------------------------
69bool vtkURILoader::SetBaseFileName(const std::string& filepath)
70{
71 if (!vtksys::SystemTools::FileExists(filepath))
72 {
73 vtkErrorMacro("Can not find \"" << filepath << "\"");
74 return false;
75 }
76
77 auto fullPath = vtksys::SystemTools::CollapseFullPath(filepath);
78 if (fullPath.front() != '/') // add / for windows path
79 {
80 fullPath.insert(fullPath.begin(), '/');
81 }
82
83 this->Impl->BaseURI = vtkURI::Make("file", "", vtkURI::PercentEncode(fullPath));
84
85 return this->Impl->BaseURI;
86}
87
88//------------------------------------------------------------------------------
89bool vtkURILoader::SetBaseDirectory(const std::string& dirpath)

Callers 2

TestFileLoadingFunction · 0.80

Calls 5

MakeFunction · 0.85
PercentEncodeFunction · 0.85
frontMethod · 0.45
insertMethod · 0.45
beginMethod · 0.45

Tested by 1

TestFileLoadingFunction · 0.64