| 149 | } |
| 150 | |
| 151 | bool Pak::extractFileToMemory( const std::string& path, std::vector<Uint8>& data ) { |
| 152 | if ( NULL == mPak.fs || !mPak.fs->isOpen() ) { |
| 153 | return false; |
| 154 | } |
| 155 | |
| 156 | lock(); |
| 157 | |
| 158 | bool Ret = false; |
| 159 | |
| 160 | Int32 Pos = exists( path ); |
| 161 | |
| 162 | if ( Pos != -1 ) { |
| 163 | data.clear(); |
| 164 | data.resize( mPakFiles[Pos].file_length ); |
| 165 | |
| 166 | mPak.fs->seek( mPakFiles[Pos].file_position ); |
| 167 | mPak.fs->read( reinterpret_cast<char*>( &data[0] ), mPakFiles[Pos].file_length ); |
| 168 | |
| 169 | Ret = true; |
| 170 | } |
| 171 | |
| 172 | unlock(); |
| 173 | |
| 174 | return Ret; |
| 175 | } |
| 176 | |
| 177 | bool Pak::extractFileToMemory( const std::string& path, ScopedBuffer& data ) { |
| 178 | if ( NULL == mPak.fs || !mPak.fs->isOpen() ) { |
no test coverage detected