MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / resolve

Method resolve

Engine/source/platformPOSIX/posixVolume.cpp:153–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153FileNodeRef PosixFileSystem::resolve(const Path& path)
154{
155 String file = buildFileName(_volume,path);
156 struct stat info;
157
158#ifdef TORQUE_POSIX_PATH_CASE_INSENSITIVE
159 // Resolve the case sensitive filepath
160 String::SizeType fileLength = file.length();
161 UTF8* caseSensitivePath = new UTF8[fileLength + 1];
162 dMemcpy(caseSensitivePath, file.c_str(), fileLength);
163 caseSensitivePath[fileLength] = 0x00;
164 ResolvePathCaseInsensitive(caseSensitivePath, fileLength, false);
165 String caseSensitiveFile(caseSensitivePath);
166#else
167 String caseSensitiveFile = file;
168#endif
169
170 FileNodeRef result = 0;
171 if (stat(caseSensitiveFile.c_str(),&info) == 0)
172 {
173 // Construct the appropriate object
174 if (S_ISREG(info.st_mode))
175 result = new PosixFile(path,caseSensitiveFile);
176
177 if (S_ISDIR(info.st_mode))
178 result = new PosixDirectory(path,caseSensitiveFile);
179 }
180
181#ifdef TORQUE_POSIX_PATH_CASE_INSENSITIVE
182 delete[] caseSensitivePath;
183#endif
184
185 return result;
186}
187
188FileNodeRef PosixFileSystem::create(const Path& path, FileNode::Mode mode)
189{

Callers

nothing calls this directly

Calls 6

buildFileNameFunction · 0.85
dMemcpyFunction · 0.70
statClass · 0.70
lengthMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected