Skip to content

Commit aaca71f

Browse files
authored
Convert DCIOLib documentation to Markdown
1 parent d81e7f0 commit aaca71f

2 files changed

Lines changed: 17 additions & 12 deletions

File tree

DataCompressor/DCIOLib/doc/overview.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Overview
2+
---
3+
4+
DCIOLib is a library which allows performing bit-wise reading and writing operations on buffers which are linked to either files or memory.
5+
6+
`buffer.h` (`buffer_t`): A buffer implementation for byte-wise reading and writing operations. It can be resized, if necessary, while retaining the old data. Life cycle: `AllocateBuffer` -> `InitBuffer` -> (read, write or other operations) -> `UninitBuffer` -> `FreeBuffer`
7+
8+
`file_buffer.h` (`file_buffer_t`): A buffer implementation for byte-wise reading and writing operations on files. It wraps a `buffer_t` and can thus also be used to read or write in memory. It is possible to switch between reading and writing. Life cycle: `AllocateFileBuffer` -> `InitFileBuffer` with an opened file or `InitFileBufferInMemory` -> (read, write or other operations) -> `UninitFileBuffer` -> `FreeFileBuffer`
9+
10+
`bit_file_buffer.h` (`bit_file_buffer_t`): A buffer implementation for bit-wise reading and writing on files or in memory. It provides single-bit and constant-bit-size read/write access. It uses uses a `file_buffer_t` which needs to be initialized and uninitialized separately. It is possible to switch from writing to reading; the opposite way is not supported. Life cycle: `AllocateBitFileBuffer` -> `InitBitFileBuffer` with an initialized `file_buffer_t` instance -> (read, write or other operations) -> `UninitBitFileBuffer` -> `FreeBitFileBuffer`
11+
12+
Notes on usage
13+
---
14+
15+
* Although `bit_file_buffer_t` cannot be changed from reading mode back to writing mode, it is possible to reset the buffer, which discards buffered data
16+
* When `file_buffer_t` is used to write to memory, the underlying buffer will be automatically resized when it is too small
17+
* `file_buffer_t` and `bit_file_buffer_t` flush contents automatically when they are uninitialized. To do so before uninitializing, an explicit flush operation is required

0 commit comments

Comments
 (0)