NLMISC::CAsyncFileManager::CFileLoad Class Reference

Inheritance diagram for NLMISC::CAsyncFileManager::CFileLoad:

NLMISC::IRunnable

Public Member Functions

 CFileLoad (const std::string &sFileName, uint8 **ppFile)
void getName (std::string &result) const
void run (void)

Private Attributes

std::string _FileName
uint8 ** _ppFile

Constructor & Destructor Documentation

NLMISC::CAsyncFileManager::CFileLoad::CFileLoad const std::string &  sFileName,
uint8 **  ppFile
 

Definition at line 199 of file async_file_manager.cpp.

References _ppFile, and uint8.

00200 {
00201         _FileName = sFileName;
00202         _ppFile = ppFile;
00203 }


Member Function Documentation

void NLMISC::CAsyncFileManager::CFileLoad::getName std::string &  result  )  const [virtual]
 

Reimplemented from NLMISC::IRunnable.

Definition at line 231 of file async_file_manager.cpp.

00232 {
00233         result = "FileLoad (" + _FileName + ")";
00234 }

void NLMISC::CAsyncFileManager::CFileLoad::run void   )  [virtual]
 

Implements NLMISC::IRunnable.

Definition at line 206 of file async_file_manager.cpp.

References _ppFile, nlwarning, and uint8.

00207 {
00208         FILE *f = fopen (_FileName.c_str(), "rb");
00209         if (f != NULL)
00210         {
00211                 uint8 *ptr;
00212                 long filesize=CFile::getFileSize (f);
00213                 //fseek (f, 0, SEEK_END);
00214                 //long filesize = ftell (f);
00215                 //nlSleep(5);
00216                 //fseek (f, 0, SEEK_SET);
00217                 ptr = new uint8[filesize];
00218                 fread (ptr, filesize, 1, f);
00219                 fclose (f);
00220 
00221                 *_ppFile = ptr;
00222         }
00223         else
00224         {
00225                 nlwarning ("AFM: Couldn't load '%s'", _FileName.c_str());
00226                 *_ppFile = (uint8*)-1;
00227         }
00228 }


Field Documentation

std::string NLMISC::CAsyncFileManager::CFileLoad::_FileName [private]
 

Definition at line 90 of file async_file_manager.h.

uint8** NLMISC::CAsyncFileManager::CFileLoad::_ppFile [private]
 

Definition at line 91 of file async_file_manager.h.

Referenced by CFileLoad(), and run().


The documentation for this class was generated from the following files:
Generated on Tue Mar 16 13:01:52 2004 for NeL by doxygen 1.3.6