MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / readBuffer

Method readBuffer

TheForceEngine/TFE_FileSystem/filestream.cpp:202–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200}
201
202u32 FileStream::readBuffer(void* ptr, u32 size, u32 count)
203{
204 assert(m_mode == MODE_READ || m_mode == MODE_READWRITE || m_mode == MODE_APPEND);
205 if (m_file)
206 {
207 // fread() returns the number of *elements* read, but we want the number of bytes read.
208 return (u32)fread(ptr, size, count, m_file) * size;
209 }
210 else if (m_archive)
211 {
212 return (u32)m_archive->readFile(ptr, size * count);
213 }
214 return 0;
215}
216
217void FileStream::writeBuffer(const void* ptr, u32 size, u32 count)
218{

Callers 15

restoreFunction · 0.45
region_restoreFromDiskFunction · 0.45
loadMessagesFunction · 0.45
readScriptFileTFEFunction · 0.45
validateMethod · 0.45
openMethod · 0.45
readFileMethod · 0.45
addFileMethod · 0.45
openMethod · 0.45
readFileMethod · 0.45
openMethod · 0.45
readFileMethod · 0.45

Calls 1

readFileMethod · 0.45

Tested by

no test coverage detected