------------------------------------------------------------------------------
| 2112 | |
| 2113 | //------------------------------------------------------------------------------ |
| 2114 | vtkSmartPointer<vtkResourceStream> vtkFDSReader::Open() |
| 2115 | { |
| 2116 | if (this->Internals->Stream) |
| 2117 | { |
| 2118 | if (this->Internals->Stream->SupportSeek()) |
| 2119 | { |
| 2120 | this->Internals->Stream->Seek(0, vtkResourceStream::SeekDirection::Begin); |
| 2121 | } |
| 2122 | |
| 2123 | return this->Internals->Stream; |
| 2124 | } |
| 2125 | |
| 2126 | auto fileStream = vtkSmartPointer<vtkFileResourceStream>::New(); |
| 2127 | if (this->FileName.empty() || !fileStream->Open(this->FileName.c_str())) |
| 2128 | { |
| 2129 | vtkErrorMacro(<< "Failed to open file: " |
| 2130 | << (this->FileName.empty() ? "No file name set" : this->FileName)); |
| 2131 | return nullptr; |
| 2132 | } |
| 2133 | |
| 2134 | return fileStream; |
| 2135 | } |
| 2136 | |
| 2137 | //------------------------------------------------------------------------------ |
| 2138 | std::string vtkFDSReader::SanitizeName(const std::string& name) |
no test coverage detected