SpiecsEngine
 
Loading...
Searching...
No Matches

◆ FileLibrary_Size()

bool Spices::FileLibrary::FileLibrary_Size ( const FileHandle * handle,
uint64_t * out_size )
static

Calculate The file size.

Parameters
[in]handleThe file handle.
[out]out_sizeThe file size(byte).
Returns
true if file handle is valid.

Definition at line 78 of file FileLibrary.cpp.

79 {
81
82 if (handle->handle)
83 {
84 auto state = fseek(static_cast<FILE*>(handle->handle), 0, SEEK_END);
85 *out_size = ftell(static_cast<FILE*>(handle->handle));
86 rewind(static_cast<FILE*>(handle->handle));
87 return true;
88 }
89 return false;
90 }
#define SPICES_PROFILE_ZONE

References Spices::FileHandle::handle.

Referenced by FileLibrary_Read_all_bytes(), SpicesTest::TEST(), and Spices::VulkanShaderModule::VulkanShaderModule().