| 458 | } |
| 459 | |
| 460 | int vtkSLCReader::CanReadFile(const char* fname) |
| 461 | { |
| 462 | FILE* fp; |
| 463 | int magic_num = 0; |
| 464 | if ((fp = vtksys::SystemTools::Fopen(fname, "rb")) == nullptr) |
| 465 | { |
| 466 | return 0; |
| 467 | } |
| 468 | |
| 469 | auto resultMagicNum = vtk::scan_value<int>(fp); |
| 470 | if (!resultMagicNum) |
| 471 | { |
| 472 | fclose(fp); |
| 473 | return 0; |
| 474 | } |
| 475 | magic_num = resultMagicNum->value(); |
| 476 | if (magic_num != 11111) |
| 477 | { |
| 478 | fclose(fp); |
| 479 | return 0; |
| 480 | } |
| 481 | fclose(fp); |
| 482 | return 3; |
| 483 | } |
| 484 | |
| 485 | void vtkSLCReader::PrintSelf(ostream& os, vtkIndent indent) |
| 486 | { |