Add utility for checking if a file is empty or not

This commit is contained in:
Kawe Mazidjatari 2022-09-10 00:06:26 +02:00
parent 3b237a827f
commit b0fc8fb46c
2 changed files with 8 additions and 0 deletions

View File

@ -13,6 +13,13 @@ BOOL FileExists(const fs::path& svFilePath)
return fs::exists(svFilePath);
}
///////////////////////////////////////////////////////////////////////////////
// For checking if a specific file is empty.
BOOL FileEmpty(ifstream& pFile)
{
return pFile.peek() == ifstream::traits_type::eof();
}
///////////////////////////////////////////////////////////////////////////////
// For checking if pointer is valid or bad.
BOOL IsBadReadPtrV2(void* ptr)

View File

@ -4,6 +4,7 @@
// Internals
BOOL IsBadReadPtrV2(void* ptr);
BOOL FileExists(const fs::path& svFilePath);
BOOL FileEmpty(ifstream& pFile);
MODULEINFO GetModuleInfo(const char* szModule);
/////////////////////////////////////////////////////////////////////////////