| 219 | } |
| 220 | |
| 221 | result MemoryFile::openFileToMem(File *aFile) |
| 222 | { |
| 223 | if (!aFile) |
| 224 | return INVALID_PARAMETER; |
| 225 | if (mDataOwned) |
| 226 | delete[] mDataPtr; |
| 227 | mDataPtr = 0; |
| 228 | mOffset = 0; |
| 229 | |
| 230 | mDataLength = aFile->length(); |
| 231 | mDataPtr = new unsigned char[mDataLength]; |
| 232 | if (mDataPtr == NULL) |
| 233 | return OUT_OF_MEMORY; |
| 234 | aFile->read((unsigned char*)mDataPtr, mDataLength); |
| 235 | mDataOwned = true; |
| 236 | return SO_NO_ERROR; |
| 237 | } |
| 238 | |
| 239 | int MemoryFile::eof() |
| 240 | { |
no test coverage detected