MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / openMem

Method openMem

extlibs/soloud/src/core/soloud_file.cpp:171–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169 }
170
171 result MemoryFile::openMem(unsigned char *aData, unsigned int aDataLength, bool aCopy, bool aTakeOwnership)
172 {
173 if (aData == NULL || aDataLength == 0)
174 return INVALID_PARAMETER;
175
176 if (mDataOwned)
177 delete[] mDataPtr;
178 mDataPtr = 0;
179 mOffset = 0;
180
181 mDataLength = aDataLength;
182
183 if (aCopy)
184 {
185 mDataOwned = true;
186 mDataPtr = new unsigned char[aDataLength];
187 if (mDataPtr == NULL)
188 return OUT_OF_MEMORY;
189 memcpy(mDataPtr, aData, aDataLength);
190 return SO_NO_ERROR;
191 }
192
193 mDataPtr = aData;
194 mDataOwned = aTakeOwnership;
195 return SO_NO_ERROR;
196 }
197
198 result MemoryFile::openToMem(const char *aFile)
199 {

Callers 7

WavStreamInstanceMethod · 0.80
loadMemMethod · 0.80
loadMemMethod · 0.80
loadMemMethod · 0.80
loadParamsMemMethod · 0.80
loadMemMethod · 0.80
loadMemMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected