Add utilities to write strings to file

This commit is contained in:
Abdelrahman Said
2026-06-23 23:48:02 +01:00
parent 7a314a0038
commit 99902cfa99
2 changed files with 12 additions and 0 deletions
+10
View File
@@ -56,6 +56,16 @@ i64 wapp_file_write(const void *src_buf, WFile *file, u64 byte_count) {
return _file_write(src_buf, file, byte_count);
}
u64 wapp_file_read_str8(Str8 *str, WFile *file) {
wapp_debug_assert(str != NULL, "`str` should not be NULL.");
return wapp_file_read((void *)(str->buf), file, str->size);
}
i64 wapp_file_write_str8(Str8RO *str, WFile *file) {
wapp_debug_assert(str != NULL, "`str` should not be NULL.");
return wapp_file_write((void *)(str->buf), file, str->size);
}
u64 wapp_file_read_array(GenericArray dst_buf, WFile *file, u64 item_count) {
wapp_debug_assert(dst_buf != NULL && file != NULL,
"`dst_buf` and `file` should not be NULL.");