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

Method OpenStream

IO/Infovis/vtkDelimitedTextReader.cxx:228–256  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

226
227//------------------------------------------------------------------------------
228std::unique_ptr<std::istream> vtkDelimitedTextReader::OpenStream()
229{
230 if (!this->ReadFromInputString)
231 {
232 if (!this->FileName)
233 {
234 vtkErrorMacro("No Filename provided, aborting.");
235 return nullptr;
236 }
237 std::unique_ptr<std::istream> file_stream{ new vtksys::ifstream(this->FileName, ios::binary) };
238
239 if (!file_stream->good())
240 {
241 vtkErrorMacro("Unable to open input file " + std::string(this->FileName));
242 return nullptr;
243 }
244
245 return file_stream;
246 }
247 else
248 {
249 if (!this->InputString)
250 {
251 vtkErrorMacro("Empty input string, aborting.");
252 return nullptr;
253 }
254 return std::unique_ptr<std::istream>{ new std::istringstream(this->InputString) };
255 }
256}
257
258//------------------------------------------------------------------------------
259vtkTextCodec* vtkDelimitedTextReader::CreateTextCodec(std::istream* input_stream)

Callers 4

RequestInformationMethod · 0.95
ReadDataMethod · 0.95
ExecuteInformationMethod · 0.45

Calls 2

stringClass · 0.50
goodMethod · 0.45

Tested by

no test coverage detected