Inheritance diagram for NLMISC::CAsyncFileManager::CFileLoad:

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 |
|
||||||||||||
|
Definition at line 199 of file async_file_manager.cpp. References _ppFile, and uint8.
|
|
|
Reimplemented from NLMISC::IRunnable. Definition at line 231 of file async_file_manager.cpp.
00232 {
00233 result = "FileLoad (" + _FileName + ")";
00234 }
|
|
|
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 }
|
|
|
Definition at line 90 of file async_file_manager.h. |
|
|
Definition at line 91 of file async_file_manager.h. Referenced by CFileLoad(), and run(). |
1.3.6