MCPcopy Create free account
hub / github.com/SpartanJ/eepp / extractFileToMemory

Method extractFileToMemory

src/eepp/system/pak.cpp:151–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151bool 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
177bool Pak::extractFileToMemory( const std::string& path, ScopedBuffer& data ) {
178 if ( NULL == mPak.fs || !mPak.fs->isOpen() ) {

Callers 15

loadFromPackMethod · 0.45
loadFromPackMethod · 0.45
initMethod · 0.45
initMethod · 0.45
loadFromPackMethod · 0.45
openFromPackMethod · 0.45
loadFromPackMethod · 0.45
ShaderMethod · 0.45
loadFromPackMethod · 0.45
getInfoMethod · 0.45
loadFromPackMethod · 0.45
loadFromPackMethod · 0.45

Calls 8

isOpenMethod · 0.45
clearMethod · 0.45
resizeMethod · 0.45
seekMethod · 0.45
readMethod · 0.45
resetMethod · 0.45
getMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected