Platform modtime, little changes to entergame

This commit is contained in:
Henrique Santiago
2013-03-01 05:08:30 -03:00
parent 120c2b4231
commit e85afd4b63
6 changed files with 28 additions and 5 deletions

View File

@@ -43,6 +43,7 @@ public:
std::string getCPUName();
double getTotalSystemMemory();
std::string getOSName();
time_t getFileModificationTime(const std::string& filename);
};
extern Platform g_platform;

View File

@@ -160,5 +160,15 @@ std::string Platform::getOSName()
return std::string();
}
time_t Platform::getFileModificationTime(const std::string& filename)
{
struct stat attrib;
if(stat(filename.c_str(), &attrib))
perror(filename.c_str());
else
return attrib.st_mtime;
return 0;
}
#endif

View File

@@ -401,4 +401,13 @@ std::string Platform::getOSName()
return ret;
}
time_t Platform::getFileModificationTime(const std::string& filename)
{
//TODO
/*WIN32_FILE_ATTRIBUTE_DATA fileAttrData = {0};
GetFileAttributesEx(filename.c_str(), GetFileExInfoStandard, &fileAttrData);
return fileAttrData.ftLastWriteTime;*/
return 0;
}
#endif