Description: Internal method to return the fullpath name of a file, which is the concatenation of "this->DataLocation" and "name" caller has to free the memory of returned fullpath name. ------------------------------------------------------------------------------
| 123 | // caller has to free the memory of returned fullpath name. |
| 124 | //------------------------------------------------------------------------------ |
| 125 | char* vtkRTXMLPolyDataReader::GetDataFileFullPathName(const char* name) |
| 126 | { |
| 127 | char* fullpath; |
| 128 | int n = static_cast<int>(strlen(this->DataLocation)); |
| 129 | int m = static_cast<int>(strlen(name)); |
| 130 | fullpath = new char[n + m + 2]; |
| 131 | strcpy(fullpath, this->DataLocation); |
| 132 | #if defined(_WIN32) // WINDOW style path |
| 133 | if (fullpath[n - 1] != '/' && fullpath[n - 1] != '\\') |
| 134 | { |
| 135 | #if !defined(__CYGWIN__) |
| 136 | fullpath[n++] = '\\'; |
| 137 | #else |
| 138 | fullpath[n++] = '/'; |
| 139 | #endif |
| 140 | } |
| 141 | #else // POSIX style path |
| 142 | if (fullpath[n - 1] != '/') |
| 143 | { |
| 144 | fullpath[n++] = '/'; |
| 145 | } |
| 146 | #endif // |
| 147 | strcpy(&fullpath[n], name); |
| 148 | |
| 149 | return fullpath; |
| 150 | } |
| 151 | |
| 152 | void vtkRTXMLPolyDataReader::InitializeToCurrentDir() |
| 153 | { |
no outgoing calls
no test coverage detected