diff options
Diffstat (limited to 'core/src/fxcrt/fxcrt_platforms.cpp')
-rw-r--r-- | core/src/fxcrt/fxcrt_platforms.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/core/src/fxcrt/fxcrt_platforms.cpp b/core/src/fxcrt/fxcrt_platforms.cpp index 813af02ce4..e7182943be 100644 --- a/core/src/fxcrt/fxcrt_platforms.cpp +++ b/core/src/fxcrt/fxcrt_platforms.cpp @@ -40,20 +40,20 @@ CFXCRT_FileAccess_CRT::~CFXCRT_FileAccess_CRT() { Close(); } -bool CFXCRT_FileAccess_CRT::Open(const CFX_ByteStringC& fileName, FX_DWORD dwMode) +FX_BOOL CFXCRT_FileAccess_CRT::Open(const CFX_ByteStringC& fileName, FX_DWORD dwMode) { if (m_hFile) { - return false; + return FALSE; } CFX_ByteString strMode; FXCRT_GetFileModeString(dwMode, strMode); m_hFile = FXSYS_fopen(fileName.GetCStr(), strMode.c_str()); return m_hFile != NULL; } -bool CFXCRT_FileAccess_CRT::Open(const CFX_WideStringC& fileName, FX_DWORD dwMode) +FX_BOOL CFXCRT_FileAccess_CRT::Open(const CFX_WideStringC& fileName, FX_DWORD dwMode) { if (m_hFile) { - return false; + return FALSE; } CFX_WideString strMode; FXCRT_GetFileModeString(dwMode, strMode); @@ -128,45 +128,45 @@ size_t CFXCRT_FileAccess_CRT::WritePos(const void* pBuffer, size_t szBuffer, FX_ FXSYS_fseek(m_hFile, pos, FXSYS_SEEK_SET); return FXSYS_fwrite(pBuffer, 1, szBuffer, m_hFile); } -bool CFXCRT_FileAccess_CRT::Flush() +FX_BOOL CFXCRT_FileAccess_CRT::Flush() { if (!m_hFile) { - return false; + return FALSE; } return !FXSYS_fflush(m_hFile); } -bool CFXCRT_FileAccess_CRT::Truncate(FX_FILESIZE szFile) +FX_BOOL CFXCRT_FileAccess_CRT::Truncate(FX_FILESIZE szFile) { - return false; + return FALSE; } -bool FX_File_Exist(const CFX_ByteStringC& fileName) +FX_BOOL FX_File_Exist(const CFX_ByteStringC& fileName) { return access(fileName.GetCStr(), F_OK) > -1; } -bool FX_File_Exist(const CFX_WideStringC& fileName) +FX_BOOL FX_File_Exist(const CFX_WideStringC& fileName) { return FX_File_Exist(FX_UTF8Encode(fileName)); } -bool FX_File_Delete(const CFX_ByteStringC& fileName) +FX_BOOL FX_File_Delete(const CFX_ByteStringC& fileName) { return remove(fileName.GetCStr()) > -1; } -bool FX_File_Delete(const CFX_WideStringC& fileName) +FX_BOOL FX_File_Delete(const CFX_WideStringC& fileName) { return FX_File_Delete(FX_UTF8Encode(fileName)); } -bool FX_File_Copy(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fileNameDst) +FX_BOOL FX_File_Copy(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fileNameDst) { CFXCRT_FileAccess_CRT src, dst; if (!src.Open(fileNameSrc, FX_FILEMODE_ReadOnly)) { - return false; + return FALSE; } FX_FILESIZE size = src.GetSize(); if (!size) { - return false; + return FALSE; } if (!dst.Open(fileNameDst, FX_FILEMODE_Truncate)) { - return false; + return FALSE; } FX_FILESIZE num = 0; uint8_t* pBuffer = FX_Alloc(uint8_t, 32768); @@ -176,17 +176,17 @@ bool FX_File_Copy(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fil } } FX_Free(pBuffer); - return true; + return TRUE; } -bool FX_File_Copy(const CFX_WideStringC& fileNameSrc, const CFX_WideStringC& fileNameDst) +FX_BOOL FX_File_Copy(const CFX_WideStringC& fileNameSrc, const CFX_WideStringC& fileNameDst) { return FX_File_Copy(FX_UTF8Encode(fileNameSrc), FX_UTF8Encode(fileNameDst)); } -bool FX_File_Move(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fileNameDst) +FX_BOOL FX_File_Move(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fileNameDst) { return rename(fileNameSrc.GetCStr(), fileNameDst.GetCStr()); } -bool FX_File_Move(const CFX_WideStringC& fileNameSrc, const CFX_WideStringC& fileNameDst) +FX_BOOL FX_File_Move(const CFX_WideStringC& fileNameSrc, const CFX_WideStringC& fileNameDst) { return FX_File_Move(FX_UTF8Encode(fileNameSrc), FX_UTF8Encode(fileNameDst)); } |