document the buffer flags

Wed, 26 Mar 2025 16:38:08 +0100

author
Mike Becker <universe@uap-core.de>
date
Wed, 26 Mar 2025 16:38:08 +0100
changeset 1263
f993745c60f0
parent 1262
7cc81244b28a
child 1264
8ff604356af7

document the buffer flags

relates to #451

docs/Writerside/topics/buffer.h.md file | annotate | diff | comparison | revisions
--- a/docs/Writerside/topics/buffer.h.md	Wed Mar 26 12:26:20 2025 +0100
+++ b/docs/Writerside/topics/buffer.h.md	Wed Mar 26 16:38:08 2025 +0100
@@ -42,6 +42,15 @@
 TODO: document
 </warning>
 
+| Flag                     | Description                                                                                                                                                                                                   |
+|--------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| CX_BUFFER_DEFAULT        | Alias for zero, meaning no flags are set.                                                                                                                                                                     |
+| CX_BUFFER_FREE_CONTENTS  | When the buffer structure is [destroyed](#destroy), the memory for the contents is also automatically deallocated.                                                                                            |
+| CX_BUFFER_AUTO_EXTEND    | When a write operation would exceed the buffers capacity, the buffer is grown automatically with a call to `cxBufferMinimumCapacity()`.                                                                       |
+| CX_BUFFER_COPY_ON_WRITE  | Any write operation will result in allocating a copy of the data, first. This is particularly useful, when a buffer is initialized with read-only memory.                                                     |
+| CX_BUFFER_COPY_ON_EXTEND | Only when a write operation would exceed the buffers capacity, the copy-on-write operation is performed. This is useful, when a buffer is initialized with read-write memory which is allocated on the stack. |
+
+
 ## Destroy
 
 ```C

mercurial