SpiecsEngine
 
Loading...
Searching...
No Matches

◆ FileLibrary_Read()

bool Spices::FileLibrary::FileLibrary_Read ( const FileHandle * handle,
uint64_t data_size,
void * out_data,
uint64_t * out_bytes_read )
static

Read Specific size of data form the current file handle pointer, and move pointer the same size.

Parameters
[in]handleThe file handle.
[in]data_sizeHow much bytes we want read and move pointer.
[out]out_dataThe data we read.
[out]out_bytes_readHow much bytes we read.
Returns
true if file handle is valid and successfully read data.

Definition at line 92 of file FileLibrary.cpp.

93 {
95
96 if (handle->handle && out_data)
97 {
98 *out_bytes_read = fread(out_data, 1, data_size, static_cast<FILE*>(handle->handle));
99 if (*out_bytes_read != data_size)
100 {
101 return false;
102 }
103 return true;
104 }
105 return false;
106 }
#define SPICES_PROFILE_ZONE

References Spices::FileHandle::handle.

Referenced by Spices::MeshLoader::LoadFromSASSET(), Spices::MaterialLoader::LoadFromSASSET(), and SpicesTest::TEST().