------------------------------------------------------------------------------
| 100 | |
| 101 | //------------------------------------------------------------------------------ |
| 102 | FILE* vtkProStarReader::OpenFile(const char* ext) |
| 103 | { |
| 104 | std::string fullName = this->FileName; |
| 105 | const char* dot = strrchr(this->FileName, '.'); |
| 106 | |
| 107 | if (dot != nullptr && |
| 108 | (strcmp(dot, ".cel") == 0 || strcmp(dot, ".vrt") == 0 || strcmp(dot, ".inp") == 0)) |
| 109 | { |
| 110 | fullName.resize(dot - this->FileName); |
| 111 | } |
| 112 | |
| 113 | fullName += ext; |
| 114 | FILE* in = vtksys::SystemTools::Fopen(fullName, "r"); |
| 115 | if (in == nullptr) |
| 116 | { |
| 117 | vtkErrorMacro(<< "Error opening file: " << fullName); |
| 118 | this->SetErrorCode(vtkErrorCode::CannotOpenFileError); |
| 119 | } |
| 120 | |
| 121 | return in; |
| 122 | } |
| 123 | |
| 124 | // |
| 125 | // read in the points from the .vrt file |
no test coverage detected