added missing getFileSize() method for winrt

This commit is contained in:
Dale Stammen 2016-01-19 12:36:10 -08:00
parent f33140b051
commit a64be12646
2 changed files with 14 additions and 0 deletions

View File

@ -129,6 +129,19 @@ std::string CCFileUtilsWinRT::getSuitableFOpen(const std::string& filenameUtf8)
return UTF8StringToMultiByte(filenameUtf8);
}
long CCFileUtilsWinRT::getFileSize(const std::string &filepath)
{
WIN32_FILE_ATTRIBUTE_DATA fad;
if (!GetFileAttributesEx(StringUtf8ToWideChar(filepath).c_str(), GetFileExInfoStandard, &fad))
{
return 0; // error condition, could call GetLastError to find out more
}
LARGE_INTEGER size;
size.HighPart = fad.nFileSizeHigh;
size.LowPart = fad.nFileSizeLow;
return (long)size.QuadPart;
}
bool CCFileUtilsWinRT::isFileExistInternal(const std::string& strFilePath) const
{
bool ret = false;

View File

@ -53,6 +53,7 @@ public:
virtual std::string getFullPathForDirectoryAndFilename(const std::string& strDirectory, const std::string& strFilename) const override;
virtual std::string getStringFromFile(const std::string& filename) override;
virtual std::string getSuitableFOpen(const std::string& filenameUtf8) const override;
virtual long getFileSize(const std::string &filepath);
static std::string getAppPath();
private: