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

Method OpenFile

IO/Core/vtkJavaScriptDataWriter.cxx:70–92  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

68
69//------------------------------------------------------------------------------
70bool vtkJavaScriptDataWriter::OpenFile()
71{
72 if (!this->FileName)
73 {
74 vtkErrorMacro(<< "No FileName specified! Can't write!");
75 this->SetErrorCode(vtkErrorCode::NoFileNameError);
76 return false;
77 }
78
79 this->CloseFile();
80 vtkDebugMacro(<< "Opening file for writing...");
81
82 this->OutputFile = new vtksys::ofstream(this->FileName, ios::out);
83 if (this->OutputFile->fail())
84 {
85 vtkErrorMacro(<< "Unable to open file: " << this->FileName);
86 this->SetErrorCode(vtkErrorCode::CannotOpenFileError);
87 this->CloseFile();
88 return false;
89 }
90
91 return true;
92}
93
94//------------------------------------------------------------------------------
95void vtkJavaScriptDataWriter::WriteData()

Callers 2

WriteDataMethod · 0.95
WriteTableMethod · 0.95

Calls 1

CloseFileMethod · 0.95

Tested by

no test coverage detected