#include <ccafile.h>
Inheritance diagram for CCAsynchDiskFile:
Public Member Functions | |
CCAsynchDiskFile (UINT32 bufferSize=CCFILE_DEFAULTSIZE, BOOL ErrorReporting=TRUE, BOOL ExceptionThrowing=FALSE) | |
thread safe wrapper around CCDiskFile | |
CCAsynchDiskFile (PathName fPath, INT32 fileMode, INT32 fileAccess=0, UINT32 bufferSize=CCFILE_DEFAULTSIZE, BOOL ErrorReporting=TRUE, BOOL ExceptionThrowing=FALSE) | |
thread safe wrapper around CCDiskFile | |
~CCAsynchDiskFile () | |
thread safe wrapper around CCDiskFile | |
virtual void | GotError (UINT32 errorID, const TCHAR *errorString) |
Error handler for the CCFile class. It uses flags set in the constructor to determine if the user requires errors to be reported or exceptions thrown. | |
virtual void | GotError (UINT32 errorID) |
virtual size_t | Size () |
virtual BOOL | eof () const |
Checks eof of the file. | |
void | SetDownloadContext (LoadContext *pLContext) |
void | DownloadHasEnded (HRESULT Status) |
void | SetDontFail (BOOL state) |
Private Member Functions | |
CC_DECLARE_DYNAMIC (CCAsynchDiskFile) |
Definition at line 185 of file ccafile.h.
|
thread safe wrapper around CCDiskFile CCCAsynchDiskFile /*!
Definition at line 481 of file ccafile.cpp. 00483 :CCDiskFile( new async_fstream(),bufferSize, ErrorReporting,ExceptionThrowing) 00484 { 00485 00486 }
|
|
thread safe wrapper around CCDiskFile
Definition at line 512 of file ccafile.cpp. 00518 :CCDiskFile(new async_fstream(), 00519 fPath, 00520 fileMode, 00521 fileAccess, 00522 bufferSize, 00523 ErrorReporting, 00524 ExceptionThrowing) 00525 { 00526 00527 }
|
|
thread safe wrapper around CCDiskFile
Definition at line 542 of file ccafile.cpp.
|
|
|
|
Definition at line 697 of file ccafile.cpp. 00698 { 00699 // tell the stream buf that the download is complete 00700 ((asynchstreambuf*)(IOFile->rdbuf()))->DownloadHasEnded(Status); 00701 00702 }
|
|
Checks eof of the file.
Reimplemented from CCStreamFile. Definition at line 574 of file ccafile.cpp. 00575 { 00576 return(CCDiskFile::eof()); 00577 /* LoadContext* pLoadContext = ((asynchstreambuf*)(IOFile->rdbuf()))->GetLoadContext(); 00578 if (pLoadContext->AsynchDownLoadComplete) 00579 { 00580 return(CCDiskFile::eof()); 00581 } 00582 00583 return(FALSE);*/ 00584 }
|
|
Reimplemented from CCFile. Definition at line 636 of file ccafile.cpp. 00637 { 00638 if(DontFail) 00639 { 00640 IOFile->clear(0); 00641 return ; 00642 } 00643 00644 // Expand certain types of error messages to make them more informative 00645 switch (errorID) 00646 { 00647 case _R(IDE_OPEN_ERROR): 00648 case _R(IDE_FILE_READ_ERROR): 00649 case _R(IDE_FILE_WRITE_ERROR): 00650 // Make the error message contain handy information. 00651 SetFileErrorMessage(errorID); 00652 break; 00653 00654 case _R(IDE_ZOPEN_ERROR): 00655 case _R(IDE_ZFILE_READ_ERROR): 00656 case _R(IDE_ZFILE_WRITE_ERROR): 00657 // Make the error message contain handy information. 00658 SetZipFileErrorMessage(errorID); 00659 break; 00660 00661 default: 00662 // Just set the error normally. 00663 Error::SetError(errorID, 0); 00664 break; 00665 } 00666 00667 // Flag that no more reads/writes should happen by forcing bad() to return True. 00668 // So that if the user continues to access the file then they should get an error. 00669 SetBadState(); 00670 00671 // If the ReportErrors flag is set then report the error now. 00672 if (ReportErrors) 00673 InformError(); 00674 00675 // If the ThrowExceptions flag is set then throw an exception. 00676 // Use the CFileException with a generic or unknown error and make the ioserror 00677 // our error number. 00678 if (ThrowExceptions) 00679 { 00680 TRACE( _T("CCFile GotError call to throw exception\n")); 00681 TRACEUSER( "Chris", _T("EXCEPTION!!!!!")); 00682 // AfxThrowFileException(CFileException::generic, errorID); 00683 } 00684 }
|
|
Error handler for the CCFile class. It uses flags set in the constructor to determine if the user requires errors to be reported or exceptions thrown.
Reimplemented from CCFile. Definition at line 605 of file ccafile.cpp. 00606 { 00607 if(DontFail) 00608 { 00609 IOFile->clear(0); 00610 return ; 00611 } 00612 00613 ERROR3IF(errorString == 0, "errorString is null. Oh dear."); 00614 00615 Error::SetError(errorID, errorString, 0); 00616 00617 // Flag that no more reads/writes should happen by forcing bad() to return True/. 00618 // So that if the user continues to access the file then they should get an error. 00619 SetBadState(); 00620 00621 // If the ReportErrors flag is set then report the error now. 00622 if (ReportErrors) 00623 InformError(); 00624 00625 // If the ThrowExceptions flag is set then throw an exception. 00626 // Use the CFileException with a generic or unknown error and make the ioserror 00627 // our error number. 00628 if (ThrowExceptions) 00629 { 00630 TRACE( _T("CCFile GotError call to throw exception\n")); 00631 TRACEUSER( "Chris", _T("EXCEPTION!!!!!")); 00632 //AfxThrowFileException(CFileException::generic, errorID); 00633 } 00634 }
|
|
Reimplemented from CCLexFile. Definition at line 218 of file ccafile.h. 00218 { ((asynchstreambuf*)(IOFile->rdbuf()))->SetDontFail(state); 00219 DontFail=state;};
|
|
Definition at line 214 of file ccafile.h. 00215 { ((asynchstreambuf*)(IOFile->rdbuf()))->SetLoadContext(pLContext);};
|
|
Reimplemented from CCDiskFile. Definition at line 556 of file ccafile.cpp. 00557 { 00558 // we can't possibly know how big the file will be cause we haven't downloaded 00559 // it yet - for our purposes we will return hugely big 00560 return 0xFFFFFFF; 00561 }
|