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

Method GetSize

src/platform.cpp:104–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104int64_t Platform::File::GetSize() const {
105#if defined(_WIN32)
106 WIN32_FILE_ATTRIBUTE_DATA data;
107 BOOL res = ::GetFileAttributesExW(filename.c_str(),
108 GetFileExInfoStandard,
109 &data);
110 if (!res) {
111 return -1;
112 }
113
114 return ((int64_t)data.nFileSizeHigh << 32) | (int64_t)data.nFileSizeLow;
115#elif defined(__vita__)
116 struct SceIoStat sb = {};
117 int result = ::sceIoGetstat(filename.c_str(), &sb);
118 return (result >= 0) ? (int64_t)sb.st_size : (int64_t)-1;
119#else
120 struct stat sb = {};
121 int result = ::stat(filename.c_str(), &sb);
122 return (result == 0) ? (int64_t)sb.st_size : (int64_t)-1;
123#endif
124}
125
126bool Platform::File::MakeDirectory(bool follow_symlinks) const {
127 if (IsDirectory(follow_symlinks)) {

Callers

nothing calls this directly

Calls 1

statClass · 0.85

Tested by

no test coverage detected