MCPcopy Create free account
hub / github.com/EasyRPG/Player / GetEntryType

Method GetEntryType

src/platform.cpp:257–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255#endif
256
257Platform::FileType Platform::Directory::GetEntryType() const {
258 assert(valid_entry);
259
260#if defined(__vita__)
261 return SCE_S_ISREG(entry.d_stat.st_mode) ? FileType::File :
262 SCE_S_ISDIR(entry.d_stat.st_mode) ? FileType::Directory : FileType::Other;
263#elif defined(_WIN32)
264 int attribs = entry.dwFileAttributes;
265 if (attribs == INVALID_FILE_ATTRIBUTES) {
266 return FileType::Unknown;
267 } else if ((attribs & FILE_ATTRIBUTE_DIRECTORY) == 0) {
268 return FileType::File;
269 } else if ((attribs & (FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_REPARSE_POINT)) == FILE_ATTRIBUTE_DIRECTORY) {
270 return FileType::Directory;
271 }
272 return FileType::Other;
273#else
274 return ::GetEntryType(entry);
275#endif
276}
277
278void Platform::Directory::Close() {
279 if (*this) {

Callers 2

GetDirectoryContentMethod · 0.80
platform.cppFile · 0.80

Calls 1

GetEntryTypeFunction · 0.85

Tested by

no test coverage detected