------------------------------------------------------------------------------
| 481 | |
| 482 | //------------------------------------------------------------------------------ |
| 483 | int vtkImageReader2::OpenFile() |
| 484 | { |
| 485 | if (!this->FileName && !this->FilePattern && !this->FileNames) |
| 486 | { |
| 487 | vtkErrorMacro(<< "Either a FileName, FileNames, or FilePattern" |
| 488 | << " must be specified."); |
| 489 | return 0; |
| 490 | } |
| 491 | |
| 492 | this->CloseFile(); |
| 493 | // Open the new file |
| 494 | vtkDebugMacro(<< "Initialize: opening file " << this->InternalFileName); |
| 495 | vtksys::SystemTools::Stat_t fs; |
| 496 | if (!vtksys::SystemTools::Stat(this->InternalFileName, &fs)) |
| 497 | { |
| 498 | std::ios_base::openmode mode = ios::in; |
| 499 | #ifdef _WIN32 |
| 500 | mode |= ios::binary; |
| 501 | #endif |
| 502 | this->File = new vtksys::ifstream(this->InternalFileName, mode); |
| 503 | } |
| 504 | if (!this->File || this->File->fail()) |
| 505 | { |
| 506 | vtkErrorMacro(<< "Initialize: Could not open file " << this->InternalFileName); |
| 507 | return 0; |
| 508 | } |
| 509 | return 1; |
| 510 | } |
| 511 | |
| 512 | //------------------------------------------------------------------------------ |
| 513 | unsigned long vtkImageReader2::GetHeaderSize() |
no test coverage detected