------------------------------------------------------------------------------
| 135 | |
| 136 | //------------------------------------------------------------------------------ |
| 137 | void vtkParticleReader::OpenFile() |
| 138 | { |
| 139 | if (!this->FileName) |
| 140 | { |
| 141 | vtkErrorMacro(<< "FileName must be specified."); |
| 142 | return; |
| 143 | } |
| 144 | |
| 145 | // If the file was open close it. |
| 146 | delete this->File; |
| 147 | this->File = nullptr; |
| 148 | |
| 149 | // Open the new file. |
| 150 | vtkDebugMacro(<< "Initialize: opening file " << this->FileName); |
| 151 | std::ios_base::openmode mode = ios::in; |
| 152 | #ifdef _WIN32 |
| 153 | mode |= ios::binary; |
| 154 | #endif |
| 155 | this->File = new vtksys::ifstream(this->FileName, mode); |
| 156 | if (!this->File || this->File->fail()) |
| 157 | { |
| 158 | vtkErrorMacro(<< "Initialize: Could not open file " << this->FileName); |
| 159 | return; |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | //------------------------------------------------------------------------------ |
| 164 | int vtkParticleReader::RequestInformation(vtkInformation* vtkNotUsed(request), |
no outgoing calls
no test coverage detected