mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
libsysprof-analyze: add api to get size for file
This commit is contained in:
@ -195,3 +195,20 @@ sysprof_document_file_read (SysprofDocumentFile *self)
|
||||
|
||||
return g_steal_pointer (&input);
|
||||
}
|
||||
|
||||
gsize
|
||||
sysprof_document_file_get_size (SysprofDocumentFile *self)
|
||||
{
|
||||
gsize size = 0;
|
||||
|
||||
g_return_val_if_fail (SYSPROF_IS_DOCUMENT_FILE (self), 0);
|
||||
|
||||
for (guint i = 0; i < self->file_chunks->len; i++)
|
||||
{
|
||||
SysprofDocumentFileChunk *file_chunk = g_ptr_array_index (self->file_chunks, i);
|
||||
|
||||
size += sysprof_document_file_chunk_get_size (file_chunk);
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
@ -37,5 +37,7 @@ SYSPROF_AVAILABLE_IN_ALL
|
||||
GBytes *sysprof_document_file_dup_bytes (SysprofDocumentFile *self);
|
||||
SYSPROF_AVAILABLE_IN_ALL
|
||||
GInputStream *sysprof_document_file_read (SysprofDocumentFile *self);
|
||||
SYSPROF_AVAILABLE_IN_ALL
|
||||
gsize sysprof_document_file_get_size (SysprofDocumentFile *self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
Reference in New Issue
Block a user