Add error state

This commit is contained in:
2015-07-22 13:40:22 -07:00
parent 572d04a0d5
commit a7fda281b9
5 changed files with 46 additions and 0 deletions

View File

@@ -33,6 +33,7 @@ void FileReader::open()
if (!m_fileHandle)
{
atError("File not found '%s'", m_filename.c_str());
setError();
return;
}
@@ -45,6 +46,7 @@ void FileReader::close()
if (!m_fileHandle)
{
atError("Cannot close an unopened stream");
setError();
return;
}
@@ -120,6 +122,7 @@ atUint64 FileReader::readUBytesToBuf(void* buf, atUint64 len)
if (!isOpen())
{
atError("File not open for reading");
setError();
return 0;
}