No more useless errors/warnings at all!

This commit is contained in:
Arthur Blot 2013-01-02 01:08:18 +01:00
parent 73de0e9494
commit c2851467e5
3 changed files with 17 additions and 11 deletions

View File

@ -490,19 +490,22 @@ PSPFileInfo DirectoryFileSystem::GetFileInfo(std::string filename) {
return x;
#endif
}
x.type = File::IsDirectory(fullName) ? FILETYPE_NORMAL : FILETYPE_DIRECTORY;
x.type = File::IsDirectory(fullName) ? FILETYPE_DIRECTORY : FILETYPE_NORMAL;
x.exists = true;
if (x.type != FILETYPE_DIRECTORY)
{
#ifdef _WIN32
WIN32_FILE_ATTRIBUTE_DATA data;
GetFileAttributesEx(fullName.c_str(), GetFileExInfoStandard, &data);
WIN32_FILE_ATTRIBUTE_DATA data;
GetFileAttributesEx(fullName.c_str(), GetFileExInfoStandard, &data);
x.size = data.nFileSizeLow | ((u64)data.nFileSizeHigh<<32);
x.size = data.nFileSizeLow | ((u64)data.nFileSizeHigh<<32);
#else
x.size = File::GetSize(fullName);
//TODO
x.size = File::GetSize(fullName);
//TODO
#endif
x.mtime = File::GetModifTime(fullName);
x.mtime = File::GetModifTime(fullName);
}
return x;
}

View File

@ -240,7 +240,7 @@ nextblock:
}
ISOFileSystem::TreeEntry *ISOFileSystem::GetFromPath(std::string path)
ISOFileSystem::TreeEntry *ISOFileSystem::GetFromPath(std::string path, bool catchError)
{
if (path.length() == 0)
{
@ -297,7 +297,10 @@ ISOFileSystem::TreeEntry *ISOFileSystem::GetFromPath(std::string path)
}
else
{
ERROR_LOG(FILESYS,"File %s not found", path.c_str());
if (catchError)
{
ERROR_LOG(FILESYS,"File %s not found", path.c_str());
}
return 0;
}
}
@ -502,7 +505,7 @@ PSPFileInfo ISOFileSystem::GetFileInfo(std::string filename)
return fileInfo;
}
TreeEntry *entry = GetFromPath(filename);
TreeEntry *entry = GetFromPath(filename, false);
PSPFileInfo x;
if (!entry)
{

View File

@ -67,7 +67,7 @@ class ISOFileSystem : public IFileSystem
TreeEntry entireISO;
void ReadDirectory(u32 startsector, u32 dirsize, TreeEntry *root);
TreeEntry *GetFromPath(std::string path);
TreeEntry *GetFromPath(std::string path, bool catchError=true);
std::string EntryFullPath(TreeEntry *e);
public: