MCPcopy Create free account
hub / github.com/Kitware/VTK / GetDataFileFullPathName

Method GetDataFileFullPathName

IO/XML/vtkRTXMLPolyDataReader.cxx:125–150  ·  view source on GitHub ↗

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. ------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

123// caller has to free the memory of returned fullpath name.
124//------------------------------------------------------------------------------
125char* 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
152void vtkRTXMLPolyDataReader::InitializeToCurrentDir()
153{

Callers 2

NewDataAvailableMethod · 0.95
ResetReaderMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected