------------------------------------------------------------------------------ vtkSetStringMacro except we clear some variables if we update the value
| 54 | //------------------------------------------------------------------------------ |
| 55 | // vtkSetStringMacro except we clear some variables if we update the value |
| 56 | void vtkPTSReader::SetFileName(const char* filename) |
| 57 | { |
| 58 | vtkDebugMacro(<< this->GetClassName() << " (" << this << "): setting FileName to " << filename); |
| 59 | if (this->FileName == nullptr && filename == nullptr) |
| 60 | { |
| 61 | return; |
| 62 | } |
| 63 | if (this->FileName && filename && !strcmp(this->FileName, filename)) |
| 64 | { |
| 65 | return; |
| 66 | } |
| 67 | delete[] this->FileName; |
| 68 | if (filename) |
| 69 | { |
| 70 | size_t n = strlen(filename) + 1; |
| 71 | char* cp1 = new char[n]; |
| 72 | const char* cp2 = (filename); |
| 73 | this->FileName = cp1; |
| 74 | do |
| 75 | { |
| 76 | *cp1++ = *cp2++; |
| 77 | } while (--n); |
| 78 | } |
| 79 | else |
| 80 | { |
| 81 | this->FileName = nullptr; |
| 82 | } |
| 83 | this->Modified(); |
| 84 | } |
| 85 | |
| 86 | //------------------------------------------------------------------------------ |
| 87 | int vtkPTSReader::RequestInformation(vtkInformation* vtkNotUsed(request), |