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

Method LoadFile

IO/Core/vtkURILoader.cxx:194–215  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

192
193//------------------------------------------------------------------------------
194vtkSmartPointer<vtkResourceStream> vtkURILoader::LoadFile(const vtkURI& uri)
195{
196 // Decode
197 auto decodedPath = vtkURI::PercentDecode(uri.GetPath().GetValue());
198
199 auto cpath = decodedPath.c_str();
200#if defined(_WIN32)
201 if (*cpath == '/') // discard first / on Windows
202 {
203 ++cpath;
204 }
205#endif
206
207 auto stream = vtkSmartPointer<vtkFileResourceStream>::New();
208 if (!stream->Open(cpath))
209 {
210 vtkErrorMacro("Failed to open file \"" << cpath << "\"");
211 return nullptr;
212 }
213
214 return stream;
215}
216
217namespace
218{

Callers 1

DoLoadMethod · 0.95

Calls 6

PercentDecodeFunction · 0.85
NewFunction · 0.50
GetValueMethod · 0.45
GetPathMethod · 0.45
c_strMethod · 0.45
OpenMethod · 0.45

Tested by

no test coverage detected