Cleaned up formatting in DefaultIOSystem.cpp

pull/2633/head
Ryan McCampbell 2019-08-19 15:36:45 -04:00
parent 0685e415ad
commit a8822a2b29
1 changed files with 20 additions and 20 deletions

View File

@ -87,7 +87,7 @@ bool DefaultIOSystem::Exists( const char* pFile) const
{ {
#if defined(_WIN32) && !defined(WindowsStore) #if defined(_WIN32) && !defined(WindowsStore)
struct __stat64 filestat; struct __stat64 filestat;
if (0 != _wstat64(Utf8ToWide(pFile).c_str(), &filestat)) { if (_wstat64(Utf8ToWide(pFile).c_str(), &filestat) != 0) {
return false; return false;
} }
#else #else
@ -104,15 +104,15 @@ bool DefaultIOSystem::Exists( const char* pFile) const
// Open a new file with a given path. // Open a new file with a given path.
IOStream* DefaultIOSystem::Open(const char* strFile, const char* strMode) IOStream* DefaultIOSystem::Open(const char* strFile, const char* strMode)
{ {
ai_assert(NULL != strFile); ai_assert(strFile != nullptr);
ai_assert(NULL != strMode); ai_assert(strMode != nullptr);
FILE* file; FILE* file;
#if defined(_WIN32) && !defined(WindowsStore) #if defined(_WIN32) && !defined(WindowsStore)
file = ::_wfopen(Utf8ToWide(strFile).c_str(), Utf8ToWide(strMode).c_str()); file = ::_wfopen(Utf8ToWide(strFile).c_str(), Utf8ToWide(strMode).c_str());
#else #else
file = ::fopen(strFile, strMode); file = ::fopen(strFile, strMode);
#endif #endif
if (nullptr == file) if (!file)
return nullptr; return nullptr;
return new DefaultIOStream(file, strFile); return new DefaultIOStream(file, strFile);
@ -209,7 +209,7 @@ std::string DefaultIOSystem::completeBaseName( const std::string &path )
{ {
std::string ret = fileName(path); std::string ret = fileName(path);
std::size_t pos = ret.find_last_of('.'); std::size_t pos = ret.find_last_of('.');
if(pos != ret.npos) ret = ret.substr(0, pos); if (pos != std::string::npos) ret = ret.substr(0, pos);
return ret; return ret;
} }