SpiecsEngine
 
Loading...
Searching...
No Matches

◆ FileLibrary_Write()

bool Spices::FileLibrary::FileLibrary_Write ( const FileHandle * handle,
uint64_t data_size,
const void * data,
uint64_t * out_bytes_written )
static

Write given data to the file handle pointer.

Parameters
[in]handleThe file handle.
[in]data_sizeHow much bytes we want write and move pointer.
[in]dataThe data we want write in.
[out]out_bytes_writtenHow much bytes we written.
Returns
true if file handle is valid and successfully write data.

Definition at line 141 of file FileLibrary.cpp.

142 {
144
145 if (handle->handle)
146 {
147 *out_bytes_written = fwrite(data, 1, data_size, static_cast<FILE*>(handle->handle));
148 if (*out_bytes_written != data_size)
149 {
150 return false;
151 }
152 auto state = fflush(static_cast<FILE*>(handle->handle));
153 return true;
154 }
155 return false;
156 }
#define SPICES_PROFILE_ZONE

References Spices::FileHandle::handle.

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